Chromium Code Reviews| Index: LayoutTests/fast/events/hit-test-clip-path-reference.html |
| diff --git a/LayoutTests/fast/events/hit-test-clip-path-reference.html b/LayoutTests/fast/events/hit-test-clip-path-reference.html |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..d1fdb1229ceb3e671b56f0aa24cc043cbe1dae81 |
| --- /dev/null |
| +++ b/LayoutTests/fast/events/hit-test-clip-path-reference.html |
| @@ -0,0 +1,67 @@ |
| + <!DOCTYPE html> |
| +<style> |
| +#d { |
| + width: 180px; |
| + height: 180px; |
| + border: 1px solid black; |
| +} |
| +#clip { |
| + width: 160px; |
| + height: 160px; |
| + margin: 10px; |
| + background-color: green; |
| + -webkit-clip-path: url(#c1); |
| +} |
| +</style> |
| +<body> |
|
fs
2015/08/19 22:04:57
Unnecessary.
Yufeng Shen (Slow to review)
2015/08/20 20:17:21
Done.
|
| +<svg height="0"> |
| + <clipPath id="c1" clipPathUnits="objectBoundingBox"> |
| + <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.
|
| + </clipPath> |
| + </svg> |
| +<div id="d"><div id="clip"></div></div> |
| +<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.
|
| + |
| +<script src="../../resources/js-test.js"></script> |
| +<script> |
| +description("Test that hit-test work with clip-path using svg reference"); |
| + |
| +if (!window.eventSender) { |
| + 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.
|
| +} |
| + |
| +var clip = document.getElementById('clip'); |
| +clip.addEventListener('click', function(event) { |
| + event.stopPropagation(); |
| + debug('click on #clip'); |
| +}); |
| + |
| +var div_d = document.getElementById('d'); |
| +div_d.addEventListener('click', function(event) { |
| + event.stopPropagation(); |
| + debug('click on #d'); |
| +}); |
| + |
| +document.addEventListener('click', function(event) { |
| + event.stopPropagation(); |
| + debug('click on #document'); |
| +}); |
| + |
| +function click(x, y) { |
| + eventSender.mouseMoveTo(x, y); |
| + eventSender.mouseDown(); |
| + eventSender.mouseUp(); |
| +} |
| + |
| +onload = function() { |
| + // Should hit #document. |
| + click(200, 200); |
| + // Should hit #d at the place where #clip is clipped. |
| + click(30, 30); |
| + // Should hit #clip at the place where #clip is not clipped. |
| + click(100, 100); |
| +} |
| + |
| +</script> |
| + |
| +</body> |