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

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 UTC