W3C home > Mailing lists > Public > www-style@w3.org > June 2012

Re: [css3-transforms] Proposal for behavior of background-attachment:fixed inside transformed elements

From: Tab Atkins Jr. <jackalmage@gmail.com>
Date: Wed, 27 Jun 2012 09:54:02 -0700
Message-ID: <CAAWBYDAVf3bbDz1NSBSphRLer_NW-NZ3=EmXaV+ZAk7YaERBHg@mail.gmail.com>
To: Simon Fraser <smfr@me.com>
Cc: www-style list <www-style@w3.org>
On Wed, Jun 27, 2012 at 9:40 AM, Simon Fraser <smfr@me.com> wrote:
> <https://www.w3.org/Bugs/Public/show_bug.cgi?id=17521> notes an issue with background-attachment:fixed inside transformed elements.
>
> The spec currently says that transformed elements behave like a "porthole" through which the fixed background is visible, so as the transformed element moves around or its transform changes, the background appears to remain stationary. This is extremely difficult for some UAs to render, particularly with 3D transforms.
>
> David Baron suggested that the backgrounds are rendered as if there are no transforms, then the transforms applied. This would cause surprising behavior in some cases; for example, on an element with a 90deg rotation and a fixed background, the background would move sideways when scrolling vertically.
>
> I have an alternative proposal: background-attachment:fixed behaves like background-attachment:scroll (the default) on any element that has a transform, or has an ancestor with a transform. This results in the background scrolling with the element, which is less surprising to authors for transformed elements, simple for UAs to implement, and allows UAs to do efficient scrolling (avoiding repaints) in more cases.
>
> Any objections?

I kind of like the effect that you could potentially get by having a
2d-transformed element still being a porthole (with the background
still fixed relative to the root, and not transformed), but losing it
wouldn't kill me.

I'm fine with it resetting to 'scroll' on 3d-transformed elements.

~TJ
Received on Wednesday, 27 June 2012 16:54:53 GMT

This archive was generated by hypermail 2.3.1 : Tuesday, 26 March 2013 17:20:55 GMT