4 src: url(slow-ahem-loading.cgi);
8 This test checks that the fallback font is used for layout while a webfont is loading.
12 <span id=
"target-arial" style=
"font-family: webfont, Arial;">A text to be measured.
</span>
15 <span id=
"target-serif" style=
"font-family: webfont, serif;">A text to be measured.
</span>
18 <span id=
"target-monospace" style=
"font-family: webfont, monospace;">A text to be measured.
</span>
21 <span id=
"target-default" style=
"font-family: webfont;">A text to be measured.
</span>
25 <span id=
"reference-arial" style=
"font-family: Arial;">A text to be measured.
</span>
28 <span id=
"reference-serif" style=
"font-family: serif;">A text to be measured.
</span>
31 <span id=
"reference-monospace" style=
"font-family: monospace;">A text to be measured.
</span>
34 <span id=
"reference-default">A text to be measured.
</span>
36 <pre id=
"result"></pre>
39 if (window
.testRunner
) {
40 testRunner
.dumpAsText();
43 function checkSize(fallbackFont
) {
44 var target
= document
.getElementById('target-' + fallbackFont
);
45 var reference
= document
.getElementById('reference-' + fallbackFont
);
46 var result
= document
.getElementById('result');
47 result
.innerText
+= fallbackFont
+ '\n';
48 if (target
.offsetWidth
== reference
.offsetWidth
&& target
.offsetHeight
== reference
.offsetHeight
) {
49 result
.innerText
+= 'PASS: The width of target text and reference text is the same.\n';
51 result
.innerText
+= 'FAIL: The width of target text and reference text is different: '
52 + target
.offsetWidth
+ ' != ' + reference
.offsetWidth
+ ' or ' + target
.offsetHeight
+ ' != ' + reference
.offsetHeight
+ '\n';
58 // FIXME: checkSize('default');
59 // FIXME: checkSize('monospace');