OLD | NEW |
1 // [Name] SVGCircleElement-dom-requiredFeatures.js | 1 // [Name] SVGCircleElement-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 circleElement = createSVGElement("circle"); | 6 var circleElement = createSVGElement("circle"); |
7 circleElement.setAttribute("r", "200"); | 7 circleElement.setAttribute("r", "200"); |
8 | 8 |
9 rootSVGElement.appendChild(circleElement); | 9 rootSVGElement.appendChild(circleElement); |
10 | 10 |
11 function repaintTest() { | 11 function repaintTest() { |
12 debug("Check that SVGCircleElement is initially displayed"); | 12 debug("Check that SVGCircleElement is initially displayed"); |
13 shouldBeEqualToString("document.defaultView.getComputedStyle(circleElement,
null).display", "inline"); | 13 shouldHaveBBox("circleElement", "400", "400"); |
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 circleElement.setAttribute("requiredFeatures", "http://www.w3.org/TR/SVG11/f
eature#BogusFeature"); | 15 circleElement.setAttribute("requiredFeatures", "http://www.w3.org/TR/SVG11/f
eature#BogusFeature"); |
16 shouldBeEqualToString("document.defaultView.getComputedStyle(circleElement,
null).display", ""); | 16 shouldHaveBBox("circleElement", "0", "0"); |
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 circleElement.setAttribute("requiredFeatures", "http://www.w3.org/TR/SVG11/f
eature#Shape"); | 18 circleElement.setAttribute("requiredFeatures", "http://www.w3.org/TR/SVG11/f
eature#Shape"); |
19 shouldBeEqualToString("document.defaultView.getComputedStyle(circleElement,
null).display", "inline"); | 19 shouldHaveBBox("circleElement", "400", "400"); |
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 circleElement.setAttribute("requiredFeatures", "http://www.w3.org/TR/SVG11/f
eature#Gradient"); | 21 circleElement.setAttribute("requiredFeatures", "http://www.w3.org/TR/SVG11/f
eature#Gradient"); |
22 shouldBeEqualToString("document.defaultView.getComputedStyle(circleElement,
null).display", "inline"); | 22 shouldHaveBBox("circleElement", "400", "400"); |
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 circleElement.setAttribute("requiredFeatures", "http://www.w3.org/TR/SVG11/f
eature#BogusFeature"); | 24 circleElement.setAttribute("requiredFeatures", "http://www.w3.org/TR/SVG11/f
eature#BogusFeature"); |
25 shouldBeEqualToString("document.defaultView.getComputedStyle(circleElement,
null).display", ""); | 25 shouldHaveBBox("circleElement", "0", "0"); |
26 | 26 |
27 completeTest(); | 27 completeTest(); |
28 } | 28 } |
29 | 29 |
30 var successfullyParsed = true; | 30 var successfullyParsed = true; |
OLD | NEW |