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

On Thu, Feb 27, 2014 at 9:08 AM, Jirka Kosek <jirka@kosek.cz> wrote:
> On 27.2.2014 17:53, Tab Atkins Jr. wrote:
>> Again, the inconsistency is internal.  "*", when used in type
>> selectors, is just a wildcard tagname.  It acts identically wrt
>> namespaces as a real tagname does.  "*", when used in ::attr(), should
>> work the same, and be identical to a real attribute name wrt
>> namespaces.
>>
>> Your suggestion is that "*" act *differently* than a normal attribute
>> name, so that it assumes "all namespaces" while a normal attribute
>> names assumes "the null namespace".
>
> But as there is already inconsistency between type selectors ("E"
> selects E elements in any namespace) and attribute selectors ("[A]"
> matches elements that have A attribute in no namespace) I don't think
> that special treatment of "*" as wildcard in ::attr(*) will do any harm.
> After all this behaviour can be brought back to attribute selectors --
> "[*]" will match element that has at least one attribute.
>

Is there any option to have selectors on attribute names (partial matches) too
rather than on their values?

I saw practical need for for something like:

E[data-*] { ... }

that will match any E element with any "data-something" attribute.

Same apply to that ::attr() construct if it will go through.


-- 
Andrew Fedoniouk.

http://terrainformatica.com

Received on Thursday, 27 February 2014 18:43:49 UTC