RESOLVED FIXED 245300
REGRESSION (251454@main): Setting scrollTop on fixed element with overflow breaks scrolling on a 'overscroll-behavior:none' page
https://bugs.webkit.org/show_bug.cgi?id=245300
Summary REGRESSION (251454@main): Setting scrollTop on fixed element with overflow br...
Jack Doyle
Reported 2022-09-16 14:04:00 PDT
Here's an isolated demo: https://codepen.io/GreenSock/pen/YzLZVOz Notice that if you set overscrollBehavior on the body/html and then set the scrollTop of a position: fixed element, suddenly it becomes impossible to scroll the page at all in Safari 16! It's a pretty show-stopping behavior. If you set the position back to absolute before setting scrollTop and then switch it back to position fixed, that seems to work. Obviously that shouldn't be necessary.
Attachments
Reduced testcase (909 bytes, text/html)
2022-09-16 14:27 PDT, Simon Fraser (smfr)
no flags
Simon Fraser (smfr)
Comment 1 2022-09-16 14:27:21 PDT
Created attachment 462405 [details] Reduced testcase The overflow:hidden position:fixed intercepts scrolling (you can still scroll the page when the cursor is outside it).
Jack Doyle
Comment 2 2022-09-16 15:17:04 PDT
Are you saying you think this is the correct behavior? It definitely seems way wrong to me, and no other browser behaves this way. Also, once it's "stuck" and then you drag the scrollbar a bit, it becomes "unstuck" so your explanation about intercepting the scroll seems inconsistent at best. Or am I missing something?
Simon Fraser (smfr)
Comment 3 2022-09-16 15:41:26 PDT
No, it's a bug, but your testcase was a little misleading because your fixed element covers the entire viewport. The page is scrollable if your cursor isn't over the position:fixed.
Simon Fraser (smfr)
Comment 4 2022-09-16 15:41:48 PDT
The position:fixed is "trapping" the wheel events incorrectly.
Jack Doyle
Comment 5 2022-09-16 15:46:33 PDT
I see. Yeah, I need the full-screen position: fixed element in my use case. Thanks for looking into this.
Simon Fraser (smfr)
Comment 6 2022-09-16 21:27:24 PDT
This happens as a result of adding the overflow's ScrollableArea to the FrameView's scrollable area set, which means we add it to the non-fast scrollable region in ScrollingCoordinator::absoluteEventTrackingRegionsForFrame(). This is fallout from 251454@main.
Radar WebKit Bug Importer
Comment 7 2022-09-16 21:27:49 PDT
Nikos Mouchtaris
Comment 8 2022-09-28 15:55:42 PDT
EWS
Comment 9 2022-12-09 19:47:30 PST
Committed 257665@main (b08436732d9d): <https://commits.webkit.org/257665@main> Reviewed commits have been landed. Closing PR #4810 and removing active labels.
Note You need to log in before you can comment on or make changes to this bug.