OLD | NEW |
1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
2 <title>Test for font-display @font-face descriptor</title> | 2 <title>Test for font-display @font-face descriptor</title> |
3 <style> | 3 <style> |
4 .hidden { display: none; } | 4 .hidden { display: none; } |
5 </style> | 5 </style> |
6 <p>Tests how text with a font that takes <i>delay</i> seconds to load look like
after <i>T</i> seconds from load start.</p> | 6 <p>Tests how text with a font that takes <i>delay</i> seconds to load look like
after <i>T</i> seconds from load start.</p> |
7 <table id="container"> | 7 <table id="container"> |
8 <tr> | 8 <tr> |
9 <th>T[sec]</th> | 9 <th>T[sec]</th> |
10 <th>delay[sec]</th> | 10 <th>delay[sec]</th> |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
53 for (var display, j = 0; display = fontDisplayValues[j]; j++) { | 53 for (var display, j = 0; display = fontDisplayValues[j]; j++) { |
54 var family = [display, config.time, config.delay].join('-'); | 54 var family = [display, config.time, config.delay].join('-'); |
55 var rule = makeFontFaceDeclaration(family, config, display); | 55 var rule = makeFontFaceDeclaration(family, config, display); |
56 document.styleSheets[0].insertRule(rule, 0); | 56 document.styleSheets[0].insertRule(rule, 0); |
57 var td = document.createElement('td'); | 57 var td = document.createElement('td'); |
58 td.textContent = 'a'; | 58 td.textContent = 'a'; |
59 td.style.fontFamily = family + ', Arial'; | 59 td.style.fontFamily = family + ', Arial'; |
60 tr.appendChild(td); | 60 tr.appendChild(td); |
61 } | 61 } |
62 table.appendChild(tr); | 62 table.appendChild(tr); |
63 setTimeout((function(tr){tr.classList.remove('hidden')}).bind(null, tr),
maxTime - config.time); | 63 if (config.time == 0) { |
| 64 setTimeout((function(tr){ |
| 65 tr.classList.remove('hidden'); |
| 66 if (window.testRunner) |
| 67 testRunner.notifyDone(); |
| 68 }).bind(null, tr), maxTime); |
| 69 } else { |
| 70 setTimeout((function(tr){tr.classList.remove('hidden')}).bind(null,
tr), maxTime - config.time); |
| 71 } |
64 } | 72 } |
65 | |
66 if (window.testRunner) | |
67 setTimeout(function() { testRunner.notifyDone(); }, maxTime); | |
68 } | 73 } |
69 | 74 |
70 </script> | 75 </script> |
OLD | NEW |