W3C home > Mailing lists > Public > www-style@w3.org > May 2012

Re: [css3-transforms] Effect of CSS transforms on scrollable areas

From: Simon Fraser <smfr@me.com>
Date: Thu, 31 May 2012 13:42:04 -0700
Cc: www-style@w3.org
Message-id: <8CD51D70-E115-4F49-B39D-1B64C04AAC4C@me.com>
To: Boris Zbarsky <bzbarsky@MIT.EDU>
On May 31, 2012, at 11:33 AM, Boris Zbarsky wrote:

> On 5/31/12 2:07 PM, Rik Cabanier wrote:
>> What if you want to animate an element in from a side? Wouldn't you
>> think it's annoying if you get scroll bars while it's not completely on
>> the screen?
> 
> The current WebKit behavior I see on MAc is to show the scrollbars during the entire animation, including after the element is completely on the screen, as if the element were at its original off-screen position.
> 
> So what you actually want here is not for the scrollable area to not be affected by the animation; you want it to not be affected by the object in question, period.

WebKit on some platforms (Mac, iOS) tries to avoid doing layout for every step of a transform animation (it's actually rendering the animation off on another thread). This was a conscious design decision done for performance reasons; there's no way we'd get the smooth animation performance that we're renowned for if we had to do layout every frame.

This optimization does become visible if the animating thing is inside overflow:scroll. Also, if something else forces layout (like offsetWidth/getBoundingClientsRects etc), then layout will occur and scrollbars will be updated.

I don't feel strongly about whether this should be described in the spec.

Simon
Received on Thursday, 31 May 2012 20:42:33 GMT

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