Class SelectorHelper


  • public class SelectorHelper
    extends Object
    Provides utility methods related to selectors.
    • Constructor Detail

      • SelectorHelper

        public SelectorHelper()
    • Method Detail

      • getSpecificity

        public static int getSpecificity​(int a,
                                         int b,
                                         int c,
                                         int d)
        Computes the specificity of a selector.
        Parameters:
        a - 1 if the declaration is from is a 'style' attribute rather than a rule with a selector, 0 otherwise.
        b - the number of ID attributes in the selector.
        c - the number of other attributes and pseudo-classes in the selector.
        d - the number of widget names and pseudo-widgets in the selector.
        Returns:
        the selector specificity.