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 14:47:23 +0100
To: "Jirka Kosek" <jirka@kosek.cz>
Cc: "Tab Atkins Jr." <jackalmage@gmail.com>, "Simon Sapin" <simon.sapin@exyr.org>, www-style <www-style@w3.org>
Message-ID: <op.xbsgk9rbidj3kv@simon-pieterss-macbook.local>
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

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