W3C home > Mailing lists > Public > www-style@w3.org > August 2012

[cssom] serialize a CSS declaration block

From: Glenn Adams <glenn@skynav.com>
Date: Tue, 21 Aug 2012 11:58:04 +0800
Message-ID: <CACQ=j+fJV1aPaE0SEeX86wy4F4UC9dVf2qZ5=-OyLHAE867BoQ@mail.gmail.com>
To: W3C Style <www-style@w3.org>
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 GMT

This archive was generated by hypermail 2.3.1 : Tuesday, 26 March 2013 17:20:58 GMT