W3C home > Mailing lists > Public > www-style@w3.org > June 2012

[css3-syntax] stroke-dasharray unit less values

From: Dirk Schulze <dschulze@adobe.com>
Date: Sat, 9 Jun 2012 17:42:11 -0700
To: "www-style@w3.org list" <www-style@w3.org>, "www-svg@w3.org list" <www-svg@w3.org>
Message-ID: <2C056E61-E9F5-4581-BC60-4242EC659420@adobe.com>
Hi,

As far as I understood the intention of the new CSS3 syntax module[1] after the last discussions, it tries to define the syntax in general - even for SVG presentation attributes. I have a very specific question to certain CSS properties that just exist for SVG at the moment. One of the most important is 'stroke-dasharray'[2].

'stroke-dasharray' takes the value <dasharray>. "<dasharray> contains a list of comma and/or white space separated <length>s and <percentage>s that specify the lengths of alternating dashes and gaps."

So 'stroke-dasharray' uses either <length>s or <percentage>s. Like discussed before, values can be unit less for presentation attributes. However, for this property even the CSS style takes unit less values for all current UAs:

<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
  <rect x="100" y="100" width="100" height="100" style="stroke:black;fill:none;stroke-dasharray:2 2;"/>
</svg>

This example uses a dash array with unit less values for the inline style. According to the current CSS rules, it should be invalid but works on all UAs. Looking at the source code of WebKit, the following further properties have the same behavior 'kerning' (removed from SVG2) and 'baseline-shift'. Does the CSS3 Syntax take this into account already? Is it possible to allow <number> for these properties as well, to specify the current behavior of UAs (might be against the rules according to CSS2.1 as well)?

Greetings,
Dirk

[1] http://dev.w3.org/csswg/css3-syntax/
[2] http://www.w3.org/TR/SVG/painting.html#StrokeProperties
Received on Sunday, 10 June 2012 00:42:46 GMT

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