[cssom] serialize a CSS declaration block

I've taken a stab at specifying [1] the top-level algorithm for serializing
a CSS declaration block, i.e., at what is returned by
CSSStyleDeclaration.cssText. The way I have approached it is to tie the
result to the the process of enumerating item() and invoking
getPropertyValue() for each item. IMO, this seems the most logically
correct approach [in the sense that item() should return the name of every
property (and only those properties) returned in the serialization via
cssText].

I've also encoded the delimiter and whitspace rules that seem to be most
common; namely, that each declaration except the last is followed by "; "
and the last is followed by ";" (with no extra whitespace).

Comments please!

[1]
http://dvcs.w3.org/hg/csswg/raw-file/tip/cssom/Overview.html#serialize-a-css-declaration-block

Received on Tuesday, 21 August 2012 03:58:56 UTC