Re: background-intrinsic-004

On Nov 30, 2010, at 5:14 PM, fantasai wrote:

> On 11/24/2010 07:34 AM, Øyvind Stenhaug wrote:
>> http://test.csswg.org/source/contributors/fantasai/submitted/css2.1/backgrounds/background-intrinsic-004.htm
>> (RC version is older and broken in various other ways)
>> 
>> This seems to have mixed up 'width' and 'height' for the .control elements' dimensions.
> 
> Fixed.

I'm confused by this test (which WebKit fails).

The test assertion is "A background image with only an intrinsic ratio covers largest rectangle at that ratio that exceeds neither the height nor width of the background positioning area."

I take this to refer to this sentence under <http://www.w3.org/TR/CSS21/colors.html#background-properties>:

"If the image has no intrinsic dimensions and has an intrinsic ratio the dimensions must be assumed to be the largest dimensions at that ratio such that neither dimension exceeds the dimensions of the rectangle that establishes the coordinate system for the 'background-position'property."

I read that as the background-image being scaled-to-fit, maintaining aspect ratio, into the background-positioning area. And I think <http://www.w3.org/TR/CSS21/colors.html#propdef-background-position> is telling me that the background-positioning area is the padding box.

So the first ".test" has a padding box of 80x100px. green-intrinsic-ratio-portrait.svg has an intrinsic ratio of 4/6. So the SVG will be scaled up with a factor of 16.666667, giving a width of 66.666667. Hence there's a gap down each side, and the red shows through.

Is my analysis flawed, or is the test invalid?

Simon

Received on Wednesday, 1 December 2010 22:38:28 UTC