.
<rdar://problem/51770057>
Created attachment 424861 [details] Patch
Created attachment 424967 [details] Patch the previous patch broke other areas of the site (e.g. nested menus in the menubar) so adjust `Quirks::shouldDispatchSimulatedMouseEvents` to take an `EventTarget` so that it can be conditionalized beyond the top document URL host
Comment on attachment 424967 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=424967&action=review > Source/WebCore/dom/EventNames.h:409 > + if (is<Node>(target) && downcast<Node>(target).document().quirks().shouldDispatchSimulatedMouseEvents(&target)) { What if the target has been disconnected from the document? Do we need to check 'isConnected'? > Source/WebCore/page/Quirks.cpp:426 > + return ShouldDispatchSimulatedMouseEvents::DependingOnTargetFor_mybinder_org; Well, at least we have a way to address others like this now.
Comment on attachment 424967 [details] Patch r=me, but maybe check with Wenson whether we need to see if the Node is actually connected to the document for these touch things.
Comment on attachment 424967 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=424967&action=review >> Source/WebCore/dom/EventNames.h:409 >> + if (is<Node>(target) && downcast<Node>(target).document().quirks().shouldDispatchSimulatedMouseEvents(&target)) { > > What if the target has been disconnected from the document? Do we need to check 'isConnected'? I think it's fine to preserve existing behavior (and not check for whether the node is connected). I'm also not sure how that would work if the page adds an event listener to a disconnected node and then adds the node to the DOM..
Comment on attachment 424967 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=424967&action=review >>> Source/WebCore/dom/EventNames.h:409 >>> + if (is<Node>(target) && downcast<Node>(target).document().quirks().shouldDispatchSimulatedMouseEvents(&target)) { >> >> What if the target has been disconnected from the document? Do we need to check 'isConnected'? > > I think it's fine to preserve existing behavior (and not check for whether the node is connected). > > I'm also not sure how that would work if the page adds an event listener to a disconnected node and then adds the node to the DOM.. Yeah as @Wenson Hsieh said (he hit submit before I did) this patch doesn't change this behavior, it just moves where `document()` is called. Also, all `Node` should always have a `document()` even if they're not connected.
Committed r275431: <https://commits.webkit.org/r275431> All reviewed patches have been landed. Closing bug and clearing flags on attachment 424967 [details].