Update To 11.40.268.0
[platform/framework/web/crosswalk.git] / src / third_party / WebKit / LayoutTests / svg / dynamic-updates / script-tests / SVGClipPathElement-css-transform-influences-hitTesting.js
1 // [Name] SVGClipPathElement-transform-influences-hitTesting.js
2 // [Expected rendering result] green circle - and a series of PASS messages
3
4 description("Tests hitTesting on clipped Elements. Clip-path gets CSS transformed.")
5 createSVGTestCase();
6
7 var defsElement = createSVGElement("defs");
8 rootSVGElement.appendChild(defsElement);
9
10 var clipPathElement = createSVGElement("clipPath");
11 clipPathElement.setAttribute("id", "clipper");
12
13 var clipRectElement = createSVGElement("rect");
14 clipRectElement.setAttribute("width", "5");
15 clipRectElement.setAttribute("height", "5");
16 clipRectElement.setAttribute("style", "transform: scale(20)");
17 clipPathElement.appendChild(clipRectElement);
18
19 defsElement.appendChild(clipPathElement);
20
21 var foregroundRect = createSVGElement("rect");
22 foregroundRect.setAttribute("width", "100");
23 foregroundRect.setAttribute("height", "100");
24 foregroundRect.setAttribute("fill", "green");
25 foregroundRect.setAttribute("clip-path", "url(#clipper)");
26 foregroundRect.setAttribute("onclick", "testPassed('Hit thrown on not clipped area of rect.');");
27 rootSVGElement.appendChild(foregroundRect);
28
29 // The clipPath gets scaled by 20. This should influence the hit testing,
30 // since the area of the clipped content is affected as well. 
31 function repaintTest() {
32     clickAt(75, 50);
33 }
34
35 var successfullyParsed = true;