mmaxfield@apple.com | 575b65e | 2018-11-06 00:11:15 +0000 | [diff] [blame] | 1 | <!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> |
| 34 | shouldBeEqualToString("window.getComputedStyle(document.getElementById('test1')).getPropertyValue('text-underline-offset')", "auto"); |
| 35 | shouldBeEqualToString("window.getComputedStyle(document.getElementById('test2')).getPropertyValue('text-underline-offset')", "auto"); |
| 36 | shouldBeEqualToString("window.getComputedStyle(document.getElementById('test3')).getPropertyValue('text-underline-offset')", "auto"); |
| 37 | shouldBeEqualToString("window.getComputedStyle(document.getElementById('test4')).getPropertyValue('text-underline-offset')", "auto"); |
| 38 | shouldBeEqualToString("window.getComputedStyle(document.getElementById('test5')).getPropertyValue('text-underline-offset')", "37px"); |
| 39 | shouldBeEqualToString("window.getComputedStyle(document.getElementById('test6')).getPropertyValue('text-underline-offset')", "200px"); |
| 40 | shouldBeEqualToString("window.getComputedStyle(document.getElementById('test7')).getPropertyValue('text-underline-offset')", "40px"); |
| 41 | shouldBeEqualToString("document.getElementById('target').sheet.cssRules[0].style.textUnderlineOffset", ""); |
| 42 | shouldBeEqualToString("document.getElementById('target').sheet.cssRules[1].style.textUnderlineOffset", "auto"); |
| 43 | shouldBeEqualToString("document.getElementById('target').sheet.cssRules[2].style.textUnderlineOffset", ""); |
| 44 | shouldBeEqualToString("document.getElementById('target').sheet.cssRules[3].style.textUnderlineOffset", ""); |
| 45 | shouldBeEqualToString("document.getElementById('target').sheet.cssRules[4].style.textUnderlineOffset", "37px"); |
| 46 | shouldBeEqualToString("document.getElementById('target').sheet.cssRules[5].style.textUnderlineOffset", "2em"); |
| 47 | </script> |
| 48 | <script src="../../../resources/js-test-post.js"></script> |
| 49 | </body> |
| 50 | </html> |