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

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

> On 24.2.2014 14:47, Simon Pieters wrote:
>> ::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.
>
> Well, then I think that it makes sense to ::attr(*) and ::attr(foo)
> behave differently regarding namespaces:
>
> ::attr(*) should select all attributes to be consistent with universal
> selector, equivalent to ::attr(*|*)

This is not exactly consistent with the universal selector, since it uses
the default namespace:

@namespace "foo";
@namespace a "foo";
* {}
a|* {}

Those two are equivalent but different to *|*.

> ::attr(foo) should select foo in no namespace to be consistent with
> attribute selectors, equivalent to ::attr(|foo)
>
> This is also consistent with XPath, and should create less surprises to
> developers.

Consistency with XPath seems like a weird motivation if the move to
Selectors in ITS was because people are more familiar with Selectors.

When would you want to select all attributes, by the way?

How do you declare a namespace prefix for the selector in ITS when using  
Selectors?

-- 
Simon Pieters
Opera Software

Received on Monday, 24 February 2014 14:39:06 UTC