OLD | NEW |
| (Empty) |
1 description("This test checks the SVGAnimatedNumber API - utilizing the surfaceS
cale property of SVGFESpecularLightingElement"); | |
2 | |
3 var feSpecularLightingElement = document.createElementNS("http://www.w3.org/2000
/svg", "feSpecularLighting"); | |
4 | |
5 debug(""); | |
6 debug("Check initial surfaceScale value"); | |
7 shouldBeEqualToString("feSpecularLightingElement.surfaceScale.toString()", "[obj
ect SVGAnimatedNumber]"); | |
8 shouldBeEqualToString("typeof(feSpecularLightingElement.surfaceScale.baseVal)",
"number"); | |
9 shouldBe("feSpecularLightingElement.surfaceScale.baseVal", "1"); | |
10 | |
11 debug(""); | |
12 debug("Check that integers are static, caching value in a local variable and mod
ifying it, should have no effect"); | |
13 var numRef = feSpecularLightingElement.surfaceScale.baseVal; | |
14 numRef = 100; | |
15 shouldBe("numRef", "100"); | |
16 shouldBe("feSpecularLightingElement.surfaceScale.baseVal", "1"); | |
17 | |
18 debug(""); | |
19 debug("Check assigning various valid and invalid values"); | |
20 shouldBe("feSpecularLightingElement.surfaceScale.baseVal = -1", "-1"); // Negati
ve values are allowed from SVG DOM, but should lead to an error when rendering (
disable the filter) | |
21 shouldBe("feSpecularLightingElement.surfaceScale.baseVal = 300", "300"); | |
22 // ECMA-262, 9.3, "ToNumber" | |
23 shouldThrow("feSpecularLightingElement.surfaceScale.baseVal = 'aString'"); | |
24 shouldBe("feSpecularLightingElement.surfaceScale.baseVal", "300"); | |
25 shouldBe("feSpecularLightingElement.surfaceScale.baseVal = 0", "0"); | |
26 shouldThrow("feSpecularLightingElement.surfaceScale.baseVal = NaN"); | |
27 shouldBe("feSpecularLightingElement.surfaceScale.baseVal", "0"); | |
28 shouldThrow("feSpecularLightingElement.surfaceScale.baseVal = Infinity"); | |
29 shouldBe("feSpecularLightingElement.surfaceScale.baseVal", "0"); | |
30 shouldThrow("feSpecularLightingElement.surfaceScale.baseVal = feSpecularLighting
Element"); | |
31 shouldBe("feSpecularLightingElement.surfaceScale.baseVal", "0"); | |
32 shouldBe("feSpecularLightingElement.surfaceScale.baseVal = 300", "300"); | |
33 | |
34 debug(""); | |
35 debug("Check that the surfaceScale value remained 300"); | |
36 shouldBe("feSpecularLightingElement.surfaceScale.baseVal", "300"); | |
37 | |
38 successfullyParsed = true; | |
OLD | NEW |