the system of classification of selectors in Element Hiding

Discussion on adblockplus.org website and translations
Post Reply
maybee
Posts: 130
Joined: Sun Jan 17, 2010 7:48 pm
Contact:

the system of classification of selectors in Element Hiding

Post by maybee »

this is the the system of classification of selectors in W3C CSS specification.
A simple selector is either a type selector, universal selector, attribute selector, class selector, ID selector, or pseudo-class.

The elements of a document tree that are represented by a selector are the subjects of the selector. A selector consisting of a single sequence of simple selectors represents any element satisfying its requirements. Prepending another sequence of simple selectors and a combinator to a sequence imposes additional matching constraints, so the subjects of a selector are always a subset of the elements represented by the last sequence of simple selectors.
1. simple selector
  1. type selector, universal selector, attribute selector, class selector, ID selector
  2. pseudo-class
2. combinator

according to the the page of filter writting selectors are assorted into three groups like this :
# Element hiding : en/filters
  1. Basic rules (=simple selector)
  2. Attribute selectors (=simple selector)
  3. Advanced selectors (=combinator)


the the system of classification of selectors in Element hiding is different from that of W3C CSS specification.
I wonder how the system of classification of selectors is categorized in Element hiding? Especially Attribute selectors are being categorized into one category.
and which is first/last-child(pseudo-class) categorized in Element hiding?
Wladimir Palant

Re: the system of classification of selectors in Element Hiding

Post by Wladimir Palant »

The documentation here is not about formal categorization. "Basic rules" is what people will usually use, that's also what the browsers can process most efficiently. Selectors based on untypical attributes are far less common. And everything beyond that is really for exceptional cases only.
maybee
Posts: 130
Joined: Sun Jan 17, 2010 7:48 pm
Contact:

Re: the system of classification of selectors in Element Hiding

Post by maybee »

It seems Basic rules and Attribute selectors are displayed in basic mode and the other selectors are displayed in advanced mode. I think Attribute selectors are also important entries along with basic rules in basic mode and it is worth categorizing it into one group.

Q. Can first/last-child(pseudo-class) be categorized into Advanced selectors?
Wladimir Palant

Re: the system of classification of selectors in Element Hiding

Post by Wladimir Palant »

Again, the purpose of this documentation is explanation, not categorization. If you want a spec you go to W3C.
Post Reply