Open mikokm opened 5 years ago
Can we just define hit-testing order in terms of the z-sorting and intersection behavior? Hit-testing should always match painting.
I was confused by this in https://bugzilla.mozilla.org/show_bug.cgi?id=1686390 (more test cases there).
Can we just define hit-testing order in terms of the z-sorting and intersection behavior? Hit-testing should always match painting.
This is spot on.
Related to #2325. css-transforms-2: https://drafts.csswg.org/css-transforms-2/ cssom-view: https://drafts.csswg.org/cssom-view/#dom-document-elementfrompoint
The expected behavior of doing a hit test on a page with CSS 3D transformed elements is that the top-most element is returned first.
It seems that this is not how Chrome and Safari work. In this testcase, an element is rotated so that it intersects with its preserve-3d parent plane at z=0. The blue area is from the parent element (not link), and the white area is from the transformed child element (link). On Chrome and Safari both of the areas are clickable, on Firefox only the blue area is clickable.
This was found by webcompat. The hit testing behavior of 3D transformed elements should be defined, so that this browser interoperability issue can be fixed.