Bug 199220

Summary: [ContentChangeObserver] Dispatch synthetic mouse event asynchronously in completePendingSyntheticClickForContentChangeObserver
Product: WebKit Reporter: zalan <zalan>
Component: WebCore Misc.Assignee: zalan <zalan>
Status: RESOLVED FIXED    
Severity: Normal CC: commit-queue, rniwa, simon.fraser
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch
none
Patch
none
Patch none

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.