blob: 88d9d9ae21106c9a28054c4fdc231b2619dd1f6f [file] [log] [blame]
<!DOCTYPE html>
<html>
<head>
<script src="../../resources/js-test-pre.js"></script>
</head>
<body>
<div style="font: 16px/18px 'Times';">
<div id="test1"></div>
<div id="test2" style="font-style: oblique 1deg;"></div>
<div id="test3" style="font-style: oblique 20grad;"></div>
<div id="test4" style="font-style: oblique 0.28318rad;"></div>
<div id="test5" style="font-style: oblique 0.04turn;"></div>
<div id="test6" style="font-style: oblique 5;"></div>
<div id="test7" style="font-style: oblique 20;"></div>
<div id="test8" style="font-style: italic;"></div>
<div id="test9" style="font-style: oblique;"></div>
<div id="test10" style="font-style: normal;"></div>
<div id="test11" style="font-style: garbage;"></div>
<div id="test12" style="font-style: initial;"></div>
<div id="test13" style="font-style: oblique calc(3 + 4);"></div>
<div id="test14" style="font-style: oblique calc(0.04turn + 1deg);"></div>
<div id="test15" style="font: 100 italic 48px/49px 'Helvetica Neue';"></div>
<div id="test16" style="font: italic 100 48px/49px 'Helvetica Neue';"></div>
<div id="test17" style="font: 100 48px/49px 'Helvetica Neue';"></div>
<div style="font-stretch: normal;"><div id="test18" style="font: italic 48px/49px 'Helvetica Neue';"></div></div>
<div id="test19" style="font: italic small-caps 100 extra-expanded 48px/49px 'Helvetica Neue';"></div>
<div id="test20" style="font: 13deg small-caps 123 extra-expanded 48px/49px 'Helvetica Neue';"></div>
<div id="test21" style="font: oblique 14deg small-caps 123 extra-expanded 48px/49px 'Helvetica Neue';"></div>
<div id="test22" style="font-style: oblique 20deg;"></div>
</div>
<script>
shouldBeEqualToString("window.getComputedStyle(document.getElementById('test1')).fontStyle", "normal");
shouldBeEqualToString("window.getComputedStyle(document.getElementById('test2')).fontStyle", "oblique 1deg");
shouldBeEqualToString("window.getComputedStyle(document.getElementById('test3')).fontStyle", "oblique 18deg");
shouldBeEqualToString("window.getComputedStyle(document.getElementById('test4')).fontStyle", "oblique 16deg");
shouldBeEqualToString("window.getComputedStyle(document.getElementById('test5')).fontStyle", "oblique 14.25deg");
shouldBeEqualToString("window.getComputedStyle(document.getElementById('test6')).fontStyle", "normal");
shouldBeEqualToString("window.getComputedStyle(document.getElementById('test7')).fontStyle", "normal");
shouldBeEqualToString("window.getComputedStyle(document.getElementById('test8')).fontStyle", "italic");
shouldBeEqualToString("window.getComputedStyle(document.getElementById('test9')).fontStyle", "oblique");
shouldBeEqualToString("window.getComputedStyle(document.getElementById('test10')).fontStyle", "normal");
shouldBeEqualToString("window.getComputedStyle(document.getElementById('test11')).fontStyle", "normal");
shouldBeEqualToString("window.getComputedStyle(document.getElementById('test12')).fontStyle", "normal");
shouldBeEqualToString("window.getComputedStyle(document.getElementById('test13')).fontStyle", "normal");
shouldBeEqualToString("window.getComputedStyle(document.getElementById('test14')).fontStyle", "oblique 15.25deg");
shouldBeEqualToString("window.getComputedStyle(document.getElementById('test15')).fontStyle", "italic");
shouldBeEqualToString("window.getComputedStyle(document.getElementById('test16')).fontStyle", "italic");
shouldBeEqualToString("window.getComputedStyle(document.getElementById('test17')).fontStyle", "normal");
shouldBeEqualToString("window.getComputedStyle(document.getElementById('test18')).fontStyle", "italic");
shouldBeEqualToString("window.getComputedStyle(document.getElementById('test19')).fontStyle", "italic");
shouldBeEqualToString("window.getComputedStyle(document.getElementById('test20')).fontStyle", "normal");
shouldBeEqualToString("window.getComputedStyle(document.getElementById('test21')).fontStyle", "oblique 14deg");
shouldBeEqualToString("window.getComputedStyle(document.getElementById('test22')).fontStyle", "oblique");
shouldBeEqualToString("window.getComputedStyle(document.getElementById('test1')).font", "normal normal normal normal 16px/18px Times");
shouldBeEqualToString("window.getComputedStyle(document.getElementById('test2')).font", "16px/18px Times");
shouldBeEqualToString("window.getComputedStyle(document.getElementById('test3')).font", "16px/18px Times");
shouldBeEqualToString("window.getComputedStyle(document.getElementById('test4')).font", "16px/18px Times");
shouldBeEqualToString("window.getComputedStyle(document.getElementById('test5')).font", "16px/18px Times");
shouldBeEqualToString("window.getComputedStyle(document.getElementById('test6')).font", "normal normal normal normal 16px/18px Times");
shouldBeEqualToString("window.getComputedStyle(document.getElementById('test7')).font", "normal normal normal normal 16px/18px Times");
shouldBeEqualToString("window.getComputedStyle(document.getElementById('test8')).font", "italic normal normal normal 16px/18px Times");
shouldBeEqualToString("window.getComputedStyle(document.getElementById('test9')).font", "oblique normal normal normal 16px/18px Times");
shouldBeEqualToString("window.getComputedStyle(document.getElementById('test10')).font", "normal normal normal normal 16px/18px Times");
shouldBeEqualToString("window.getComputedStyle(document.getElementById('test11')).font", "normal normal normal normal 16px/18px Times");
shouldBeEqualToString("window.getComputedStyle(document.getElementById('test12')).font", "normal normal normal normal 16px/18px Times");
shouldBeEqualToString("window.getComputedStyle(document.getElementById('test13')).font", "normal normal normal normal 16px/18px Times");
shouldBeEqualToString("window.getComputedStyle(document.getElementById('test14')).font", "16px/18px Times");
shouldBeEqualToString("window.getComputedStyle(document.getElementById('test15')).font", `italic normal 100 normal 48px/49px "Helvetica Neue"`);
shouldBeEqualToString("window.getComputedStyle(document.getElementById('test16')).font", `italic normal 100 normal 48px/49px "Helvetica Neue"`);
shouldBeEqualToString("window.getComputedStyle(document.getElementById('test17')).font", `normal normal 100 normal 48px/49px "Helvetica Neue"`);
shouldBeEqualToString("window.getComputedStyle(document.getElementById('test18')).font", `italic normal normal normal 48px/49px "Helvetica Neue"`);
shouldBeEqualToString("window.getComputedStyle(document.getElementById('test19')).font", `italic small-caps 100 extra-expanded 48px/49px "Helvetica Neue"`);
shouldBeEqualToString("window.getComputedStyle(document.getElementById('test20')).font", `normal normal normal normal 16px/18px Times`);
shouldBeEqualToString("window.getComputedStyle(document.getElementById('test21')).font", `48px/49px "Helvetica Neue"`);
shouldBeEqualToString("window.getComputedStyle(document.getElementById('test22')).font", `oblique normal normal normal 16px/18px Times`);
shouldBeEqualToString("document.getElementById('test1').style.font", "");
shouldBeEqualToString("document.getElementById('test15').style.font", `italic 100 48px/49px "Helvetica Neue"`);
shouldBeEqualToString("document.getElementById('test16').style.font", `italic 100 48px/49px "Helvetica Neue"`);
shouldBeEqualToString("document.getElementById('test17').style.font", `100 48px/49px "Helvetica Neue"`);
shouldBeEqualToString("document.getElementById('test18').style.font", `italic 48px/49px "Helvetica Neue"`);
shouldBeEqualToString("document.getElementById('test19').style.font", `italic small-caps 100 extra-expanded 48px/49px "Helvetica Neue"`);
shouldBeEqualToString("document.getElementById('test20').style.font", ``);
shouldBeEqualToString("document.getElementById('test21').style.font", `oblique 14deg small-caps 123 extra-expanded 48px/49px "Helvetica Neue"`);
</script>
<script src="../../resources/js-test-post.js"></script>
</body>
</html>