W3C home > Mailing lists > Public > www-style@w3.org > February 2011

Re: [CSS2.1] list-style-image sizing rules don't match reality

From: Tab Atkins Jr. <jackalmage@gmail.com>
Date: Mon, 14 Feb 2011 09:19:57 -0800
Message-ID: <AANLkTi=mfTn5cf=CKg6_aqtHn4KJur+1MS+geDaUgtOs@mail.gmail.com>
To: Alan Gresley <alan@css-class.com>
Cc: Daniel Holbert <dholbert@cs.stanford.edu>, www-style list <www-style@w3.org>
On Sun, Feb 13, 2011 at 10:20 PM, Alan Gresley <alan@css-class.com> wrote:
> On 14/02/2011 11:21 AM, Tab Atkins Jr. wrote:
>> The values I used in the ellipse
>> are designed specifically to show me the size of the SVG image itself
>> - differing values, particularly static ones, may not exercise the
>> same behavior, and so probably aren't useful here.
>
> A SVG does not have a size, nor intrinsic dimension nor intrinsic ratio if
> the SVG is constructed with percentage values and the SVG does not has
> absolute units for it's rendering area (porthole). A rendering area or
> porthole can not be considered as an intrinsic size.
>
> Not declaring a width on a SVG does not mean that it has no intrinsic width,
> rather it's a dimensionless width. Giving a SVG an absolute height is not
> 'one intrinsic dimension' and not giving a SVG any width does not mean the
> SVG has 'no intrinsic ratio'.

This is incorrect.  SVG documents can certainly have sizes.  That's
what the @width and @height attributes on <svg> are for.

SVG documents can certainly be given a single intrinsic dimension by
setting one of @width or @height, and setting both will give it a
ratio as well.  Alternately, you can give it only a ratio, by ignoring
width/height and setting viewBox and preserveAspectRatio
appropriately.


> What you want to change is this.
>
>
>   3. If the image has no intrinsic ratio and a ratio cannot be
>      calculated from its width and height, then its intrinsic
>      ratio is assumed to be 1:1.
>
>
> For replaced elements [1] is this.
>
>  | For example, a bitmap image has an intrinsic width and an intrinsic
>  | height specified in absolute units (from which the intrinsic ratio
>  | can obviously be determined). On the other hand, other documents
>  | may not have any intrinsic dimensions (for example, a blank HTML
>  | document).
>
>
> A SVG can best be equated to a blank HTML document and insofar it has no
> intrinsic dimensions. So none of the algorithms from point 1 to point 6 for
> ''list-style-image' [2] can apply for SVG.

Incorrect.  SVG used in list-style-image is an image, and the image
sizing rules certainly apply.


> You say is your previous email that "IE9, unfortunately, implements the spec
> here." What do you mean by this and what version of IE9 were you testing in?

I mean that, when given an SVG image with only one dimension set, the
platform preview of IE9 I was using sets the other dimension such that
it has an aspect ratio of 1:1, which is what the spec requires.  The
other two browsers that allow SVG in list-style-image treat them
exactly like they would in any other context, where the missing
dimension is simply set to the available space.


> I have said that IE9 behavior is a bug but not because it is not following
> the spec but more to do with the fact that using the term intrinsic
> dimension or intrinsic ratio when talking about SVG is wrong and has no
> bearing on how intrinsic dimension or intrinsic ratio is understood in
> respect to a SVG. I can possibly presume that you just quickly checked in
> whatever version of IE9 and did not adjust the width of the viewport.
> Anyway, the placement of your <ul> sitting on the left edge of the <body>
> border box would not show any great change in IE9. Try the markup below and
> see what IE9 does when adjusting the width of the viewport.
[snip examples]

No, SVG is treated as an image in the circumstances I am talking about.


> So surely we must test before we go changing a spec that works for a JPEG or
> PNG but has little meaning or interoperability between implementations with
> SVG.

The line that I want to change has absolutely no effect on JPEG, PNG,
or any other raster format.  It is only relevant for vector formats,
of which SVG is the only one that exists on the web.

~TJ
Received on Monday, 14 February 2011 17:20:51 GMT

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