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

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

Simon

Received on Wednesday, 27 June 2012 16:40:58 UTC