Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(337)

Side by Side Diff: third_party/WebKit/LayoutTests/css3/masking/clip-path-hittest.html

Issue 2280963002: Fix clip-path reference box/coordinate space setup for hit-testing (Closed)
Patch Set: DCHECK rootLayer; rename computeReferenceBox to boxForClipPath Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/css3/masking/clip-path-hittest-reference-usou.html » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 <!DOCTYPE html>
2 <title>Hit-test of clip-path polygon on &lt;div> with box-shadow</title>
3 <script src="../../resources/testharness.js"></script>
4 <script src="../../resources/testharnessreport.js"></script>
5 <style>
6 body {
7 margin: 0;
8 }
9 .box {
10 width: 100px;
11 height: 100px;
12 background-color: blue;
13 box-shadow: -100px 0px red;
14 -webkit-clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%);
15 clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%);
16 }
17 </style>
18 <div class=box></div>
19 <script>
20 function assert_element_at(element, pointlist) {
21 for (var point of pointlist) {
22 var result = document.elementFromPoint(point[0], point[1]);
23 assert_equals(result, element, point.join(','));
24 }
25 }
26
27 test(function() {
28 var div = document.querySelector('.box');
29
30 // Points inside clip-path.
31 assert_element_at(div, [[50, 50], [50, 25], [50, 75], [25, 50], [75, 50]]);
32
33 // Points outside clip-path.
34 assert_element_at(document.body, [[20, 20], [80, 20], [20, 80], [80, 80]]);
35 });
36 </script>
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/css3/masking/clip-path-hittest-reference-usou.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698