blob: ab01e1be88ad6472d2792924de8fdbad0c0780cb [file] [log] [blame]
mmaxfield@apple.com575b65e2018-11-06 00:11:15 +00001<!DOCTYPE html>
2<html>
3<head>
4<script src="../../../resources/js-test-pre.js"></script>
5<style id="target">
6#dummy {
7}
8#dummy {
9 text-underline-offset: auto;
10}
11#dummy {
12 text-underline-offset: auto 37px;
13}
14#dummy {
15 text-underline-offset: garbage;
16}
17#dummy {
18 text-underline-offset: 37px;
19}
20#dummy {
21 text-underline-offset: 2em;
22}
23</style>
24</head>
25<body>
26<div id="test1"></div>
27<div id="test2" style="text-underline-offset: auto;"></div>
28<div id="test3" style="text-underline-offset: auto 37px;"></div>
29<div id="test4" style="text-underline-offset: garbage;"></div>
30<div id="test5" style="text-underline-offset: 37px;"></div>
31<div id="test6" style="font-size: 100px; text-underline-offset: 2em;"></div>
32<div style="font-size: 20px; text-underline-offset: 2em;"><div id="test7" style="font-size: 100px;"></div></div>
33<script>
34shouldBeEqualToString("window.getComputedStyle(document.getElementById('test1')).getPropertyValue('text-underline-offset')", "auto");
35shouldBeEqualToString("window.getComputedStyle(document.getElementById('test2')).getPropertyValue('text-underline-offset')", "auto");
36shouldBeEqualToString("window.getComputedStyle(document.getElementById('test3')).getPropertyValue('text-underline-offset')", "auto");
37shouldBeEqualToString("window.getComputedStyle(document.getElementById('test4')).getPropertyValue('text-underline-offset')", "auto");
38shouldBeEqualToString("window.getComputedStyle(document.getElementById('test5')).getPropertyValue('text-underline-offset')", "37px");
39shouldBeEqualToString("window.getComputedStyle(document.getElementById('test6')).getPropertyValue('text-underline-offset')", "200px");
40shouldBeEqualToString("window.getComputedStyle(document.getElementById('test7')).getPropertyValue('text-underline-offset')", "40px");
41shouldBeEqualToString("document.getElementById('target').sheet.cssRules[0].style.textUnderlineOffset", "");
42shouldBeEqualToString("document.getElementById('target').sheet.cssRules[1].style.textUnderlineOffset", "auto");
43shouldBeEqualToString("document.getElementById('target').sheet.cssRules[2].style.textUnderlineOffset", "");
44shouldBeEqualToString("document.getElementById('target').sheet.cssRules[3].style.textUnderlineOffset", "");
45shouldBeEqualToString("document.getElementById('target').sheet.cssRules[4].style.textUnderlineOffset", "37px");
46shouldBeEqualToString("document.getElementById('target').sheet.cssRules[5].style.textUnderlineOffset", "2em");
47</script>
48<script src="../../../resources/js-test-post.js"></script>
49</body>
50</html>