blob: 3c617dbcfb790629036410abb3a4a255e831f48b [file] [log] [blame]
<!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-transform-influences-hitTesting.js
// [Expected rendering result] green circle - and a series of PASS messages
description("Tests hitTesting on clipped Elements. Clip-path gets CSS transformed.")
createSVGTestCase();
var defsElement = createSVGElement("defs");
rootSVGElement.appendChild(defsElement);
var clipPathElement = createSVGElement("clipPath");
clipPathElement.setAttribute("id", "clipper");
var clipRectElement = createSVGElement("rect");
clipRectElement.setAttribute("width", "5");
clipRectElement.setAttribute("height", "5");
clipRectElement.setAttribute("style", "-webkit-transform: scale(20)");
clipPathElement.appendChild(clipRectElement);
defsElement.appendChild(clipPathElement);
var foregroundRect = createSVGElement("rect");
foregroundRect.setAttribute("width", "100");
foregroundRect.setAttribute("height", "100");
foregroundRect.setAttribute("fill", "green");
foregroundRect.setAttribute("clip-path", "url(#clipper)");
foregroundRect.setAttribute("onclick", "testPassed('Hit thrown on not clipped area of rect.'); completeTest();");
rootSVGElement.appendChild(foregroundRect);
// The clipPath gets scaled by 20. This should influence the hit testing,
// since the area of the clipped content is affected as well.
function repaintTest() {
clickAt(75, 50);
}
var successfullyParsed = true;
</script>
</body>
</html>