W3C home > Mailing lists > Public > www-svg@w3.org > January 2006

RE: Proposal for unitless lengths (Was: Is the px unit equivalent to user units?)

From: Jon Ferraiolo <jonf@adobe.com>
Date: Wed, 4 Jan 2006 12:06:31 -0800
Message-ID: <6ECA24BE410D994496A2AE995367C5C85761B2@namail3.corp.adobe.com>
To: "Jonathan Watt" <jonathan.watt@strath.ac.uk>, <www-svg@w3.org>, "Dean Jackson" <dino@w3.org>
Cc: "Chris Lilley" <chris@w3.org>

Thanks for the proposal!

(1) One key thing to keep in mind is that there is high desirability to
have a single stylesheet engine which knows how to deal with 'font',
'font-size', 'letter-spacing' and 'word-spacing' on a universal basis.
(2) Under the latest proposals, SVG Full would only support <number>
within attributes and only support <length> within stylesheets. I assume
that Tiny would only support <number> since it does not support

(3) I do not think that it is a requirement (and probably would not get
approval from the CSS WG) that the CSS WG change the definition of
'font', 'font-size', 'letter-spacing' and 'word-spacing' to permit
numbers versus lengths. However, the SVG Full spec might add the
<number> option in its definitions of these properties and state that
<number> is only available in attribute values and not within
stylesheets. (The Tiny spec would not show the <length> option for


-----Original Message-----
From: www-svg-request@w3.org [mailto:www-svg-request@w3.org] On Behalf
Of Jonathan Watt
Sent: Wednesday, January 04, 2006 10:54 AM
To: www-svg@w3.org; Dean Jackson
Cc: Chris Lilley
Subject: Proposal for unitless lengths (Was: Is the px unit equivalent
to user units?)

Dean Jackson wrote:
> If we can have a solution where authors get to use stroke-width="4" in

> XML content and are required to use "{stroke-width: 4px}" in 
> stylesheets, then I'm happy. I would be happier if CSS hadn't required

> units on <length>s, but I have a sneaking suspicion that that won't

Me too. So how about for the sake of its implementors and its users the
be the one to back down in this case. This issue has gone on way too
long, and 
it is SVG users that are being hurt, not the CSS-in-HTML crowd.

I'm not entirely happy about having to use units in CSS, but assuming
we're the 
ones to back down, I propose that the SVG WG change some of the
properties to 
accept a <number> as well as a <length>. There are eight properties
relevant to 
SVG that can currently take a <length> (and thus are affected by this

Four SVG-only properties:

Four CSS properties:

The SVG-only properties could be changed to allow <number> and define
the value 
to act in user units. Something like:

     Value:        <length> | <number> | inherit
     Initial:      1
     Applies to:   shapes and text content elements
     Inherited:    yes
     Percentages:  Yes
     Media:        visual
     Animatable:   yes

     Acts as if a unit of 'px' had been specified (i.e. the value is in
     user units).

(That text of course assumes that px IS always equivalent to user

I'm not sure what to do about the remaining four "generic" CSS
Perhaps a request to the CSS WG that they also allow <number> for those 
properties and define them to behave as if 'px' had been provided as the
It would solve our backwards compatibility problems with existing
content, and 
since they haven't defined <number> for these properties I assume they
have a use in mind for it and never will.

Anyway, regardless of the response of the CSS WG to that request, I
think that 
removing the problem from the four SVG specific properties would be
beneficial and worthwhile. It is a *lot* easier for users to remember
the names 
of four generic CSS properties to which they must add 'px' than it is to

remember the names of a mixture of eight CSS and SVG properties. It
would also 
allow some of the content that is currently a problem to work in UAs
that put a 
higher priority on CSS than SVG conformance.

Received on Wednesday, 4 January 2006 20:05:08 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 8 March 2017 09:47:06 UTC