blob: 424d676c410b71ea37e59f8c8c6135dbe4809238 [file] [log] [blame]
<!DOCTYPE HTML>
<script src="../../resources/js-test-pre.js"></script>
<style>
#control {font-size: 200%;}
#calc-percent {font-size: calc(200%);}
#calc-percent-pixels {font-size: calc(150% + 10px);}
</style>
<div id="test-container" style="font-size: 20px;">
<span id="control">The font size of these lines should be identical</span>
<br/>
<span class="fonttest" id="calc-percent">The font size of these lines should be identical</span>
<br/>
<span class="fonttest" id="calc-percent-pixels">The font size of these lines should be identical</span>
</div>
<script>
description("Tests that CSS3 calc() can be used with the font-size property");
var spans = document.getElementsByClassName("fonttest");
for (var i = 0; i < spans.length; ++i) {
shouldBeEqualToString('getComputedStyle(document.getElementById("' + spans[i].id + '"), null).fontSize', getComputedStyle(document.getElementById("control"), null).fontSize);
}
if (window.testRunner)
document.body.removeChild(document.getElementById("test-container"));
</script>
<script src="../../resources/js-test-post.js"></script>