Bug 179379 - scroll-padding should affect scrollIntoView, paging etc even when snapping is off
Summary: scroll-padding should affect scrollIntoView, paging etc even when snapping is...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Scrolling (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords: BrowserCompat, InRadar
: 219072 (view as bug list)
Depends on: 219073 219074
Blocks: 218115
  Show dependency treegraph
 
Reported: 2017-11-07 10:49 PST by Simon Fraser (smfr)
Modified: 2021-03-12 17:32 PST (History)
14 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Simon Fraser (smfr) 2017-11-07 10:49:07 PST
See https://drafts.csswg.org/css-scroll-snap/#scroll-padding
Comment 1 Radar WebKit Bug Importer 2020-04-16 18:52:02 PDT
<rdar://problem/61915456>
Comment 2 Diane Ko 2020-07-30 15:24:57 PDT
From the CSS spec definition for scroll-padding (https://www.w3.org/TR/css-scroll-snap-1/#scroll-padding), scroll-padding should apply to any scroll container, not just scroll snap containers. This issue is particularly problematic when using scroll-padding to adjust for any fixed content (for example, a fixed header or footer). 

This behavior exists on both iOS and macOS Safari, but not on Chrome or Firefox.

Note: this is particularly problematic when using iOS with VoiceOver on, as VoiceOver will trigger tapping on the location where its focus is, which means that if you're focused on an element that's underneath a fixed container, the click event will trigger on the fixed container and not the element that gets read out as having focus. As this issue isn't a problem in Chrome, I was able to successfully avoid this issue on an Android device with TalkBack enabled.

I created a really basic codepen (https://codepen.io/backwardok/pen/6980c6068b69618a90bd5b12716dde8b) that demonstrates this problem (full page version: https://cdpn.io/backwardok/debug/6980c6068b69618a90bd5b12716dde8b).
Comment 3 Simon Fraser (smfr) 2020-07-30 15:36:48 PDT
Thanks for the testcase!
Comment 4 Simon Fraser (smfr) 2020-12-16 17:06:49 PST
Martin, can we consider this fixed?
Comment 5 Martin Robinson 2020-12-17 04:18:37 PST
The main blocker here is to implement the part of scroll-padding that affects scrolling area paging behavior. I don't think this should be a lot of work, but I've been dragging my feet a bit here.
Comment 6 Matt Ryan 2021-01-14 13:15:21 PST
This is a major blocker to site authors implementing sticky-position banners; there is seemingly no alternative that works across the various use cases out there; for example, a common CSS approach (negatively absolute positioned generated content) does not work if the fragment refers to a replaced element like an <input>. And Safari is the only major browser that does not properly support this feature.

I'm hoping this comment can serve as a +1 on prioritizing this bug.
Comment 7 Martin Robinson 2021-02-12 03:04:26 PST
*** Bug 219072 has been marked as a duplicate of this bug. ***