Use testRunner instead of layoutTestController in tests still found to be using layou...
[WebKit-https.git] / LayoutTests / http / tests / webfont / fallback-font-while-loading.html
1 <style>
2 @font-face {
3     font-family: webfont;
4     src: url(slow-ahem-loading.cgi);
5 }
6 </style>
7 <p>
8 This test checks that the fallback font is used for layout while a webfont is loading.
9 </p>
10 Target:
11 <div>
12 <span id="target" style="font-family: webfont, Arial;">A text to be measured.</span>
13 </div>
14 Reference:
15 <div>
16 <span id="reference" style="font-family: Arial;">A text to be measured.</span>
17 </div>
18 <div id="result"></div>
19
20 <script>
21 if (window.testRunner) {
22     testRunner.dumpAsText();
23 }
24
25 function checkSize() {
26     var targetWidth = document.getElementById('target').offsetWidth;
27     var referenceWidth = document.getElementById('reference').offsetWidth;
28     var result = document.getElementById('result');
29     if (targetWidth == referenceWidth)
30         result.innerText = 'PASS: The width of target text and reference text is the same.';
31     else
32         result.innerText = 'FAIL: The width of target text and reference text is different: ' + targetWidth + ' != ' + referenceWidth;
33 }
34
35 checkSize();
36 </script>