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

Jonathan,
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
stylesheets.

(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
'font-size'.)

Jon

-----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
change.

Me too. So how about for the sake of its implementors and its users the
SVG WG 
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
issue):

Four SVG-only properties:
   stroke-width
   stroke-dashoffset
   baseline-shift
   kerning

Four CSS properties:
   font
   font-size
   letter-spacing
   word-spacing

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

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

<length>
     ...
<number>
     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
units.)

I'm not sure what to do about the remaining four "generic" CSS
properties. 
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
unit? 
It would solve our backwards compatibility problems with existing
content, and 
since they haven't defined <number> for these properties I assume they
don't 
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
*very* 
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.

Regards,
Jonathan

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