Class SelectorHelper


  • public class SelectorHelper
    extends java.lang.Object
    Provides utility methods related to selectors.
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static int getSpecificity​(int a, int b, int c, int d)
      Computes the specificity of a selector.
      • Methods inherited from class java.lang.Object

        clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • 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.