OLD | NEW |
(Empty) | |
| 1 <!DOCTYPE html> |
| 2 <html> |
| 3 <head> |
| 4 <script src="../../../js/resources/js-test-pre.js"></script> |
| 5 </head> |
| 6 <body> |
| 7 <script> |
| 8 function testElementStyle(propertyJS, propertyCSS, value) |
| 9 { |
| 10 shouldBe("e.style.getPropertyCSSValue('" + propertyCSS + "').css
Text", "'" + value + "'"); |
| 11 } |
| 12 |
| 13 description("Test to make sure text-decoration longhand values are a
ccepted in every possible ordering in shorthand.") |
| 14 |
| 15 var testContainer = document.createElement("div"); |
| 16 testContainer.contentEditable = true; |
| 17 document.body.appendChild(testContainer); |
| 18 |
| 19 testContainer.innerHTML = '<div id="test">hello world</div>'; |
| 20 |
| 21 var e = document.getElementById('test'); |
| 22 |
| 23 debug("-line -style -color ordering (underline dashed red):"); |
| 24 e.style.textDecoration = 'underline dashed red'; |
| 25 testElementStyle("textDecorationLine", "text-decoration-line", "unde
rline"); |
| 26 testElementStyle("textDecorationStyle", "text-decoration-style", "da
shed"); |
| 27 testElementStyle("textDecorationColor", "text-decoration-color", "re
d"); |
| 28 debug(""); |
| 29 |
| 30 debug("-line -color -style ordering (overline blue dotted):"); |
| 31 e.style.textDecoration = 'overline blue dotted'; |
| 32 testElementStyle("textDecorationLine", "text-decoration-line", "over
line"); |
| 33 testElementStyle("textDecorationStyle", "text-decoration-style", "do
tted"); |
| 34 testElementStyle("textDecorationColor", "text-decoration-color", "bl
ue"); |
| 35 debug(""); |
| 36 |
| 37 debug("-style -line -color ordering (double line-through underline o
verline green):"); |
| 38 e.style.textDecoration = 'double line-through underline overline gre
en'; |
| 39 testElementStyle("textDecorationLine", "text-decoration-line", "line
-through underline overline"); |
| 40 testElementStyle("textDecorationStyle", "text-decoration-style", "do
uble"); |
| 41 testElementStyle("textDecorationColor", "text-decoration-color", "gr
een"); |
| 42 debug(""); |
| 43 |
| 44 debug("-style -color -line ordering (wavy yellow line-through):"); |
| 45 e.style.textDecoration = 'wavy yellow line-through'; |
| 46 testElementStyle("textDecorationLine", "text-decoration-line", "line
-through"); |
| 47 testElementStyle("textDecorationStyle", "text-decoration-style", "wa
vy"); |
| 48 testElementStyle("textDecorationColor", "text-decoration-color", "ye
llow"); |
| 49 debug(""); |
| 50 |
| 51 debug("-color -line -style ordering (black underline solid):"); |
| 52 e.style.textDecoration = 'black underline solid'; |
| 53 testElementStyle("textDecorationLine", "text-decoration-line", "unde
rline"); |
| 54 testElementStyle("textDecorationStyle", "text-decoration-style", "so
lid"); |
| 55 testElementStyle("textDecorationColor", "text-decoration-color", "bl
ack"); |
| 56 debug(""); |
| 57 |
| 58 debug("-color style -line -style ordering (navy dashed overline):"); |
| 59 e.style.textDecoration = 'navy dashed overline'; |
| 60 testElementStyle("textDecorationLine", "text-decoration-line", "over
line"); |
| 61 testElementStyle("textDecorationStyle", "text-decoration-style", "da
shed"); |
| 62 testElementStyle("textDecorationColor", "text-decoration-color", "na
vy"); |
| 63 debug(""); |
| 64 |
| 65 document.body.removeChild(testContainer); |
| 66 </script> |
| 67 <script src="../../../js/resources/js-test-post.js"></script> |
| 68 </body> |
| 69 </html> |
OLD | NEW |