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: Simon Fraser <smfr@me.com>
Date: Wed, 27 Jun 2012 09:55:24 -0700
Cc: www-style list <www-style@w3.org>
Message-id: <DC146BCC-8926-4794-B2BA-ED4FEEE88D5B@me.com>
To: "Tab Atkins Jr." <jackalmage@gmail.com>

On Jun 27, 2012, at 9:54 am, "Tab Atkins Jr." <jackalmage@gmail.com> wrote:

> 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.

My proposal is to reset it to 'scroll' on any transformed elements (transform is not "none") and their descendants, not just 3d-transformed elements.

Simon
Received on Wednesday, 27 June 2012 16:55:58 GMT

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