Bug 218533 - Toggling pointer-events on body does not re-enable scrolling on child
Summary: Toggling pointer-events on body does not re-enable scrolling on child
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: UI Events (show other bugs)
Version: Safari 14
Hardware: iPhone / iPad Unspecified
: P2 Normal
Assignee: Devin Rousso
URL:
Keywords: InRadar
Depends on: 219441
Blocks:
  Show dependency treegraph
 
Reported: 2020-11-03 13:37 PST by Liam DeBeasi
Modified: 2021-04-06 20:18 PDT (History)
14 users (show)

See Also:


Attachments
Code Reproduction (3.52 KB, text/html)
2020-11-03 13:37 PST, Liam DeBeasi
no flags Details
Patch (2.94 KB, patch)
2020-11-19 03:37 PST, Devin Rousso
simon.fraser: review-
drousso: commit-queue-
Details | Formatted Diff | Diff
Patch (7.26 KB, patch)
2020-12-01 16:00 PST, Devin Rousso
no flags Details | Formatted Diff | Diff
Patch (8.38 KB, patch)
2020-12-14 16:46 PST, 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 Liam DeBeasi 2020-11-03 13:37:29 PST
Created attachment 413103 [details]
Code Reproduction

Setting `pointer-events: none` on the body and then removing it does not re-enable scrolling on descendent scrollable elements.

Steps to Reproduce:

1. Open attached code reproduction on an iPhone running iOS 14.0 or newer.
2. Verify that you can scroll the page.
3. Tap the "Tap to Disable Scrolling" button. Verify that you can no longer scroll the page. This adds `pointer-events: none` to the body.
4. After 3000ms `pointer-events: none` will be removed from the body. At this point, you should not be able to scroll, even though `pointer-events: none` has been removed.
5. Tap the "Tap me to fix scrolling" button. After doing this, you should be able to scroll again.


Expected Behavior:

After removing `pointer-events: none` from the body, I would expect to be able to scroll again.


Actual Behavior:

After removing `pointer-events: none` from the body, I am unable to scroll.


Additional Information:

* I had opened a similar issue for iOS 12.2, but that bug went away with iOS 13.0: https://bugs.webkit.org/show_bug.cgi?id=195801.
* This was tested on an iPhone 11 running iOS 14.2, but I can reproduce it on iOS 14.0.1 and iOS 14.1 as well.
* I cannot reproduce this on iOS 13.6.
* I cannot reproduce this on Safari for macOS.
Comment 1 Radar WebKit Bug Importer 2020-11-03 13:48:46 PST
<rdar://problem/71009746>
Comment 2 Simon Fraser (smfr) 2020-11-03 14:05:43 PST
Need to check to see if we correctly regenerate the event regions.
Comment 3 Devin Rousso 2020-11-19 03:37:22 PST
Created attachment 414561 [details]
Patch

I'd love to have a way to test this.  Uploading to EWS to see if any existing tests have issues (and therefore might be able to be used to derive my own test).
Comment 4 Antoine Quint 2020-11-19 04:59:58 PST
Can you not write a test that scrolls and check whether scrolling occurred? You can take a look at LayoutTests/pointerevents tests which, although testing a different feature, will likely show examples of that.
Comment 5 Devin Rousso 2020-11-19 05:15:22 PST
(In reply to Antoine Quint from comment #4)
> Can you not write a test that scrolls and check whether scrolling occurred? You can take a look at LayoutTests/pointerevents tests which, although testing a different feature, will likely show examples of that.
Oh nice!  I was going to ask someone about this tomorrow.  Thanks! :)

FYI I marked it as cq- because it did not have tests.  I should've said "I don't know how to write a test for this." instead in comment #3.
Comment 6 Simon Fraser (smfr) 2020-11-19 09:42:35 PST
Comment on attachment 414561 [details]
Patch

Needs a test. See fast/scrolling/ios/body-overflow-hidden.html for an example of how to test scrolling
Comment 7 Devin Rousso 2020-12-01 16:00:06 PST
Created attachment 415173 [details]
Patch
Comment 8 EWS 2020-12-01 19:36:00 PST
Committed r270339: <https://trac.webkit.org/changeset/270339>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 415173 [details].
Comment 9 Simon Fraser (smfr) 2020-12-02 08:29:16 PST
The test is failing in EWS
Comment 10 Truitt Savell 2020-12-02 10:42:05 PST
The new test fast/scrolling/ios/overflow-scroll-pointer-events.html
is timing out on iOS constantly.

History:
https://results.webkit.org/?suite=layout-tests&test=fast%2Fscrolling%2Fios%2Foverflow-scroll-pointer-events.html
Comment 11 WebKit Commit Bot 2020-12-02 11:03:19 PST
Re-opened since this is blocked by bug 219441
Comment 12 Truitt Savell 2020-12-02 12:16:34 PST
Reverted r270339 for reason:

introduced a constantly failing test.

Committed r270363: <https://trac.webkit.org/changeset/270363>
Comment 13 Devin Rousso 2020-12-14 16:46:47 PST
Created attachment 416209 [details]
Patch

improved test to not fail :)
Comment 14 EWS 2020-12-15 10:01:23 PST
Committed r270849: <https://trac.webkit.org/changeset/270849>

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