[Webkit-unassigned] [Bug 234779] New: [iOS] background-attachment: fixed should not crop background and ignore sizing properties

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Sat Jan 1 02:16:59 PST 2022


            Bug ID: 234779
           Summary: [iOS] background-attachment: fixed should not crop
                    background and ignore sizing properties
           Product: WebKit
           Version: Safari 15
          Hardware: iPhone / iPad
                OS: iOS 15
            Status: NEW
          Severity: Normal
          Priority: P2
         Component: CSS
          Assignee: webkit-unassigned at lists.webkit.org
          Reporter: christian at liebel.org

Created attachment 448149

  --> https://bugs.webkit.org/attachment.cgi?id=448149&action=review

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

You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20220101/45862f59/attachment.htm>

More information about the webkit-unassigned mailing list