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 = setTimeout(runTest, 0); |
Nate Chapin
2016/04/07 23:46:16
Without the setTimeout(,0), the font load would st
hiroshige
2016/04/08 01:02:04
Shouldn't this be |window.onload = function() { se
Nate Chapin
2016/04/11 18:47:32
Wow, I'm bad at Javascript. Done.
| |
22 | |
23 function runTest() { | |
22 document.getElementById('test').classList.add('test'); | 24 document.getElementById('test').classList.add('test'); |
23 setTimeout(function() { | 25 setTimeout(function() { |
24 var newStyle = document.createElement('style'); | 26 var newStyle = document.createElement('style'); |
25 newStyle.innerHTML = "@font-face { font-family: dummy; src: local('Couri er New'); }"; | 27 newStyle.innerHTML = "@font-face { font-family: dummy; src: local('Couri er New'); }"; |
26 document.body.insertBefore(newStyle, document.getElementById('target')); | 28 document.body.insertBefore(newStyle, document.getElementById('target')); |
27 setTimeout(function() { | 29 setTimeout(function() { |
28 if (window.testRunner) | 30 if (window.testRunner) |
29 testRunner.notifyDone(); | 31 testRunner.notifyDone(); |
30 }, 0); | 32 }, 0); |
31 }, 500); | 33 }, 500); |
32 }; | 34 }; |
33 </script> | 35 </script> |
34 </body> | 36 </body> |
OLD | NEW |