W3C home > Mailing lists > Public > www-style@w3.org > February 2014

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

From: Simon Pieters <simonp@opera.com>
Date: Mon, 24 Feb 2014 15:38:29 +0100
Cc: "Tab Atkins Jr." <jackalmage@gmail.com>, "Simon Sapin" <simon.sapin@exyr.org>, www-style <www-style@w3.org>
To: "Jirka Kosek" <jirka@kosek.cz>
Message-ID: <op.xbsiyfdpidj3kv@simon-pieterss-macbook.local>
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

This archive was generated by hypermail 2.3.1 : Monday, 2 May 2016 14:39:19 UTC