OLD | NEW |
1 <!doctype html> | 1 <!doctype html> |
2 <html> | 2 <html> |
3 <body> | 3 <body> |
4 <style id="target"> | 4 <style id="target"> |
5 @font-face { | 5 @font-face { |
6 font-family: TestFont; | 6 font-family: TestFont; |
7 src: local(nonexistent), url(slow-ahem-loading.cgi); | 7 src: local(nonexistent), url(slow-ahem-loading.cgi); |
8 } | 8 } |
9 </style> | 9 </style> |
10 <span id="testSpan">A</span> | 10 <span id="testSpan">A</span> |
11 <script> | 11 <script> |
12 if (window.testRunner) | 12 if (window.testRunner) |
13 testRunner.waitUntilDone(); | 13 testRunner.waitUntilDone(); |
14 | 14 |
15 // Set the span's style and register a font ready listener in the same microtask
so that font can't | 15 // Set the span's style and register a font ready listener in the same microtask
so that font can't |
16 // load before we've had a chance to register the listener. | 16 // load before we've had a chance to register the listener. |
17 document.getElementById('testSpan').style.fontFamily = "TestFont"; | 17 document.getElementById('testSpan').style.fontFamily = "TestFont"; |
18 | 18 |
19 if (window.testRunner) | 19 if (window.testRunner) |
20 document.fonts.ready().then(function() { testRunner.notifyDone(); }); | 20 document.fonts.ready.then(function() { testRunner.notifyDone(); }); |
21 | 21 |
22 var style = document.getElementById('target'); | 22 var style = document.getElementById('target'); |
23 style.parentNode.removeChild(style); | 23 style.parentNode.removeChild(style); |
24 document.body.offsetLeft; | 24 document.body.offsetLeft; |
25 document.body.appendChild(style); | 25 document.body.appendChild(style); |
26 </script> | 26 </script> |
27 </body> | 27 </body> |
28 </html> | 28 </html> |
OLD | NEW |