Bug 234779

Summary: [iOS] background-attachment: fixed should not crop background and ignore sizing properties
Product: WebKit Reporter: Christian Liebel <christian>
Component: CSSAssignee: Nobody <webkit-unassigned>
Status: NEW    
Severity: Normal CC: gsnedders, simon.fraser, thorton, webkit-bug-importer, wenson_hsieh, zalan
Priority: P2 Keywords: InRadar
Version: Safari 15   
Hardware: iPhone / iPad   
OS: iOS 15   
See Also: https://bugs.webkit.org/show_bug.cgi?id=196327
Attachments:
Description Flags
Comparison of background-attachment: fixed (top) and scroll (bottom) on iOS Safari. The "fixed" background is greatly enlarged. none

Christian Liebel
Reported 2022-01-01 02:16:59 PST
Created attachment 448149 [details] Comparison of background-attachment: fixed (top) and scroll (bottom) on iOS Safari. The "fixed" background is greatly enlarged. The CSS property `background-attachment: fixed` is not supported on iOS. Instead, the background scrolls with the page. However, the background is still cropped as if `background-attachment: fixed` would be applied. (I'm not exactly sure to which dimensions the background is cropped. There seems to be a difference if a responsive meta tag was set or not, with the tag set the background image is greatly enlarged. The `background-position` property seems to be ignored, see attachment.) I use this effect to create a parallax effect where the user can reveal the entire background image by scrolling the page, as it works in most browsers including desktop Safari. It's fine for me to fall back to the `scroll` behavior, but therefore the background must not be cropped and the `background-position` and `background-size` properties must be applied. Due to the zooming and because `background-position` is ignored, the current result is hardly usable and I need to detect mobile Safari to explicitly set `background-attachment: scroll` there. In short, as `background-attachment: fixed` is not supported on iOS, it should behave exactly as `scroll` and not take any different code paths. Repro: https://christianliebel.github.io/bg-repro/ Source: https://github.com/christianliebel/bg-repro
Attachments
Comparison of background-attachment: fixed (top) and scroll (bottom) on iOS Safari. The "fixed" background is greatly enlarged. (523.00 KB, image/jpeg)
2022-01-01 02:16 PST, Christian Liebel
no flags
Simon Fraser (smfr)
Comment 1 2022-01-04 10:26:29 PST
Agreed.
Simon Fraser (smfr)
Comment 2 2022-01-04 10:26:50 PST
Also @supports should not lie and claim that it's supported.
Radar WebKit Bug Importer
Comment 3 2022-01-04 10:33:41 PST
Sam Sneddon [:gsnedders]
Comment 4 2022-06-13 10:37:03 PDT
(In reply to Simon Fraser (smfr) from comment #2) > Also @supports should not lie and claim that it's supported. If we fix that, then presumably we'll no longer support the value at parse-time and hence the rest of the issue will be solved because we'll never end up with it as a computed value? Hence this is actually just a dupe of bug 196327?
Note You need to log in before you can comment on or make changes to this bug.