Bug 202006 - [iPadOS] The second click event is missing on double tap when dblclick handler is not present
Summary: [iPadOS] The second click event is missing on double tap when dblclick handle...
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: zalan
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2019-09-19 14:21 PDT by zalan
Modified: 2019-09-24 13:06 PDT (History)
11 users (show)

See Also:


Attachments
Patch (11.92 KB, patch)
2019-09-19 14:59 PDT, zalan
no flags Details | Formatted Diff | Diff
Patch (37.55 KB, patch)
2019-09-20 14:48 PDT, zalan
no flags Details | Formatted Diff | Diff
Patch (21.57 KB, patch)
2019-09-23 11:34 PDT, zalan
no flags Details | Formatted Diff | Diff
Patch (22.30 KB, patch)
2019-09-24 12:33 PDT, zalan
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description zalan 2019-09-19 14:21:43 PDT
rdar://problem/51706828
Comment 1 zalan 2019-09-19 14:59:44 PDT
Created attachment 379165 [details]
Patch
Comment 2 Wenson Hsieh 2019-09-19 15:02:36 PDT
Comment on attachment 379165 [details]
Patch

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

> Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm:2143
> +        return _positionInformation.nodeAtPositionHasDoubleClickHandler;

What is responsible for ensuring that position information is up to date here?
Comment 3 zalan 2019-09-19 15:37:43 PDT
Comment on attachment 379165 [details]
Patch

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

>> Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm:2143
>> +        return _positionInformation.nodeAtPositionHasDoubleClickHandler;
> 
> What is responsible for ensuring that position information is up to date here?

I was curious about that too and was going to figure that out myself! I had tested a few dynamic cases (add/remove eventlisteners) and they all worked fine so I thought I might just upload the patch first.
Comment 4 Wenson Hsieh 2019-09-19 16:41:32 PDT
(In reply to zalan from comment #3)
> Comment on attachment 379165 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=379165&action=review
> 
> >> Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm:2143
> >> +        return _positionInformation.nodeAtPositionHasDoubleClickHandler;
> > 
> > What is responsible for ensuring that position information is up to date here?
> 
> I was curious about that too and was going to figure that out myself! I had
> tested a few dynamic cases (add/remove eventlisteners) and they all worked
> fine so I thought I might just upload the patch first.

It would be worth double checking why this works. I suspect it's using position information state from web touch and/or text interaction gestures.
Comment 5 zalan 2019-09-19 16:43:05 PDT
(In reply to Wenson Hsieh from comment #4)
> (In reply to zalan from comment #3)
> > Comment on attachment 379165 [details]
> > Patch
> > 
> > View in context:
> > https://bugs.webkit.org/attachment.cgi?id=379165&action=review
> > 
> > >> Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm:2143
> > >> +        return _positionInformation.nodeAtPositionHasDoubleClickHandler;
> > > 
> > > What is responsible for ensuring that position information is up to date here?
> > 
> > I was curious about that too and was going to figure that out myself! I had
> > tested a few dynamic cases (add/remove eventlisteners) and they all worked
> > fine so I thought I might just upload the patch first.
> 
> It would be worth double checking why this works. I suspect it's using
> position information state from web touch and/or text interaction gestures.
Absolutely. I was going to check if I need to trigger an update on eventlistner (de)registrations.
Comment 6 zalan 2019-09-20 14:48:15 PDT
Created attachment 379272 [details]
Patch
Comment 7 zalan 2019-09-23 11:34:47 PDT
Created attachment 379381 [details]
Patch
Comment 8 Wenson Hsieh 2019-09-23 14:45:35 PDT
Comment on attachment 379381 [details]
Patch

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

> Source/WebKit/Shared/ios/InteractionInformationRequest.cpp:89
> -    return (other.point - point).diagonalLengthSquared() <= 4;
> +    return (other.point - point).diagonalLengthSquared() <= radius * radius;

Nit - it might be cleaner to just share code with InteractionInformationRequest::isValidForRequest above, by moving the distance check into InteractionInformationRequest::isValidForRequest and treating isValidForRequest as the case where radius == 0.
Comment 9 zalan 2019-09-24 12:33:36 PDT
Created attachment 379468 [details]
Patch
Comment 10 WebKit Commit Bot 2019-09-24 13:06:55 PDT
Comment on attachment 379468 [details]
Patch

Clearing flags on attachment: 379468

Committed r250315: <https://trac.webkit.org/changeset/250315>
Comment 11 WebKit Commit Bot 2019-09-24 13:06:56 PDT
All reviewed patches have been landed.  Closing bug.