W3C home > Mailing lists > Public > www-svg@w3.org > September 2007

300x150 px defaults too aggressive

From: Jonathan Watt <jwatt@jwatt.org>
Date: Mon, 17 Sep 2007 11:03:59 +0200
Message-ID: <46EE42FF.2030105@jwatt.org>
To: www-svg@w3.org, www-style@w3.org, public-cdf@w3.org

Hi all,

I originally sent the following mail to the private working group lists, but in 
retrospect I should have sent it to the public lists. Resending.

While working on the replaced element code for Mozilla I've come across some
cases where the behavior currently mandated by the CSS 2.1 text is
counterintuitive, and unnecessarily so. Please consider the following case
(contrived for simplicity), where the ’width’ and ’height’ attributes provide
the intrinsic width and height:

   <svg style="width:100%;" width="100%" height="100px"/>

Since the intrinsic and specified widths are both 100%, and the intrinsic height 
is 100px, one might reasonably expect the replaced element to have a used width 
of 100% and a used height of 100px. However, the current CSS 2.1 text says the 
used height must be 150px. (Note the SVG in this example has no intrinsic ratio 
because the ’width’ attribute has a percentage value.)

I would propose that this can be reasonably resolved by adding the following
paragraph to section 10.6.2, just before the paragraph beginning "Otherwise, if
’height’ has a computed value of ’auto’, but none of the conditions above are
met, ...":

   Otherwise, if ’height’ has a computed value of ’auto’, and the
   element has an intrinsic height, then that intrinsic height is
   the used value of ’height’.

The same problem exists for width, which could be resolved by adding the
following paragraph to section 10.3.2, just before the paragraph beginning
"Otherwise, if ’width’ has a computed value of ’auto’, but none of the
conditions above are met, ...":

   Otherwise, if ’width’ has a computed value of ’auto’, and the
   element has an intrinsic width, then that intrinsic width is
   the used value of ’width’.

These changes would allow any intrinsic ratio to take precedence, while still 
giving the result authors would no doubt expect when there is no intrinsic ratio.

Regards,
Jonathan
Received on Monday, 17 September 2007 09:04:14 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 10 December 2014 19:59:27 UTC