2 <script src=
"../../resources/js-test.js"></script>
4 #control {font-size:
200%;}
5 #calc-percent {font-size: calc(
200%);}
6 #calc-percent-pixels {font-size: calc(
150% +
10px);}
9 <div id=
"test-container" style=
"font-size: 20px;">
10 <span id=
"control">The font size of these lines should be identical
</span>
12 <span class=
"fonttest" id=
"calc-percent">The font size of these lines should be identical
</span>
14 <span class=
"fonttest" id=
"calc-percent-pixels">The font size of these lines should be identical
</span>
18 description("Tests that CSS3 calc() can be used with the font-size property");
20 var spans
= document
.getElementsByClassName("fonttest");
21 for (var i
= 0; i
< spans
.length
; ++i
) {
22 shouldBeEqualToString('getComputedStyle(document.getElementById("' + spans
[i
].id
+ '"), null).fontSize', getComputedStyle(document
.getElementById("control"), null).fontSize
);
25 if (window
.testRunner
)
26 document
.body
.removeChild(document
.getElementById("test-container"));