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

On Wed, 27 Jun 2012 18:40:23 +0200, Simon Fraser <smfr@me.com> wrote:

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

We resolved in favor of this proposal during the telconf yesterday, but
there was one thing I forgot to consider then that annoys me a little
now that I have noticed.

This causes a discontinuity.

div {
  background-image: radial-gradient(ellipse, blue, green, red, yellow);
  width:300px;
  height:300px;
  transition:1s;
  background-attachment:fixed;
}
div:hover{
  transform: rotate(45deg);
}

The background will instantly jump from fixed to scroll when you hover,
and then the transform will gradually take effect.

Given our position that fixed backgrounds are supposed to be used on
the root element, and that we don't care all that much what happens
elsewhere, this may be acceptable. But it still bothers me a little.

  - Florian

Received on Thursday, 28 June 2012 14:01:20 UTC