Bug 255265 - elementsFromPoint doesn't handle sorting preserve-3d
Summary: elementsFromPoint doesn't handle sorting preserve-3d
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: Layout and Rendering (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2023-04-10 18:33 PDT by Matt Woodrow
Modified: 2023-04-10 18:36 PDT (History)
4 users (show)

See Also:


Attachments
Testcase (1.09 KB, text/html)
2023-04-10 18:36 PDT, Matt Woodrow
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Matt Woodrow 2023-04-10 18:33:51 PDT
RenderLayer::hitTestLayer only handles finding a single hit layer when we're doing 3d depth sorting for transform-style:preserve-3d.

If we're using elementsFromPoint and want to return all the elements at the point, we don't handle sorting these by depth.

I think we need to collect a list of HitTestResult objects (and HitLayer objects), with the associated depth, and then sort the result by depth at the end and merge into a single HitTestResult object. This list would need to be passed into RenderLayer::hitTestList so that we can append to it from there rather than returning a single result from hitTestList.
Comment 1 Radar WebKit Bug Importer 2023-04-10 18:34:09 PDT
<rdar://problem/107861877>
Comment 2 Matt Woodrow 2023-04-10 18:34:15 PDT
It looks like blink has the same bug here, but Gecko gets it right.
Comment 3 Matt Woodrow 2023-04-10 18:36:20 PDT
Created attachment 465841 [details]
Testcase