W3C home > Mailing lists > Public > www-svg@w3.org > September 2000

Re: CSS level errors.

From: Blaine Brodie <bbrodie@savagesoftware.com>
Date: Fri, 01 Sep 2000 18:11:57 -0700
Message-id: <fc.0085846d0000ffa80085846d0000f3e3.10015@savagesoftware.com>
To: www-svg@w3.org, jferraio@Adobe.COM
>3) What other exceptions are you thinking of regarding 'colorProfile'? It 
>is just a string. The only thing that can go wrong is that the string 
>doesn't match any previously defined profiles, in which case the ICC
>specification should be ignored and the sRGB used instead.
Hello Jon,

Looking at the CSS OM portion of the DOM specification (ex.
CSSStyleDeclaration, CSSValue, RGBColor, etc.) it seems that the intent of
these interfaces is to provide the user with object oriented access to CSS
elements, as well as provide a level of protection against setting values
that do not conform to the underlying grammar.  For example, the
setCssText method of the CSSValue interface throws an exception if the
string does not conform to the underlying grammar for that specific
property.   So, if users sticks to DOM level interfaces for CSS element
modification, then it is not possible for them to set illegal values.
However, the user can set illegal values when using the SVG DOM's CSS
interfaces (i.e. SVGPaint, SVGColor and SVGICCColor).
Ex.  Assume I have a SVGColor named 'color' which is in the context of a
'lighting-color' property.  The following commands would throw exceptions:
	color.setCssText("rgb(0,0,0) icc-color(somename, )"); //invalid
icccolorvalue list
	color.setCssText("rgb(0,0,0) icc-color($, 0, 0, 0, 0)"); //invalid <name>
since <name>  <=> {[a-z0-9-] | {nonascii} | {escape}}+
However, the following commands at the SVG DOM Level would not throw any
exceptions and the document's 'light-color' property would contain an
illegal value:
  	color.getIccColor.getColors().clear(); //no longer conforms to
"icc-color( <name> <, icccolorvalue>+)";
	color.getIccColor.setColorProfile("$"); //'$' is a valid DOMString value,
but not a valid <name> value;
Looking at the CSS specification, 
http://www.w3.org/TR/REC-CSS2/syndata.html#parsing-errors , user agents
should ignore the entire color or paint property if commands similar to
the previous were applied.  But, is it better to protect the user from
these type of occurrences at both the DOM and SVG DOM level (at least for
the CSS OM portion)?
Received on Friday, 1 September 2000 21:12:02 GMT

This archive was generated by hypermail 2.3.1 : Friday, 8 March 2013 15:54:19 GMT