Bug 224034

Summary: [iPadOS] unable to reorder tabs on `*.mybinder.org`
Product: WebKit Reporter: Devin Rousso <hi>
Component: New BugsAssignee: Devin Rousso <hi>
Status: RESOLVED FIXED    
Severity: Normal CC: bdakin, bfulgham, cdumez, esprehn+autocc, ews-watchlist, hi, kangil.han, thorton, webkit-bug-importer, wenson_hsieh
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch
none
Patch none

Description Devin Rousso 2021-03-31 18:55:27 PDT
.
Comment 1 Devin Rousso 2021-03-31 18:55:40 PDT
<rdar://problem/51770057>
Comment 2 Devin Rousso 2021-03-31 18:58:57 PDT
Created attachment 424861 [details]
Patch
Comment 3 Devin Rousso 2021-04-01 17:32:02 PDT
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 4 Brent Fulgham 2021-04-02 10:03:55 PDT
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 5 Brent Fulgham 2021-04-02 10:08:18 PDT
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 6 Wenson Hsieh 2021-04-02 12:10:50 PDT
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 7 Devin Rousso 2021-04-02 12:18:45 PDT
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.
Comment 8 EWS 2021-04-02 12:32:11 PDT
Committed r275431: <https://commits.webkit.org/r275431>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 424967 [details].