Returns the specificity (>=0) of the match with the selector string or -1 if there is no match.
A selector's specificity is calculated as follows:
• Count the number of ID selectors in the selector (= a)
• Count the number of class selectors, attributes selectors, and pseudo-classes in the selector (= b)
• Count the number of type selectors and pseudo-elements in the selector (= c)
• Ignore the universal selector
• Selectors inside the negation pseudo-class are counted like any other, but the negation itself does not count as a pseudo-class.
Concatenating the three numbers a-b-c (in a number system with a large base) gives the specificity.
Namespace: RSSVG
Delphi |
public |
Parameters
Selector
Type: String
Type: Integer
Reference |