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: Florian Rivoal <florianr@opera.com>
Date: Thu, 28 Jun 2012 16:00:40 +0200
To: www-style@w3.org
Message-ID: <op.wgl87egg4p7avi@localhost.localdomain>
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 GMT

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