OLD | NEW |
1 // [Name] SVGGElement-dom-requiredFeatures.js | 1 // [Name] SVGGElement-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 gElement = createSVGElement("g"); | 6 var gElement = createSVGElement("g"); |
| 7 var imageElement = createSVGElement("image"); |
| 8 imageElement.setAttribute("width", "200"); |
| 9 imageElement.setAttribute("height", "200"); |
7 | 10 |
| 11 gElement.appendChild(imageElement); |
8 rootSVGElement.appendChild(gElement); | 12 rootSVGElement.appendChild(gElement); |
9 | 13 |
10 function repaintTest() { | 14 function repaintTest() { |
11 debug("Check that SVGGElement is initially displayed"); | 15 debug("Check that SVGGElement is initially displayed"); |
12 shouldBeEqualToString("document.defaultView.getComputedStyle(gElement, null)
.display", "inline"); | 16 shouldHaveBBox("gElement.firstElementChild", "200", "200"); |
13 debug("Check that setting requiredFeatures to something invalid makes it not
render"); | 17 debug("Check that setting requiredFeatures to something invalid makes it not
render"); |
14 gElement.setAttribute("requiredFeatures", "http://www.w3.org/TR/SVG11/featur
e#BogusFeature"); | 18 gElement.setAttribute("requiredFeatures", "http://www.w3.org/TR/SVG11/featur
e#BogusFeature"); |
15 shouldBeEqualToString("document.defaultView.getComputedStyle(gElement, null)
.display", ""); | 19 shouldHaveBBox("gElement.firstElementChild", "0", "0"); |
16 debug("Check that setting requiredFeatures to something valid makes it rende
r again"); | 20 debug("Check that setting requiredFeatures to something valid makes it rende
r again"); |
17 gElement.setAttribute("requiredFeatures", "http://www.w3.org/TR/SVG11/featur
e#Shape"); | 21 gElement.setAttribute("requiredFeatures", "http://www.w3.org/TR/SVG11/featur
e#Shape"); |
18 shouldBeEqualToString("document.defaultView.getComputedStyle(gElement, null)
.display", "inline"); | 22 shouldHaveBBox("gElement.firstElementChild", "200", "200"); |
19 debug("Check that adding something valid to requiredFeatures keeps rendering
the element"); | 23 debug("Check that adding something valid to requiredFeatures keeps rendering
the element"); |
20 gElement.setAttribute("requiredFeatures", "http://www.w3.org/TR/SVG11/featur
e#Gradient"); | 24 gElement.setAttribute("requiredFeatures", "http://www.w3.org/TR/SVG11/featur
e#Gradient"); |
21 shouldBeEqualToString("document.defaultView.getComputedStyle(gElement, null)
.display", "inline"); | 25 shouldHaveBBox("gElement.firstElementChild", "200", "200"); |
22 debug("Check that adding something invalid to requiredFeatures makes it not
render"); | 26 debug("Check that adding something invalid to requiredFeatures makes it not
render"); |
23 gElement.setAttribute("requiredFeatures", "http://www.w3.org/TR/SVG11/featur
e#BogusFeature"); | 27 gElement.setAttribute("requiredFeatures", "http://www.w3.org/TR/SVG11/featur
e#BogusFeature"); |
24 shouldBeEqualToString("document.defaultView.getComputedStyle(gElement, null)
.display", ""); | 28 shouldHaveBBox("gElement.firstElementChild", "0", "0"); |
25 | 29 |
26 completeTest(); | 30 completeTest(); |
27 } | 31 } |
28 | 32 |
29 var successfullyParsed = true; | 33 var successfullyParsed = true; |
OLD | NEW |