RE: Request For Feedback: Traits

Regarding the possibility of a getLengthTrait() in SVG Full 1.2:

Let's leave the width/height attributes on the 'root' SVG element out of
the discussion for awhile because that's a special case.

Looking forward to SVG Full, for all other lengths in the SVG language,
it probably would not be very useful to offer a getLengthTrait[NS]
method. The philosophy behind the trait getters is that they return the
normalized computed values rather than the specified
values(http://www.w3.org/TR/SVGMobile12/svgudom.html#Attribute_Access):

----------
An important difference between getTraitNS (and all other variants of
getTrait methods) and getAttributeNS is that getTraitNS returns the
computed attribute value but getAttributeNS returns the specified
attribute value (witch might not exactly match the original specified
value due to the possibility of user agent value normalization as
described in Attribute Normalization). 
----------

The underlying philosophy is that:

(a) for script writers, specified values are much more interesting for
setters and much less interesting for getters

(b) for implementers, SVG UAs often want to store normalized attribute
values (e.g., after collapsing out any unit specfiers) rather than
specified values in order to reduce memory requirements and deliver
optimal performance

Jon

-----Original Message-----
From: www-svg-request@w3.org [mailto:www-svg-request@w3.org] On Behalf
Of Cameron McCormack
Sent: Wednesday, January 04, 2006 3:54 PM
To: www-svg@w3.org
Subject: Re: Request For Feedback: Traits


Bjoern Hoehrmann:
> http://www.w3.org/TR/2005/WD-SVGMobile12-20051207/svgudom.html
> 
>   If the width is specified as a percentage or unit value (only
>   possible for the 'svg' 'width'), a DOMException with error code
>   TYPE_MISMATCH_ERR is raised since the requested trait's computed
>   value cannot be converted to a float.
> 
> It does not discuss 'x' attributes with unit identifiers since those
are
> not allowed in SVG Tiny 1.2, though I see no reason to expect this to
be
> different in SVG 1.2 "Full".

I see.  Perhaps a getLengthTrait is required for these cases, or
conversion to a float could be defined as just converting to user units.
This wouldn't necessarily work for the root 'svg' element, since it
might depend on the context in which it is being rendered.  It's hard to
review some things without knowing how they will be handled in Full.

-- 
 Cameron McCormack			ICQ: 26955922
 cam (at) mcc.id.au			MSN: cam (at) mcc.id.au
 http://mcc.id.au/			JBR: heycam (at) jabber.org

Received on Thursday, 5 January 2006 00:37:11 UTC