| <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN"> |
| <html> |
| <head> |
| <script src="resources/SVGTestCase.js"></script> |
| <script src="../../resources/js-test-pre.js"></script> |
| <script src="../../fast/repaint/resources/repaint.js"></script> |
| </head> |
| <body onload="runRepaintTest()"> |
| <h1>SVG 1.1 dynamic update tests</h1> |
| <p id="description"></p> |
| <div id="console"></div> |
| <script> |
| // [Name] SVGMarkerElement-svgdom-markerUnits-prop.js |
| // [Expected rendering result] start & end markers are visible - and a series of PASS messages |
| |
| description("Tests dynamic updates of the 'markerUnits' property of the SVGMarkerElement object") |
| createSVGTestCase(); |
| |
| var markerElement = createSVGElement("marker"); |
| markerElement.setAttribute("id", "marker"); |
| markerElement.setAttribute("viewBox", "0 0 10 10"); |
| markerElement.setAttribute("markerWidth", "2"); |
| markerElement.setAttribute("markerHeight", "2"); |
| markerElement.setAttribute("refX", "5"); |
| markerElement.setAttribute("refY", "5"); |
| markerElement.setAttribute("markerUnits", "userSpaceOnUse"); |
| |
| var markerPathElement = createSVGElement("path"); |
| markerPathElement.setAttribute("fill", "blue"); |
| markerPathElement.setAttribute("d", "M 5 0 L 10 10 L 0 10 Z"); |
| markerElement.appendChild(markerPathElement); |
| |
| var defsElement = createSVGElement("defs"); |
| defsElement.appendChild(markerElement); |
| rootSVGElement.appendChild(defsElement); |
| |
| var pathElement = createSVGElement("path"); |
| pathElement.setAttribute("fill", "none"); |
| pathElement.setAttribute("stroke", "green"); |
| pathElement.setAttribute("stroke-width", "10"); |
| pathElement.setAttribute("marker-start", "url(#marker)"); |
| pathElement.setAttribute("marker-end", "url(#marker)"); |
| pathElement.setAttribute("d", "M 130 135 L 180 135 L 180 185"); |
| rootSVGElement.appendChild(pathElement); |
| |
| shouldBe("markerElement.markerUnits.baseVal", "SVGMarkerElement.SVG_MARKERUNITS_USERSPACEONUSE"); |
| |
| function repaintTest() { |
| markerElement.markerUnits.baseVal = SVGMarkerElement.SVG_MARKERUNITS_STROKEWIDTH; |
| shouldBe("markerElement.markerUnits.baseVal", "SVGMarkerElement.SVG_MARKERUNITS_STROKEWIDTH"); |
| |
| completeTest(); |
| } |
| |
| var successfullyParsed = true; |
| </script> |
| </body> |
| </html> |