Re: letter-spacing with text-anchor middle

Hi,

 Doug, after rereading the spec umpteen times I came to almost the same
rewrite as you proposed... and was just about to send an email to that
effect (if you had replied earlier, you would have saved me a couple of
hours of work!). You have done two things I was going to propose: split
the section into two parts with bullet points to clearly separate style
sheets from presentation attributes and you removed the sentence:

        "In presentation attributes for all properties, whether defined
        in this specification or in CSS2, the length identifier, if
        specified, must be in lower case."
        
which suggested that the paragraph was talking about both style sheets
and presentation attributes. I would go one more step and delete "and
their corresponding presentation attributes" from that paragraph.

 One thing that confused me in my previous read was Robert's reply to an
earlier email that in a style sheet 'line-width' must have units. As I
read the paragraph I concluded that it either applied only to style
sheets or applied to both style sheets and presentation attributes. In
the former case (which Doug has indicated is correct but conflicts with
Robert's earlier email) font-size requires a unit in style sheets but
not in presentation attributes while stroke-width doesn't require a unit
in either. In the latter case, font-size always requires a unit and
stroke-width requires a unit when defined by a style sheet.

 It seems clear to me now that the SVG standard as it is written does
not require style sheets to use units for SVG only attributes. This is
indicated by the definition of length in the style sheet part:

length ::= number (~"em" | ~"ex" | ~"px" | ~"in" | ~"cm" | ~"mm" | ~"pt"
| ~"pc")?

(note the '?' at the end) and in the style sheet examples in 6.6. Also,
why go to the trouble of stating "For length values in SVG-specific
properties and their corresponding presentation attributes, the length
unit identifier is optional." if it doesn't? If this violates the rules
of CSS then the SVG spec needs to be cleaned up.

 The <angle> entry should also be changed to match Doug's suggested
rewrite of the <length> entry.


      Tav


On Thu, 2010-07-15 at 10:51 -0400, Doug Schepers wrote:
> Hi, Tav-
> 
> Tavmjong Bah wrote (on 7/15/10 9:34 AM):
> >
> > I am confused again!! The<length>  entry in "4.2 Basic data types"
> > states:
> >
> > "For properties defined in CSS2 [CSS2], a length unit identifier must be
> > provided. For length values in SVG-specific properties and their
> > corresponding presentation attributes, the length unit identifier is
> > optional. If not provided, the length value represents a distance in the
> > current user coordinate system. In presentation attributes for all
> > properties, whether defined in this specification or in CSS2, the length
> > identifier, if specified, must be in lower case."
> >
> > My interpretation of this is that since "font-size" is a CSS2 property
> > (see 6.1) it must have a unit regardless of where it is defined while
> > "stroke-width" is an SVG only property so it must have a unit only when
> > defined in a CSS style sheet or the style attribute.
> 
> 
> You're right, this section should be reworded in terms of syntax 
> context.  You're missing the subtle distinction there between properties 
> and attributes, because it's stated too vaguely [1].
> 
> How about something like this (assume a bulleted list for the asterisks)?
> 
> [[
> A length is a distance measurement, given as a number, along with a unit 
> which may be optional. Lengths are specified in one of two ways, 
> depending upon whether they are used in CSS property syntax or SVG 
> presentation attribute syntax:
> 
> * When a <length> is used in a stylesheet or with a property in a 
> 'style' attribute, the syntax must match the following pattern:
> 
>      length ::= number (~"em" | ~"ex" | ~"px" | ~"in" | ~"cm" | ~"mm" | 
> ~"pt" | ~"pc")?
> 
> See the CSS2 specification for the meanings of the unit identifiers.
> 
> For properties defined in CSS2 [CSS2], a length unit identifier must be 
> provided. For length values in SVG-specific properties, the length unit 
> identifier is optional (as with their corresponding presentation 
> attributes). If a unit is not provided, the length value represents a 
> distance in the current user coordinate system.
> 
> * When a <length> is are used in an SVG presentation attribute, unit 
> identifiers may be optional, so the syntax must match the following 
> pattern instead:
> 
>      length ::= number ("em" | "ex" | "px" | "in" | "cm" | "mm" | "pt" | 
> "pc" | "%")?
> 
> The unit identifiers in such <length> values must be in lower case when 
> used in an SVG presentation attribute.
> 
> Note that a percentage unit identifier is allowed in the presentation 
> attribute (non-property) <length> definition. The meaning of a 
> percentage length value depends on the attribute for which the 
> percentage length value has been specified. Two common cases are:
>   (a) when a percentage length value represents a percentage of the 
> viewport width or height (refer to the section that discusses units in 
> general), and
>   (b) when a percentage length value represents a percentage of the 
> bounding box width or height on a given object (refer to the section 
> that describes object bounding box units).
> 
> In the SVG DOM, <length> values are represented using SVGLength or 
> SVGAnimatedLength objects.
> ]]
> 
> Note that there is an outstanding issue for whether SVG-defined 
> properties when used in stylesheets or style attributes must use unit 
> identifiers.  This change glosses over that issue, and simply addresses 
> a clarification for what is already in the SVG spec without changing the 
> intent.
> 
> 
> [1] http://www.w3.org/TR/SVG/types.html#DataTypeLength
> 
> Regards-
> -Doug Schepers
> W3C Team Contact, SVG and WebApps WGs
> 
> 

Received on Thursday, 15 July 2010 15:26:58 UTC