OLD | NEW |
1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
2 <body> | 2 <body> |
3 <style id="target"> | 3 <style id="target"> |
4 @font-face { | 4 @font-face { |
5 font-family: slow; | 5 font-family: slow; |
6 src: url(slow-ahem-loading.cgi?delay=8000); | 6 src: url(slow-ahem-loading.cgi?delay=8000); |
7 font-display: fallback; | 7 font-display: fallback; |
8 } | 8 } |
9 .test { | 9 .test { |
10 font-family: slow, Arial; | 10 font-family: slow, Arial; |
11 font-size: 50px; | 11 font-size: 50px; |
12 } | 12 } |
13 </style> | 13 </style> |
14 <p>CSS change should not make loading-fallback text blank.</p> | 14 <p>CSS change should not make loading-fallback text blank.</p> |
15 <div id="test">abcdefg</div> | 15 <div id="test">abcdefg</div> |
16 <script> | 16 <script> |
17 | 17 |
18 if (window.testRunner) | 18 if (window.testRunner) |
19 testRunner.waitUntilDone(); | 19 testRunner.waitUntilDone(); |
20 | 20 |
21 window.onload = function() { | 21 window.onload = function() { |
| 22 setTimeout(runTest, 0); |
| 23 }; |
| 24 |
| 25 function runTest() { |
22 document.getElementById('test').classList.add('test'); | 26 document.getElementById('test').classList.add('test'); |
23 setTimeout(function() { | 27 setTimeout(function() { |
24 var newStyle = document.createElement('style'); | 28 var newStyle = document.createElement('style'); |
25 newStyle.innerHTML = "@font-face { font-family: dummy; src: local('Couri
er New'); }"; | 29 newStyle.innerHTML = "@font-face { font-family: dummy; src: local('Couri
er New'); }"; |
26 document.body.insertBefore(newStyle, document.getElementById('target')); | 30 document.body.insertBefore(newStyle, document.getElementById('target')); |
27 setTimeout(function() { | 31 setTimeout(function() { |
28 if (window.testRunner) | 32 if (window.testRunner) |
29 testRunner.notifyDone(); | 33 testRunner.notifyDone(); |
30 }, 0); | 34 }, 0); |
31 }, 500); | 35 }, 500); |
32 }; | 36 }; |
33 </script> | 37 </script> |
34 </body> | 38 </body> |
OLD | NEW |