Re: [whatwg] Web Forms 2 Repetition Model-please reinstate on specification

On 9/22/11 8:05 AM, Dr. Olaf Hoffmann wrote:
> a) Even if img gets a width property with CSS and attributeType is set to CSS,
> this is not animated.

"width" and "height" seem to be generally flagged as not animatable as 
CSS properties; this is not HTML-specific.

I filed https://bugzilla.mozilla.org/show_bug.cgi?id=688430 on that.

> b) The image seems to move a little bit to the right within the animation of
> the width.

This behavior is correct.  The image reference rectangle is being 
animated from width 0 to width 250, all at a height of 235.  The 
intrinsic size of the image is 240 x 235.  The default value of 
preserveAspectRatio is "xMidYMid", and is the value relevant here.

So when the reference rectangle width is less than 240, the image will 
be placed at the left edge of the reference rectangle and will have the 
same width as it, while the height will be smaller and the image will be 
centered vertically.  Which is exactly what you observe.

When the width of the reference rectangle is greater than 240, the image 
height will be 235 and the width will be 240; it will then be centered 
horizontally in the reference rectangle.  At animation end, the 
reference rectangle width is 250 and the image is therefore placed 5px 
from the left of the reference rectangle.  This explains the 5px gap you 
see "suddenly" appear toward the end of the animation.

Mismatch between intrinsic widths and widths specified in the document 
strikes again.

-Boris

Received on Thursday, 22 September 2011 13:29:26 UTC