Bug 224034 - [iPadOS] unable to reorder tabs on `*.mybinder.org`
Summary: [iPadOS] unable to reorder tabs on `*.mybinder.org`
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Devin Rousso
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2021-03-31 18:55 PDT by Devin Rousso
Modified: 2021-04-02 12:32 PDT (History)
10 users (show)

See Also:


Attachments
Patch (1.19 KB, patch)
2021-03-31 18:58 PDT, Devin Rousso
no flags Details | Formatted Diff | Diff
Patch (16.57 KB, patch)
2021-04-01 17:32 PDT, Devin Rousso
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
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].