Bug 199220 - [ContentChangeObserver] Dispatch synthetic mouse event asynchronously in completePendingSyntheticClickForContentChangeObserver
Summary: [ContentChangeObserver] Dispatch synthetic mouse event asynchronously in comp...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebCore Misc. (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: zalan
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2019-06-25 20:27 PDT by zalan
Modified: 2019-06-26 07:44 PDT (History)
3 users (show)

See Also:


Attachments
Patch (6.97 KB, patch)
2019-06-25 20:53 PDT, zalan
no flags Details | Formatted Diff | Diff
Patch (6.99 KB, patch)
2019-06-25 21:26 PDT, zalan
no flags Details | Formatted Diff | Diff
Patch (6.98 KB, patch)
2019-06-26 07:00 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-06-25 20:27:59 PDT
<rdar://problem/51787961>
Comment 1 zalan 2019-06-25 20:53:03 PDT
Created attachment 372901 [details]
Patch
Comment 2 Simon Fraser (smfr) 2019-06-25 21:07:59 PDT
Comment on attachment 372901 [details]
Patch

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

> Source/WebKit/ChangeLog:10
> +        WebPage::completePendingSyntheticClickForContentChangeObserver should not dispatch mouse events synchronously as through style updates
> +        they could destroy the element that initiated this change. WebPage::handleSyntheticClick() already implements this pattern. 

"as through style updates" is hard to parse. Break into two sentences?

> Source/WebKit/WebProcess/WebPage/ios/WebPageIOS.mm:720
>  

Should you check if the targetNode is still connected?
Comment 3 zalan 2019-06-25 21:26:11 PDT
Created attachment 372903 [details]
Patch
Comment 4 zalan 2019-06-25 21:26:41 PDT
(In reply to Simon Fraser (smfr) from comment #2)
> Comment on attachment 372901 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=372901&action=review
> 
> > Source/WebKit/ChangeLog:10
> > +        WebPage::completePendingSyntheticClickForContentChangeObserver should not dispatch mouse events synchronously as through style updates
> > +        they could destroy the element that initiated this change. WebPage::handleSyntheticClick() already implements this pattern. 
> 
> "as through style updates" is hard to parse. Break into two sentences?
> 
> > Source/WebKit/WebProcess/WebPage/ios/WebPageIOS.mm:720
> >  
> 
> Should you check if the targetNode is still connected?
Not sure. Will check with rniwa tomorrow.
Comment 5 Ryosuke Niwa 2019-06-26 00:36:22 PDT
Comment on attachment 372903 [details]
Patch

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

> Source/WebKit/WebProcess/WebPage/ios/WebPageIOS.mm:724
> +            protectedThis->completeSyntheticClick(targetNode, location, modifiers, WebCore::OneFingerTap, pointerId);

Yes, we should check that targetNode is still in the same document.
Dispatching mouse events on a detached node would be weird.
Comment 6 zalan 2019-06-26 07:00:53 PDT
Created attachment 372921 [details]
Patch
Comment 7 WebKit Commit Bot 2019-06-26 07:44:31 PDT
Comment on attachment 372921 [details]
Patch

Clearing flags on attachment: 372921

Committed r246835: <https://trac.webkit.org/changeset/246835>
Comment 8 WebKit Commit Bot 2019-06-26 07:44:33 PDT
All reviewed patches have been landed.  Closing bug.