OLD | NEW |
1 // [Name] SVGRectElement-svgdom-requiredFeatures.js | 1 // [Name] SVGRectElement-svgdom-requiredFeatures.js |
2 // [Expected rendering result] a series of PASS messages | 2 // [Expected rendering result] a series of PASS messages |
3 | 3 |
4 createSVGTestCase(); | 4 createSVGTestCase(); |
5 | 5 |
6 var rectElement = createSVGElement("rect"); | 6 var rectElement = createSVGElement("rect"); |
7 rectElement.setAttribute("width", "200"); | 7 rectElement.setAttribute("width", "200"); |
8 rectElement.setAttribute("height", "200"); | 8 rectElement.setAttribute("height", "200"); |
9 | 9 |
10 rootSVGElement.appendChild(rectElement); | 10 rootSVGElement.appendChild(rectElement); |
11 | 11 |
12 function repaintTest() { | 12 function repaintTest() { |
13 debug("Check that SVGRectElement is initially displayed"); | 13 debug("Check that SVGRectElement is initially displayed"); |
14 shouldBeEqualToString("document.defaultView.getComputedStyle(rectElement, nu
ll).display", "inline"); | 14 shouldBeEqualToString("document.defaultView.getComputedStyle(rectElement, nu
ll).display", "inline"); |
15 debug("Check that setting requiredFeatures to something invalid makes it not
render"); | 15 debug("Check that setting requiredFeatures to something invalid makes it not
render"); |
16 rectElement.requiredFeatures.appendItem("foo"); | 16 rectElement.requiredFeatures.appendItem("http://www.w3.org/TR/SVG11/feature#
BogusFeature"); |
17 shouldBeEqualToString("document.defaultView.getComputedStyle(rectElement, nu
ll).display", ""); | 17 shouldBeEqualToString("document.defaultView.getComputedStyle(rectElement, nu
ll).display", ""); |
18 debug("Check that setting requiredFeatures to something valid makes it rende
r again"); | 18 debug("Check that setting requiredFeatures to something valid makes it rende
r again"); |
19 rectElement.requiredFeatures.replaceItem("http://www.w3.org/TR/SVG11/feature
#Shape", 0); | 19 rectElement.requiredFeatures.replaceItem("http://www.w3.org/TR/SVG11/feature
#Shape", 0); |
20 shouldBeEqualToString("document.defaultView.getComputedStyle(rectElement, nu
ll).display", "inline"); | 20 shouldBeEqualToString("document.defaultView.getComputedStyle(rectElement, nu
ll).display", "inline"); |
21 debug("Check that adding something valid to requiredFeatures keeps rendering
the element"); | 21 debug("Check that adding something valid to requiredFeatures keeps rendering
the element"); |
22 rectElement.requiredFeatures.appendItem("http://www.w3.org/TR/SVG11/feature#
Gradient"); | 22 rectElement.requiredFeatures.appendItem("http://www.w3.org/TR/SVG11/feature#
Gradient"); |
23 shouldBeEqualToString("document.defaultView.getComputedStyle(rectElement, nu
ll).display", "inline"); | 23 shouldBeEqualToString("document.defaultView.getComputedStyle(rectElement, nu
ll).display", "inline"); |
24 debug("Check that adding something invalid to requiredFeatures makes it not
render"); | 24 debug("Check that adding something invalid to requiredFeatures makes it not
render"); |
25 rectElement.requiredFeatures.appendItem("foo"); | 25 rectElement.requiredFeatures.appendItem("http://www.w3.org/TR/SVG11/feature#
BogusFeature"); |
26 shouldBeEqualToString("document.defaultView.getComputedStyle(rectElement, nu
ll).display", ""); | 26 shouldBeEqualToString("document.defaultView.getComputedStyle(rectElement, nu
ll).display", ""); |
27 | 27 |
28 completeTest(); | 28 completeTest(); |
29 } | 29 } |
30 | 30 |
31 var successfullyParsed = true; | 31 var successfullyParsed = true; |
OLD | NEW |