OLD | NEW |
1 <html xmlns="http://www.w3.org/1999/xhtml"> | 1 <html xmlns="http://www.w3.org/1999/xhtml"> |
2 <head> | 2 <head> |
3 <script src="../../resources/js-test.js"/> | 3 <script src="../../resources/js-test.js"/> |
4 </head> | 4 </head> |
5 <body> | 5 <body> |
6 <svg display="none" xmlns="http://www.w3.org/2000/svg"><text id="text"/></svg> | 6 <svg display="none" xmlns="http://www.w3.org/2000/svg"><text id="text"/></svg> |
7 <p id="description"></p> | 7 <p id="description"></p> |
8 <div id="console"/> | 8 <div id="console"/> |
9 <script> | 9 <script> |
10 var textElement = document.getElementById("text"); | 10 var textElement = document.getElementById("text"); |
11 var computedStyle; | 11 var computedStyle; |
12 | 12 |
13 function parseGlyphOrientationHelper(property, angleValue, expectedValue) | 13 function parseGlyphOrientationHelper(property, angleValue, expectedValue) |
14 { | 14 { |
15 textElement.setAttributeNS(null, property, angleValue); | 15 textElement.setAttributeNS(null, property, angleValue); |
16 computedStyle = textElement.ownerDocument.defaultView.getComputedStyle(textE
lement); | 16 computedStyle = textElement.ownerDocument.defaultView.getComputedStyle(textE
lement); |
17 | 17 |
18 debug("Test angleValue: '" + angleValue + "'"); | 18 debug("Test angleValue: '" + angleValue + "'"); |
19 | 19 |
20 if (expectedValue == "auto") { | 20 if (expectedValue == "auto") { |
21 shouldBe("computedStyle.getPropertyValue('" + property + "')", '"auto"')
; | 21 shouldBe("computedStyle.getPropertyValue('" + property + "')", '"auto"')
; |
22 } else { | 22 } else { |
23 shouldBe("computedStyle.getPropertyCSSValue('" + property + "').getFloat
Value(CSSPrimitiveValue.CSS_DEG)", "" + expectedValue); | 23 shouldBe("parseFloat(computedStyle.getPropertyValue('" + property + "'))
", "" + expectedValue); |
24 } | 24 } |
25 | 25 |
26 debug(""); | 26 debug(""); |
27 } | 27 } |
28 | 28 |
29 function parseGlyphOrientation(angleValue, expectedValue) | 29 function parseGlyphOrientation(angleValue, expectedValue) |
30 { | 30 { |
31 if (expectedValue == undefined) { | 31 if (expectedValue == undefined) { |
32 parseGlyphOrientationHelper("glyph-orientation-horizontal", angleValue,
0.0); | 32 parseGlyphOrientationHelper("glyph-orientation-horizontal", angleValue,
0.0); |
33 parseGlyphOrientationHelper("glyph-orientation-vertical", angleValue, "a
uto"); | 33 parseGlyphOrientationHelper("glyph-orientation-vertical", angleValue, "a
uto"); |
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
115 parseGlyphOrientation("45.0000", 0.0); | 115 parseGlyphOrientation("45.0000", 0.0); |
116 parseGlyphOrientation("45.0001", 90.0); | 116 parseGlyphOrientation("45.0001", 90.0); |
117 parseGlyphOrientation("135.000", 90.0); | 117 parseGlyphOrientation("135.000", 90.0); |
118 parseGlyphOrientation("135.001", 180.0); | 118 parseGlyphOrientation("135.001", 180.0); |
119 | 119 |
120 | 120 |
121 </script> | 121 </script> |
122 | 122 |
123 </body> | 123 </body> |
124 </html> | 124 </html> |
OLD | NEW |