Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(300)

Side by Side Diff: third_party/WebKit/LayoutTests/http/tests/webfont/css-change-in-swap-period.html

Issue 1829403002: Clean up font loading (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@Resource_status
Patch Set: Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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>
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/core.gypi » ('j') | third_party/WebKit/Source/core/css/FontLoader.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698