| OLD | NEW |
| 1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
| 2 <title>Test for font-display @font-face descriptor with User-Agent Intervention<
/title> | 2 <title>Test for font-display @font-face descriptor with User-Agent Intervention<
/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 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 64 for (var display, j = 0; display = fontDisplayValues[j]; j++) { | 64 for (var display, j = 0; display = fontDisplayValues[j]; j++) { |
| 65 var family = [display, config.time, config.delay].join('-'); | 65 var family = [display, config.time, config.delay].join('-'); |
| 66 var rule = makeFontFaceDeclaration(family, config, display); | 66 var rule = makeFontFaceDeclaration(family, config, display); |
| 67 document.styleSheets[0].insertRule(rule, 0); | 67 document.styleSheets[0].insertRule(rule, 0); |
| 68 var td = document.createElement('td'); | 68 var td = document.createElement('td'); |
| 69 td.textContent = 'a'; | 69 td.textContent = 'a'; |
| 70 td.style.fontFamily = family + ', Arial'; | 70 td.style.fontFamily = family + ', Arial'; |
| 71 tr.appendChild(td); | 71 tr.appendChild(td); |
| 72 } | 72 } |
| 73 table.appendChild(tr); | 73 table.appendChild(tr); |
| 74 setTimeout((function(tr){tr.classList.remove('hidden')}).bind(null, tr),
maxTime - config.time); | 74 if (config.time == 0) { |
| 75 setTimeout((function(tr){ |
| 76 tr.classList.remove('hidden'); |
| 77 if (window.testRunner) |
| 78 testRunner.notifyDone(); |
| 79 }).bind(null, tr), maxTime); |
| 80 } else { |
| 81 setTimeout((function(tr){tr.classList.remove('hidden')}).bind(null,
tr), maxTime - config.time); |
| 82 } |
| 75 } | 83 } |
| 76 | |
| 77 if (window.testRunner) | |
| 78 setTimeout(function() { testRunner.notifyDone(); }, maxTime); | |
| 79 } | 84 } |
| 80 | 85 |
| 81 </script> | 86 </script> |
| OLD | NEW |