Re: [SVGMobile12] uDOM attribute normalization on color values

Hello www-svg,

Anne van Kesteren <fora@annevankesteren.nl> wrote:
> In
> <http://www.w3.org/TR/2005/WD-SVGMobile12-20051207/svgudom.html#Attribute_Normalization>
> it is defined what viewers may return for attribute values. The color
> normalization part does not define in enough detail what exactly may be
> returned for sRGB values

The intent is not to standardize a lexical form. If people want access
to the color values without doing their own microparsing, they already
have trait access which gives the color values directly:

interface SVGRGBColor
{
        attribute unsigned long red;
        attribute unsigned long green;
        attribute unsigned long blue;
};

>  as described in
> <http://www.w3.org/TR/2005/WD-SVGMobile12-20051207/painting.html#colorSyntax>.
> What is the normalized value of "rgb(100,      30,32,123)"?

Well, that particular one is an unsupported value so would be ignored
anyway :)

> The section also doesn't address the problem. It is still unclear what you get
> back when you retrieve such a value. When using getAttributeNS that is what you
> can expect, but when using traits it should be more clear.

Trait access looks very clear.

> I suggest that the SVG WG defines color normalization in a way similar to
> <http://whatwg.org/specs/web-apps/current-work/#fillstyle> (dropping the rgba()
> bit that doesn't apply to SVG).

That would not work well. It tries to standardize a single lexical form
(which still has to be parsed) and fails to pick the most precise lexical
form so will always produce round-off error even if normalization is not
used.

> In addition, I suggest that the SVG WG contacts the CSS WG about this
> to discuss normalization of these property/attribute values together
> so a common syntax can be agreed upon and used.

SVG, like CSS 2.1, states that the computed value is the specified
color. CSS does not address color normalization at all.

-- 
 Chris Lilley                    mailto:chris@w3.org
 Interaction Domain Leader
 Co-Chair, W3C SVG Working Group
 W3C Graphics Activity Lead
 Co-Chair, W3C Hypertext CG

Received on Friday, 9 June 2006 14:01:30 UTC