Bug 227004 - RenderLayer::hitTestLayer assumes its renderer is a RenderBox
Summary: RenderLayer::hitTestLayer assumes its renderer is a RenderBox
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Layout and Rendering (show other bugs)
Version: WebKit Local Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Cameron McCormack (:heycam)
URL:
Keywords: InRadar
Depends on:
Blocks: 227005 226499
  Show dependency treegraph
 
Reported: 2021-06-14 18:55 PDT by Cameron McCormack (:heycam)
Modified: 2021-06-16 17:28 PDT (History)
12 users (show)

See Also:


Attachments
Patch (4.71 KB, patch)
2021-06-14 19:02 PDT, Cameron McCormack (:heycam)
no flags Details | Formatted Diff | Diff
Patch (4.70 KB, patch)
2021-06-16 17:01 PDT, Cameron McCormack (:heycam)
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Cameron McCormack (:heycam) 2021-06-14 18:55:59 PDT
But we might, for example, have a clip-path on an inline.
Comment 1 Cameron McCormack (:heycam) 2021-06-14 18:59:46 PDT
<rdar://79265788>
Comment 2 Cameron McCormack (:heycam) 2021-06-14 19:02:13 PDT
Created attachment 431393 [details]
Patch
Comment 3 Cameron McCormack (:heycam) 2021-06-14 19:02:39 PDT
Filed bug 227005 for the followup work to make this work on inlines.
Comment 4 zalan 2021-06-14 20:23:25 PDT
shouldn't hitTestClipPath be on RenderLayerModelObject implemented by RenderBox and RenderInline (best effort) so that in RenderLayer::hitTestLayer we could just call renderer().hitTestClipPath(). It has the cost of a virtual call but this is surely not a hot codepath.
Comment 5 Simon Fraser (smfr) 2021-06-14 20:47:36 PDT
Comment on attachment 431393 [details]
Patch

Alan has a suggestion
Comment 6 Cameron McCormack (:heycam) 2021-06-14 21:40:34 PDT
Yeah, I was looking at pulling that function up in the followup bug, but started wondering about the reference box stuff!
Comment 7 Cameron McCormack (:heycam) 2021-06-16 16:48:10 PDT
I'll land the original is<RenderBox>() check here and do the followup work later, which turned out to be not as straightforward as I'd hoped.
Comment 8 Cameron McCormack (:heycam) 2021-06-16 17:01:55 PDT
Created attachment 431623 [details]
Patch
Comment 9 EWS 2021-06-16 17:28:06 PDT
Committed r278969 (238895@main): <https://commits.webkit.org/238895@main>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 431623 [details].