Bug 261390 - touchevents don't work correctly in iframes
Summary: touchevents don't work correctly in iframes
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: UI Events (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2023-09-10 16:20 PDT by Gregg Tavares
Modified: 2023-09-17 16:21 PDT (History)
5 users (show)

See Also:


Attachments
repo-for-the-issue (3.41 KB, application/zip)
2023-09-10 16:20 PDT, Gregg Tavares
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Gregg Tavares 2023-09-10 16:20:25 PDT
Created attachment 467630 [details]
repo-for-the-issue

Touchevents don't work correctly in iframes

Repo:

1. Unzip the attached files and serve them (or maybe they work from file:, I didn't test)
2. Open "outer-works-kinda.html" in Safari iOS
3. Scroll down, try to drag the green square in the yellow area  (this works)
4. Open "outer-broken.html"
5. Scroll down, try to drag the green square in the yellow area  (this does not work)

The only difference between the 2 files is in `outer-broken.html` these 2 lines exist

    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1" />

In outer-kinda-works they don't

Note: if you remotely connect desktop Safari to iOS Safari on "outer-broken.html" and turn on/off a few CSSs (meaning mark them as off then re-mark them as on so that nothing should have actually changed) eventually the page will magically start working
Comment 1 Gregg Tavares 2023-09-10 16:23:12 PDT
note: you can open "touch events vs pointer events.html" directly and it will work just fine.

Also, if you don't want to be bothered to unzip them they
are available here

https://greggman.github.io/doodles/test/prevent-scroll/outer-broken.html
https://greggman.github.io/doodles/test/prevent-scroll/outer-kinda-works.html
https://greggman.github.io/doodles/test/prevent-scroll/touch%20events%20vs%20pointer%20events.html

Sorry about the names. The bug I'm reporting has nothing to do with preventing-scrolling NOR with pointer-events. those are separate issues. The issue here is not getting any touchevents.
Comment 2 Gregg Tavares 2023-09-10 16:36:54 PDT
iOS 16.6.0
Comment 3 Wenson Hsieh 2023-09-11 10:22:33 PDT
Interesting — I'm able to repro on iOS 17 as well. I was actually able to drag the green square on "outer-broken.html" for a brief moment, but it stopped working after scrolling the page a bit more.

This might be related to UIGestureRecognizers on (and under) the web view being in a weird state; I'm unsure what could potentially cause this to happen only in iframes, though. Maybe the event regions are not being computed correctly..
Comment 4 Radar WebKit Bug Importer 2023-09-17 16:21:13 PDT
<rdar://problem/115632722>