53 lines
1.7 KiB
HTML
53 lines
1.7 KiB
HTML
<!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] SVGClipPathElement-svgdom-clipPathUnits-prop.js
|
|
// [Expected rendering result] green circle - and a series of PASS messages
|
|
|
|
description("Tests dynamic updates of the 'clipPathUnits' property of the SVGClipPathElement object")
|
|
createSVGTestCase();
|
|
|
|
var defsElement = createSVGElement("defs");
|
|
rootSVGElement.appendChild(defsElement);
|
|
|
|
var clipPathElement = createSVGElement("clipPath");
|
|
clipPathElement.setAttribute("id", "clipper");
|
|
clipPathElement.setAttribute("clipPathUnits", "userSpaceOnUse");
|
|
|
|
var rectElementA = createSVGElement("rect");
|
|
rectElementA.setAttribute("width", "10");
|
|
rectElementA.setAttribute("height", "10");
|
|
clipPathElement.appendChild(rectElementA);
|
|
|
|
defsElement.appendChild(clipPathElement);
|
|
|
|
var rectElementB = createSVGElement("rect");
|
|
rectElementB.setAttribute("width", "100");
|
|
rectElementB.setAttribute("height", "100");
|
|
rectElementB.setAttribute("fill", "green");
|
|
rectElementB.setAttribute("clip-path", "url(#clipper)");
|
|
rootSVGElement.appendChild(rectElementB);
|
|
|
|
shouldBe("clipPathElement.clipPathUnits.baseVal", "SVGUnitTypes.SVG_UNIT_TYPE_USERSPACEONUSE");
|
|
|
|
function repaintTest() {
|
|
clipPathElement.clipPathUnits.baseVal = SVGUnitTypes.SVG_UNIT_TYPE_OBJECTBOUNDINGBOX;
|
|
shouldBe("clipPathElement.clipPathUnits.baseVal", "SVGUnitTypes.SVG_UNIT_TYPE_OBJECTBOUNDINGBOX");
|
|
|
|
completeTest();
|
|
}
|
|
|
|
var successfullyParsed = true;
|
|
</script>
|
|
</body>
|
|
</html>
|