Bug 197004 - [Pointer Events WPT] Unskip imported/w3c/web-platform-tests/pointerevents/pointerevent_lostpointercapture_for_disconnected_node.html
Summary: [Pointer Events WPT] Unskip imported/w3c/web-platform-tests/pointerevents/poi...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: UI Events (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Antoine Quint
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2019-04-17 07:02 PDT by Antoine Quint
Modified: 2019-04-18 06:32 PDT (History)
8 users (show)

See Also:


Attachments
Patch (11.74 KB, patch)
2019-04-18 02:26 PDT, Antoine Quint
koivisto: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Antoine Quint 2019-04-17 07:02:16 PDT
The test at imported/w3c/web-platform-tests/pointerevents/pointerevent_lostpointercapture_for_disconnected_node.html is timing out and is skipped currently.
Comment 1 Antoine Quint 2019-04-17 07:07:26 PDT
We don't release pointer capture when a node that has pointer capture is disconnected.
Comment 2 Antoine Quint 2019-04-18 02:26:49 PDT
Created attachment 367722 [details]
Patch
Comment 3 Antti Koivisto 2019-04-18 06:11:56 PDT
Comment on attachment 367722 [details]
Patch

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

> Source/WebCore/page/PointerCaptureController.cpp:133
> +    for (auto& keyAndValue : m_activePointerIdsToCapturingData) {

I suppose this map is mostly empty/has very few items?

> Source/WebCore/page/PointerCaptureController.cpp:147
> +        return;
> +    }

I feel for loops read better if the bail out case is a branch, not the body of the loop.
Comment 4 Antoine Quint 2019-04-18 06:24:49 PDT
(In reply to Antti Koivisto from comment #3)
> Comment on attachment 367722 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=367722&action=review
> 
> > Source/WebCore/page/PointerCaptureController.cpp:133
> > +    for (auto& keyAndValue : m_activePointerIdsToCapturingData) {
> 
> I suppose this map is mostly empty/has very few items?

Yes. On macOS, it will be empty except if the page has explicitly requested pointer capture for the single active pointer. So the map would have at most one item in it on macOS.

On iOS, pointer capture is implicit, so that map will have as many items as there are active touches, which most likely will be 1 or 2.

> > Source/WebCore/page/PointerCaptureController.cpp:147
> > +        return;
> > +    }
> 
> I feel for loops read better if the bail out case is a branch, not the body
> of the loop.

Cool, I'll change it.
Comment 5 Antoine Quint 2019-04-18 06:31:24 PDT
Committed r244423: <https://trac.webkit.org/changeset/244423>
Comment 6 Radar WebKit Bug Importer 2019-04-18 06:32:22 PDT
<rdar://problem/50014329>