| OLD | NEW |
| (Empty) |
| 1 // [Name] SVGUseElement-svgdom-requiredFeatures.js | |
| 2 // [Expected rendering result] a series of PASS messages | |
| 3 | |
| 4 createSVGTestCase(); | |
| 5 | |
| 6 var useElement = createSVGElement("use"); | |
| 7 var defsElement = createSVGElement("defs"); | |
| 8 var rectElement = createSVGElement("rect"); | |
| 9 rectElement.setAttribute("width", "200"); | |
| 10 rectElement.setAttribute("height", "200"); | |
| 11 rectElement.setAttribute("id", "MyRect"); | |
| 12 useElement.setAttributeNS(xlinkNS, "xlink:href", "#MyRect"); | |
| 13 | |
| 14 defsElement.appendChild(rectElement); | |
| 15 rootSVGElement.appendChild(defsElement); | |
| 16 rootSVGElement.appendChild(useElement); | |
| 17 | |
| 18 function repaintTest() { | |
| 19 debug("Check that SVGUseElement is initially displayed"); | |
| 20 shouldHaveBBox("useElement", "200", "200"); | |
| 21 debug("Check that setting requiredFeatures to something invalid makes it not
render"); | |
| 22 useElement.requiredFeatures.appendItem("http://www.w3.org/TR/SVG11/feature#B
ogusFeature"); | |
| 23 shouldHaveBBox("useElement", "0", "0"); | |
| 24 debug("Check that setting requiredFeatures to something valid makes it rende
r again"); | |
| 25 useElement.requiredFeatures.replaceItem("http://www.w3.org/TR/SVG11/feature#
Shape", 0); | |
| 26 shouldHaveBBox("useElement", "200", "200"); | |
| 27 debug("Check that adding something valid to requiredFeatures keeps rendering
the element"); | |
| 28 useElement.requiredFeatures.appendItem("http://www.w3.org/TR/SVG11/feature#G
radient"); | |
| 29 shouldHaveBBox("useElement", "200", "200"); | |
| 30 debug("Check that adding something invalid to requiredFeatures makes it not
render"); | |
| 31 useElement.requiredFeatures.appendItem("http://www.w3.org/TR/SVG11/feature#B
ogusFeature"); | |
| 32 shouldHaveBBox("useElement", "0", "0"); | |
| 33 } | |
| 34 | |
| 35 var successfullyParsed = true; | |
| OLD | NEW |