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

Jonathan Watt wrote:
> 
> 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.

It seems that what I was agreeing to wasn't clear. To clarify, I was agreeing 
with the last sentence; in other words that the CSS WG won't allow unitless 
<length>. My agreement was not with being happy with requiring "{stroke-width: 
4px}", because my proposal would allow "{stroke-width: 4}" of course.

> 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 Friday, 6 January 2006 19:17:44 UTC