Class RuleIndex

java.lang.Object
org.eclipse.e4.ui.css.core.impl.engine.selector.RuleIndex

public final class RuleIndex extends Object
Buckets style rules by the rightmost simple selector of each selector alternative, so the cascade only runs the matcher against rules that can possibly match a given element.
  • Method Details

    • of

      public static RuleIndex of(List<CSSStyleSheetImpl> styleSheets)
      Indexes every style rule in cascade order, for the running platform.
    • of

      public static RuleIndex of(List<CSSStyleSheetImpl> styleSheets, Media.Context media)
      Indexes every style rule in cascade order. A rule guarded by an @media query is indexed at its block's position, and only when the query matches.
    • candidatesFor

      public List<RuleIndex.Candidate> candidatesFor(Element element)
      The candidates whose bucket key the element satisfies, in cascade order. A superset of the actually matching alternatives; callers still run the matcher on each candidate.
    • allCandidates

      public List<RuleIndex.Candidate> allCandidates()
      Every indexed candidate, in cascade order.