Re: [cssom] serialize a CSS declaration block

On Tue, 21 Aug 2012 05:58:04 +0200, Glenn Adams <glenn@skynav.com> wrote:

> 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

This looks reasonable to me, as it is indeed the most common behavior as  
far as I've been able to observe.

  - Florian

Received on Thursday, 23 August 2012 09:11:51 UTC