Bug 255265

Summary: elementsFromPoint doesn't handle sorting preserve-3d
Product: WebKit Reporter: Matt Woodrow <mattwoodrow>
Component: Layout and RenderingAssignee: Nobody <webkit-unassigned>
Status: NEW ---    
Severity: Normal CC: bfulgham, simon.fraser, webkit-bug-importer, zalan
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Testcase none

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