OLD | NEW |
1 // [Name] SVGPathElement-dom-requiredFeatures.js | 1 // [Name] SVGPathElement-dom-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 pathElement = createSVGElement("path"); | 6 var pathElement = createSVGElement("path"); |
7 pathElement.setAttribute("d", "M0 0 L 200 0 L 200 200 L 0 200"); | 7 pathElement.setAttribute("d", "M0 0 L 200 0 L 200 200 L 0 200"); |
8 | 8 |
9 rootSVGElement.appendChild(pathElement); | 9 rootSVGElement.appendChild(pathElement); |
10 | 10 |
11 function repaintTest() { | 11 function repaintTest() { |
12 debug("Check that SVGPathElement is initially displayed"); | 12 debug("Check that SVGPathElement is initially displayed"); |
13 shouldBeEqualToString("document.defaultView.getComputedStyle(pathElement, nu
ll).display", "inline"); | 13 shouldBeEqualToString("document.defaultView.getComputedStyle(pathElement, nu
ll).display", "inline"); |
14 debug("Check that setting requiredFeatures to something invalid makes it not
render"); | 14 debug("Check that setting requiredFeatures to something invalid makes it not
render"); |
15 pathElement.setAttribute("requiredFeatures", "foo"); | 15 pathElement.setAttribute("requiredFeatures", "http://www.w3.org/TR/SVG11/fea
ture#BogusFeature"); |
16 shouldBeEqualToString("document.defaultView.getComputedStyle(pathElement, nu
ll).display", ""); | 16 shouldBeEqualToString("document.defaultView.getComputedStyle(pathElement, nu
ll).display", ""); |
17 debug("Check that setting requiredFeatures to something valid makes it rende
r again"); | 17 debug("Check that setting requiredFeatures to something valid makes it rende
r again"); |
18 pathElement.setAttribute("requiredFeatures", "http://www.w3.org/TR/SVG11/fea
ture#Shape"); | 18 pathElement.setAttribute("requiredFeatures", "http://www.w3.org/TR/SVG11/fea
ture#Shape"); |
19 shouldBeEqualToString("document.defaultView.getComputedStyle(pathElement, nu
ll).display", "inline"); | 19 shouldBeEqualToString("document.defaultView.getComputedStyle(pathElement, nu
ll).display", "inline"); |
20 debug("Check that adding something valid to requiredFeatures keeps rendering
the element"); | 20 debug("Check that adding something valid to requiredFeatures keeps rendering
the element"); |
21 pathElement.setAttribute("requiredFeatures", "http://www.w3.org/TR/SVG11/fea
ture#Gradient"); | 21 pathElement.setAttribute("requiredFeatures", "http://www.w3.org/TR/SVG11/fea
ture#Gradient"); |
22 shouldBeEqualToString("document.defaultView.getComputedStyle(pathElement, nu
ll).display", "inline"); | 22 shouldBeEqualToString("document.defaultView.getComputedStyle(pathElement, nu
ll).display", "inline"); |
23 debug("Check that adding something invalid to requiredFeatures makes it not
render"); | 23 debug("Check that adding something invalid to requiredFeatures makes it not
render"); |
24 pathElement.setAttribute("requiredFeatures", "foo"); | 24 pathElement.setAttribute("requiredFeatures", "http://www.w3.org/TR/SVG11/fea
ture#BogusFeature"); |
25 shouldBeEqualToString("document.defaultView.getComputedStyle(pathElement, nu
ll).display", ""); | 25 shouldBeEqualToString("document.defaultView.getComputedStyle(pathElement, nu
ll).display", ""); |
26 | 26 |
27 completeTest(); | 27 completeTest(); |
28 } | 28 } |
29 | 29 |
30 var successfullyParsed = true; | 30 var successfullyParsed = true; |
OLD | NEW |