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