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

On Wed, 19 Feb 2014 08:56:41 +0100, Jirka Kosek <jirka@kosek.cz> wrote:

> On 19.2.2014 1:43, Tab Atkins Jr. wrote:
>>>> If the prefix is omitted, the selector only matches attributes in no
>>>> namespace.
>>>
>>> … which applies to both ::attr(foo) and ::attr(*)
>>>
>>> I like the consistency, but it means that "give me all the things"  
>>> must be
>>> written ::attr(*|*) rather than just ::attr(*), which doesn’t seem to  
>>> be
>>> what Jirka wanted.
>>
>> That's consistent with what Selectors does for type selectors, though.
>>  I'd be extremely loathe to break that consistency.
>
> I'm not sure with what you are trying to be consistent, if with the
> following from the Selectors:
>
> "*
> if no default namespace has been specified, this is equivalent to *|*.
> Otherwise it is equivalent to ns|* where ns is the default namespace."
>
> Then I have to point out that default namespace does not apply to
> attributes, so it doesn't make sense to align * behaviour for attributes
> with elements.
>
> Or had you in mind something different?

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)

-- 
Simon Pieters
Opera Software

Received on Monday, 24 February 2014 13:02:28 UTC