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

On Mon, Feb 24, 2014 at 5:01 AM, Simon Pieters <simonp@opera.com> wrote:
> 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)

Nah, I got it wrong with Selectors.  In a type selector, "*" is
equivalent to "*|*" if there's no default namespace set; otherwise
it's equivalent to "ns|*".  I *thought* it was equivalent to "|*", but
I was wrong.

So yeah, Jirka's right, ::attr(*) should be equivalent to ::attr(*|*)
in the absence of a default namespace.

~TJ

Received on Monday, 24 February 2014 21:14:23 UTC