Bug 279250 - Remove Quirk simulatedMouseEventTypeForTarget for maps.google.com
Summary: Remove Quirk simulatedMouseEventTypeForTarget for maps.google.com
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKit Misc. (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Karl Dubost
URL: http://maps.google.com/
Keywords: InRadar
Depends on: 198657 199904
Blocks:
  Show dependency treegraph
 
Reported: 2024-09-06 01:24 PDT by Karl Dubost
Modified: 2024-09-18 11:25 PDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Karl Dubost 2024-09-06 01:24:47 PDT
This is about Google Maps on iPad through Safari.

This is not a new problem it has been fixed in the past through a Quirk. 
https://github.com/WebKit/WebKit/blob/36471855c3cb59685b184d7632904cb9ad87468f/Source/WebCore/page/Quirks.cpp#L540-L558

The quirk is working by targeting 

```
   element->getAttribute(HTMLNames::classAttr) == "widget-expand-button-pegman-icon"_s)
```

This doesn't exist anymore. So basically the current quirk is dead code. 

It was created with 
Bug 198657
rdar://problem/51345064

and extended to more domains by
Bug 199904
rdar://53250104 

Notes:

It is possible to use the pegman giving access to streetview on iPad. The action is currently.
1. Tap once on the pegman
2. The blue lines on the map appears
3. Tap a second time on the map where you want the pegman to be released. 

But this is not possible to drag and drop it at the location of choices. 

In some ways the interaction is more similar to what Apple Maps is doing. 


We can either remove the Quirk (dead code)
or modify it to make it draggable again.
or contact Google Maps team on finding a UX solution which is working for Safari.
Comment 1 Radar WebKit Bug Importer 2024-09-06 01:25:06 PDT
<rdar://problem/135400991>
Comment 2 Karl Dubost 2024-09-08 22:52:04 PDT
The current code for the button.

```
<div class="app-horizontal-item"
     id="runway-expand-button">
    <div class="">
        <div class="WzvKIe ">
            <button class="sHj5c a8QCmb"
                    id="q2sIQ"
                    jsaction="runway.pegman; mousedown:runway.pegman; mouseup:runway.pegman; mouseover:runway.pegman; mouseout:runway.pegman; touchstart:runway.pegman; touchend:runway.pegman; keydown:runway.pegman; contextmenu:runway.pegman"
                    aria-label="Afficher la disponibilité de Street&nbsp;View">
                <div class="q2sIQ"
                     style="background-image: url(&quot;//maps.gstatic.com/tactile/pegman_v3/default/runway-1x.png&quot;);"
                     tabindex="-1"></div>
            </button>
            <button class="GFgdCf"
                    jsaction="runway.expand; mouseover:runway.expand; mouseout:runway.expand; ptrdown:ripple.nested; mousedown:ripple.nested; keydown:ripple.nested; ptrup:null; mouseup:null; keydown:play.onKeyDown"
                    vet="6530"
                    aria-label="Afficher les images">
                <div class="L6Bbsd"><label class="Bm7zId"></label>
                    <div class="t8fEu"></div>
                </div>
            </button></div>
    </div>
</div>
```

When dragging the pegman, 

```
   <div class="WzvKIe ">
```

becomes 

```
   <div class="WzvKIe QAvlhe">
```

and this seems to be the relevant controls.

```
                this.nb.Ra("runway", "pegman", "click", this.N, this.N.Bc);
                this.nb.Ra("runway", "pegman", "dragstart", this.N, this.N.oe);
                this.nb.Ra("runway", "pegman", "drag", this.N, this.N.Qc);
                this.nb.Ra("runway", "pegman", "dragend", this.N, this.N.Wc);
                this.nb.Ra("runway", "pegman", "keydown", this.N, W => {
                    _.jle(n, W)
                }, 27);
                this.nb.Ra("runway",
                "pegman", "scrollwheel", this.N, this.N.Tb);
                this.nb.Ra("runway", "pegman", "ptrin", this.view, this.view.Qc);
                this.nb.Ra("runway", "pegman", "ptrout", this.view, this.view.Wc);
                this.nb.Ra("runway", "pegman", "contextmenu", this.view, this.view.Bc);
```
Comment 3 Karl Dubost 2024-09-17 14:31:25 PDT
Google fixed it after outreach. 
We can remove the Quirk in WebKit. 
And also the relevant code in Safari. 

I will rename the bug.
Comment 4 Karl Dubost 2024-09-17 14:39:59 PDT
Pull request: https://github.com/WebKit/WebKit/pull/33789
Comment 5 EWS 2024-09-18 11:25:55 PDT
Committed 283859@main (e27a1b42d29e): <https://commits.webkit.org/283859@main>

Reviewed commits have been landed. Closing PR #33789 and removing active labels.