Re: [cssom] serialization of type selectors with namespaces

On 6/8/13 8:08 AM, L. David Baron wrote:
> http://dev.w3.org/csswg/cssom/#serializing-selectors says:
>    # 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.
>
> This isn't quite right, because it says to skip universal selectors
> that are semantically relevant.  For example, given the style sheet:
>
>    @namespace "http://www.w3.org/1999/xhtml";
>    @namespace nons "";
>    nons|*:hover { color: blue } /* selector #1 */
>    |*:active { color: green }   /* selector #2 */
>
> it says that selector #1 should be serialized as ":hover", and
> possibly the same (though I think the wording is ambiguous, since
> there is no namespace prefix, but the lack of namespace prefix
> indeed maps to the null namespace) for selector #2.  However, in
> both cases, :hover is semantically different, since ":hover" alone,
> given the default namespace, matches any elements in the HTML
> namespace that are in the :hover state.
>
> I think the words "of which the namespace prefix maps to the null
> namespace (not in a namespace) or" should be removed.  Universal
> selectors can be omitted only when their namespace part is the
> default namespace.
>
> -David
>
https://dvcs.w3.org/hg/csswg/rev/cb1f73f890eb

I also fixed [|foo] to serialize as [foo] since that's equivalent.

(My previous reply in this thread was replying to the wrong message. 
Sorry about that.)

-- 
Simon Pieters
Opera Software

Received on Thursday, 13 June 2013 09:54:15 UTC