Re: [selectors4] Universal Selector '*' (asterisk) elsewhere

Most of your proposal just doesn't make sense.

Each pseudoclass has a different meaning, how can you say "I just want one 
of them"? Seriously, why would you apply the same styling for a :hover 
element, a :invalid and a :valid element ? Matching any parametric 
pseudoclass is also pure non-sense. :*(xxx) would match 
:any(:matches(xxx),:not(xxx)) which mean all elements.

Similary, selecting an element by ID has the purpose of making it unique. If 
you want all elements which have an ID, you should use *[id] but, seriously, 
this don't make sense. The same apply for classes. If you want all elements 
which have a class defined, use *[class]. But, again, this don't make sense.

The only useful things I did see in your list are [*] (select any element 
which has an attribute) and [*=foo] (any element whose an attribute at least 
has 'foo' as value) even if I never had to use them.

Also, please note that [*=*] matches the same thing as [*], and that [foo=*] 
matches the same thing as [foo].

Regards,
François





-----Message d'origine----- 
From: Christoph Päper
Sent: Thursday, March 29, 2012 11:25 AM
To: www-style CSS
Subject: [selectors4] Universal Selector '*' (asterisk) elsewhere

The character ‘*’ can be used as a wildcard – meaning “any but not none” – 
for element names and namespaces. Level 4 also clarifies that it can be used 
with language (sub)tags in ‘lang()’. Should the asterisk be meaningful in 
other places, too?

  #*            – any ID
  .*            – any class
  ::*           – any pseudo-element
  :*            – any pseudo-class
  :*()          – any parametric pseudo-class
  :*(*)         – any parametric pseudo-class with any value
  :*(foo)       – any parametric pseudo-class with a certain value
  :foo(*)       – any value for a certain parametric pseudo-class
  [*]           – any attribute
  [*=*]         – any attribute with any value
  [*=foo]       – any attribute with a certain value
  [foo=*]       – any value for a certain attribute

Note that

  [foo*=bar]    – a certain attribute containing a certain string at least 
once in its value

already has defined semantics. The asterisk is already meaningful in 
parametric pseudo-classes that expect a selector as an argument. Also 
consider that some parametric pseudo-classes accept math-like arguments, 
i.e. “An+B”, where the asterisk may look like a multiplication sign and 
thereby be confusing:

  :foo(*n)      – any A
  :foo(*)       – any B
  :foo(+*)      – any B
  :foo(-*)      – any B
  :foo(*n+*)    – any A and any B

I haven’t tried to think of use-cases for any of this yet, but attribute 
names and probably values seem like a natural extension, because like 
element names they depend on the document language. I wonder whether these 
should be equivalent:

  :foo
  :foo(*)
or
  :foo
  :foo()
or
  :foo()
  :foo(*)

  :*(foo)
  :(foo)

  E[*]
  E[*=*]

  E[foo]
  E[foo=*]

I assume the following are equivalent already, although not explicitly 
mentioned:

  E
  E[] 

Received on Thursday, 29 March 2012 09:57:18 UTC