OLD | NEW |
---|---|
(Empty) | |
1 <!DOCTYPE html> | |
2 <style> | |
3 #d { | |
4 width: 180px; | |
5 height: 180px; | |
6 border: 1px solid black; | |
7 } | |
8 #clip { | |
9 width: 160px; | |
10 height: 160px; | |
11 margin: 10px; | |
12 background-color: green; | |
13 -webkit-clip-path: url(#c1); | |
14 } | |
15 </style> | |
16 <body> | |
fs
2015/08/19 22:04:57
Unnecessary.
Yufeng Shen (Slow to review)
2015/08/20 20:17:21
Done.
| |
17 <svg height="0"> | |
18 <clipPath id="c1" clipPathUnits="objectBoundingBox"> | |
19 <rect x="0.2" y="0.2" width="0.5" height="0.5"/> | |
fs
2015/08/19 22:04:57
I might have picked something, well, less square =
pdr.
2015/08/19 22:08:43
Can you please add a test of a circle with hits on
Yufeng Shen (Slow to review)
2015/08/20 20:17:21
Done.
| |
20 </clipPath> | |
21 </svg> | |
22 <div id="d"><div id="clip"></div></div> | |
23 <div id='console'></div> | |
fs
2015/08/19 22:04:56
The test framework adds this.
Yufeng Shen (Slow to review)
2015/08/20 20:17:21
Done.
| |
24 | |
25 <script src="../../resources/js-test.js"></script> | |
26 <script> | |
27 description("Test that hit-test work with clip-path using svg reference"); | |
28 | |
29 if (!window.eventSender) { | |
30 testFailed('window.eventSender is required for this test.'); | |
fs
2015/08/19 22:04:56
It ought to be possible to write this test without
Yufeng Shen (Slow to review)
2015/08/20 20:17:21
Done.
| |
31 } | |
32 | |
33 var clip = document.getElementById('clip'); | |
34 clip.addEventListener('click', function(event) { | |
35 event.stopPropagation(); | |
36 debug('click on #clip'); | |
37 }); | |
38 | |
39 var div_d = document.getElementById('d'); | |
40 div_d.addEventListener('click', function(event) { | |
41 event.stopPropagation(); | |
42 debug('click on #d'); | |
43 }); | |
44 | |
45 document.addEventListener('click', function(event) { | |
46 event.stopPropagation(); | |
47 debug('click on #document'); | |
48 }); | |
49 | |
50 function click(x, y) { | |
51 eventSender.mouseMoveTo(x, y); | |
52 eventSender.mouseDown(); | |
53 eventSender.mouseUp(); | |
54 } | |
55 | |
56 onload = function() { | |
57 // Should hit #document. | |
58 click(200, 200); | |
59 // Should hit #d at the place where #clip is clipped. | |
60 click(30, 30); | |
61 // Should hit #clip at the place where #clip is not clipped. | |
62 click(100, 100); | |
63 } | |
64 | |
65 </script> | |
66 | |
67 </body> | |
OLD | NEW |