Re: [selectors-nonelement] ::attr(*|localname), ::attr(ns|*), and ::attr(*)

On Mon, 24 Feb 2014 14:32:03 +0100, Jirka Kosek <jirka@kosek.cz> wrote:

> On 24.2.2014 14:01, Simon Pieters wrote:
>> I'm not Tab but I think the reasoning is as follows:
>>
>> * and foo are equivalent for the namespace part, i.e. same as *|* and
>> *|foo or ns|* and ns|foo
>>
>> hence
>>
>> ::attr(*) and ::attr(foo) should also be equivalent for the namespace
>> part, i.e. same as ::attr(|*) and ::attr(|foo)
>
> Aha, so it seems that the following text is ambiguous:
>
> "If the prefix is omitted, the selector only matches attributes in no
> namespace."
>
> because it is not clear whether prefix means "ns" or "ns|". Then
> rewriting grammar into more rules could help:
>
>  <namespace-attr> = [ <prefix>? '|' ]? [ <ident> | '*' ]
>  <prefix>         = [ <ident> | '*' ]
>
> Now it is clear that prefix is meant without | and  thus ::attr(foo) and
> ::attr(|foo) are different -- former select all foo attributes in any
> (including no) namespace and later only in no namespace.

::attr(foo) selecting all foo attributes in any namespace would be  
inconsistent with the selector [foo] which selects elements with a foo  
attribute in no namespace.

> Which I think is behaviour user would expect and it is consistent with
> differences when applying default namespace to elements and attributes.
>
>     Jirka
>


-- 
Simon Pieters
Opera Software

Received on Monday, 24 February 2014 13:47:56 UTC