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

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 UTC