Bug 238187 - Add a debug overlay for interaction regions
Summary: Add a debug overlay for interaction regions
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Tim Horton
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2022-03-21 22:41 PDT by Tim Horton
Modified: 2022-04-01 01:18 PDT (History)
16 users (show)

See Also:


Attachments
Patch (62.24 KB, patch)
2022-03-21 22:42 PDT, Tim Horton
no flags Details | Formatted Diff | Diff
Patch (61.27 KB, patch)
2022-03-22 01:06 PDT, Tim Horton
no flags Details | Formatted Diff | Diff
Patch (62.82 KB, patch)
2022-03-31 14:45 PDT, Tim Horton
no flags Details | Formatted Diff | Diff
Patch (62.71 KB, patch)
2022-03-31 19:43 PDT, Tim Horton
no flags Details | Formatted Diff | Diff
Patch (62.83 KB, patch)
2022-03-31 22:45 PDT, Tim Horton
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Tim Horton 2022-03-21 22:41:10 PDT
Add a debug overlay for interaction regions
Comment 1 Tim Horton 2022-03-21 22:42:20 PDT
Created attachment 455334 [details]
Patch
Comment 2 Tim Horton 2022-03-22 01:06:20 PDT
Created attachment 455345 [details]
Patch
Comment 3 Radar WebKit Bug Importer 2022-03-28 22:42:15 PDT
<rdar://problem/90964948>
Comment 4 Wenson Hsieh 2022-03-30 17:03:09 PDT
Comment on attachment 455345 [details]
Patch

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

r=me (with a build fix for CMake)

> Source/WebCore/dom/Node.cpp:2519
> +    for (const auto& eventType : eventTypes()) {
> +        if (eventNames().isTouchRelatedEventType(eventType, *this))
> +            return true;
> +    }
> +    return false;

(Could consider using `containsIf` here — might be a tiny bit cleaner)

> Source/WebCore/page/DebugPageOverlays.cpp:265
> +    Vector<Setting> m_settings {

FixedVector?

> Source/WebCore/page/FrameSnapshotting.cpp:189
> +    for (; !!renderer; renderer = renderer->parent()) {

Could we use `ancestorsOfType<RenderElement>` here?

> Source/WebKit/UIProcess/API/Cocoa/WKPreferencesPrivate.h:40
> +    _WKInteractionRegion = 1 << 4,

Does this need availability information too?
Comment 5 Darin Adler 2022-03-30 20:50:22 PDT
Comment on attachment 455345 [details]
Patch

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

>> Source/WebCore/page/DebugPageOverlays.cpp:265
>> +    Vector<Setting> m_settings {
> 
> FixedVector?

std::array?
Comment 6 Tim Horton 2022-03-31 14:45:30 PDT
Created attachment 456285 [details]
Patch
Comment 7 Tim Horton 2022-03-31 19:43:52 PDT
Created attachment 456310 [details]
Patch
Comment 8 Tim Horton 2022-03-31 19:45:22 PDT
(In reply to Darin Adler from comment #5)
> Comment on attachment 455345 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=455345&action=review
> 
> >> Source/WebCore/page/DebugPageOverlays.cpp:265
> >> +    Vector<Setting> m_settings {
> > 
> > FixedVector?
> 
> std::array?

FixedVector seems like std::array with less steps? (unless we have another way to construct one from an initializer list without specifying the size?)

(In reply to Wenson Hsieh from comment #4)
> Comment on attachment 455345 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=455345&action=review
> 
> r=me (with a build fix for CMake)
> 
> > Source/WebCore/dom/Node.cpp:2519
> > +    for (const auto& eventType : eventTypes()) {
> > +        if (eventNames().isTouchRelatedEventType(eventType, *this))
> > +            return true;
> > +    }
> > +    return false;
> 
> (Could consider using `containsIf` here — might be a tiny bit cleaner)

Way cleaner!

> > Source/WebCore/page/FrameSnapshotting.cpp:189
> > +    for (; !!renderer; renderer = renderer->parent()) {
> 
> Could we use `ancestorsOfType<RenderElement>` here?

lineageOfType, apparently, so that we visit self.

> > Source/WebKit/UIProcess/API/Cocoa/WKPreferencesPrivate.h:40
> > +    _WKInteractionRegion = 1 << 4,
> 
> Does this need availability information too?

Of course!
Comment 9 Darin Adler 2022-03-31 21:31:24 PDT
Comment on attachment 456310 [details]
Patch

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

> Source/WebCore/page/DebugPageOverlays.cpp:266
> +        { "constrain", "Constrain to Regions", true },

Need a bunch of _s here if you don’t want to mess things up for Chris.
Comment 10 Tim Horton 2022-03-31 21:42:58 PDT
(In reply to Darin Adler from comment #9)
> Comment on attachment 456310 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=456310&action=review
> 
> > Source/WebCore/page/DebugPageOverlays.cpp:266
> > +        { "constrain", "Constrain to Regions", true },
> 
> Need a bunch of _s here if you don’t want to mess things up for Chris.

I don't want to mess things up for Chris! I think I see what you're referring to.
Comment 11 Tim Horton 2022-03-31 22:45:24 PDT
Created attachment 456322 [details]
Patch
Comment 12 EWS 2022-04-01 01:18:48 PDT
Committed r292208 (249111@main): <https://commits.webkit.org/249111@main>

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