OLD | NEW |
1 // [Name] SVGRectElement-dom-requiredFeatures.js | 1 // [Name] SVGRectElement-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 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 shouldHaveBBox("rectElement", "200", "200"); |
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.setAttribute("requiredFeatures", "http://www.w3.org/TR/SVG11/fea
ture#BogusFeature"); | 16 rectElement.setAttribute("requiredFeatures", "http://www.w3.org/TR/SVG11/fea
ture#BogusFeature"); |
17 shouldBeEqualToString("document.defaultView.getComputedStyle(rectElement, nu
ll).display", ""); | 17 shouldHaveBBox("rectElement", "0", "0"); |
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.setAttribute("requiredFeatures", "http://www.w3.org/TR/SVG11/fea
ture#Shape"); | 19 rectElement.setAttribute("requiredFeatures", "http://www.w3.org/TR/SVG11/fea
ture#Shape"); |
20 shouldBeEqualToString("document.defaultView.getComputedStyle(rectElement, nu
ll).display", "inline"); | 20 shouldHaveBBox("rectElement", "200", "200"); |
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.setAttribute("requiredFeatures", "http://www.w3.org/TR/SVG11/fea
ture#Gradient"); | 22 rectElement.setAttribute("requiredFeatures", "http://www.w3.org/TR/SVG11/fea
ture#Gradient"); |
23 shouldBeEqualToString("document.defaultView.getComputedStyle(rectElement, nu
ll).display", "inline"); | 23 shouldHaveBBox("rectElement", "200", "200"); |
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.setAttribute("requiredFeatures", "http://www.w3.org/TR/SVG11/fea
ture#BogusFeature"); | 25 rectElement.setAttribute("requiredFeatures", "http://www.w3.org/TR/SVG11/fea
ture#BogusFeature"); |
26 shouldBeEqualToString("document.defaultView.getComputedStyle(rectElement, nu
ll).display", ""); | 26 shouldHaveBBox("rectElement", "0", "0"); |
27 | 27 |
28 completeTest(); | 28 completeTest(); |
29 } | 29 } |
30 | 30 |
31 var successfullyParsed = true; | 31 var successfullyParsed = true; |
OLD | NEW |