[cssom] Issues found in the selector serialization algorithm

Serialize A Selector
====================

"2. Otherwise, for each simple selector in the sequence of simple
selectors that is not a universal selector of which the namespace
prefix maps to the null namespace (not in a namespace) or of which the
namespace prefix maps to a namespace that is not the default namespace
serialize the simple selector and append the result to s."
I have absolutely no idea what this is saying.  Even if I did, the
concatenation of clauses is ambiguous.  This needs to be rewritten,
possibly into multiple sentences, to be clearer.  I'd suggest text,
but as I said before, I don't know what it's trying to say.

"3. If this is not the last part of the chain of the selector append a
space (U+0020), followed by the combinator ">", "+", or "~" as
appropriate, followed by another space (U+0020) if the combinator was
not whitespace, to s."
This implies that one must append >, +, or ~.  A slight rewording
would be good here.  "If this is not the last part of the chain of the
slector, append a space to s.  If the combinator linking this part of
the chain and the next is not the universal combinator, append a ">",
"+", or "~" as appropriate, followed by another space (U+0020), to s."

"4. If this is the last part of the chain of the selector and there is
a pseudo-element, append "::" followed by the name of the
pseudo-class, to s."
should be "followed by the name of the pseudo-element".

Serialize a Simple Selector
===========================

"4. If this is a universal selector append "* (U+002A) to s. "
Missing a " after the *.

"4. If a is one or minus one and b is zero let the value be "n" (U+006E)."
(This critique also applies to line #5.)  :nth-child(-n) doesn't
represent the same thing as :nth-child(n).  Namely, the former
represents *no* elements.  I know that Selectors says otherwise.  It
directly contradicts itself slightly further down, when it says "The
value a can be negative, but only...".  The last example in the spec,
:nth-child(-n+6), is explicitly given as representing something
different from :nth-child(n+6).

Received on Wednesday, 14 April 2010 17:56:18 UTC