Move parseFontFaceDescriptor to CSSPropertyParser.cpp
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / fast / css / fontfaceset-events.html
blob0cc7089ee6d40556ba7b78da7f47ac0325b01305
1 <html>
2 <head>
3 <script src="../../resources/js-test.js"></script>
4 <style>
5 @font-face {
6 font-family: 'ahem';
7 src: url(../../resources/Ahem.ttf);
9 </style>
10 <script>
11 description('Test that the event handlers of FontFaceSet are called in the correct order.');
13 window.jsTestIsAsync = true;
15 var event;
16 var numberOfEvents = 0;
18 function handleEvent(e) {
19 event = e;
20 shouldBeEqualToString('event.type', ['loading', 'loadingdone'][numberOfEvents]);
21 numberOfEvents++;
24 function runTests() {
25 document.fonts.onloading = handleEvent;
26 document.fonts.onloadingdone = handleEvent;
27 document.fonts.onloadingerror = handleEvent;
29 document.fonts.ready.then(function() {
30 shouldBe('numberOfEvents', '2');
31 finishJSTest();
32 });
35 if (document.fonts)
36 runTests();
37 else {
38 testFailed('document.fonts does not exist');
39 finishJSTest();
41 </script>
42 </head>
43 <body>
44 <div style="font-family: ahem">Hello, world!</div>
45 </body>
46 </html>