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