Bug 226499 - Hit-testing does not account for clip-path set on parent of <iframe>
Summary: Hit-testing does not account for clip-path set on parent of <iframe>
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Layout and Rendering (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Antoine Quint
URL:
Keywords: InRadar
Depends on: 226380 227004
Blocks:
  Show dependency treegraph
 
Reported: 2021-06-01 08:01 PDT by Antoine Quint
Modified: 2021-07-02 08:19 PDT (History)
12 users (show)

See Also:


Attachments
Patch (17.57 KB, patch)
2021-06-01 08:05 PDT, Antoine Quint
no flags Details | Formatted Diff | Diff
Patch (7.17 KB, patch)
2021-06-02 08:15 PDT, Antoine Quint
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Antoine Quint 2021-06-01 08:01:32 PDT
Hit-testing does not account for clip-path set on parent of <iframe>
Comment 1 Antoine Quint 2021-06-01 08:01:56 PDT
<rdar://77317612>
Comment 2 Antoine Quint 2021-06-01 08:05:20 PDT
Created attachment 430263 [details]
Patch
Comment 3 Darin Adler 2021-06-01 14:32:58 PDT
Comment on attachment 430263 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=430263&action=review

> LayoutTests/ChangeLog:15
> +2021-05-28  Antoine Quint  <graouts@webkit.org>

Double change log.
Comment 4 Antoine Quint 2021-06-02 08:15:29 PDT
Created attachment 430354 [details]
Patch
Comment 5 Simon Fraser (smfr) 2021-06-02 14:56:26 PDT
Comment on attachment 430354 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=430354&action=review

> Source/WebCore/rendering/RenderLayer.cpp:4114
> +    if (renderer().hasClipPath() && !downcast<RenderBox>(renderer()).hitTestClipPath(hitTestLocation, toLayoutPoint(location() - renderBoxLocation())))

Are we sure that hitTestLocation is in the correct coordinate system for the call to hitTestClipPath()?
Comment 6 EWS 2021-06-02 15:00:46 PDT
Committed r278377 (238404@main): <https://commits.webkit.org/238404@main>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 430354 [details].
Comment 7 Antoine Quint 2021-06-04 02:42:27 PDT
(In reply to Simon Fraser (smfr) from comment #5)
> Comment on attachment 430354 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=430354&action=review
> 
> > Source/WebCore/rendering/RenderLayer.cpp:4114
> > +    if (renderer().hasClipPath() && !downcast<RenderBox>(renderer()).hitTestClipPath(hitTestLocation, toLayoutPoint(location() - renderBoxLocation())))
> 
> Are we sure that hitTestLocation is in the correct coordinate system for the
> call to hitTestClipPath()?

I checked that this is the same we use when we hit test through RenderObject for the layer's outermost element.
Comment 8 Antoine Quint 2021-07-02 08:17:48 PDT
This caused bug 227624.
Comment 9 Antoine Quint 2021-07-02 08:19:28 PDT
(In reply to Antoine Quint from comment #7)
> (In reply to Simon Fraser (smfr) from comment #5)
> > Comment on attachment 430354 [details]
> > Patch
> > 
> > View in context:
> > https://bugs.webkit.org/attachment.cgi?id=430354&action=review
> > 
> > > Source/WebCore/rendering/RenderLayer.cpp:4114
> > > +    if (renderer().hasClipPath() && !downcast<RenderBox>(renderer()).hitTestClipPath(hitTestLocation, toLayoutPoint(location() - renderBoxLocation())))
> > 
> > Are we sure that hitTestLocation is in the correct coordinate system for the
> > call to hitTestClipPath()?
> 
> I checked that this is the same we use when we hit test through RenderObject
> for the layer's outermost element.

However… this looks to be the cause for bug 227624.