Class SkippingTreeVisitor

java.lang.Object
com.google.common.css.compiler.ast.DefaultTreeVisitor
com.google.common.css.compiler.ast.SkippingTreeVisitor
All Implemented Interfaces:
AtRuleHandler, CssTreeVisitor
Direct Known Subclasses:
MarkRemovableRulesetNodes, MergeAdjacentRulesetNodesWithSameDeclarations, MergeAdjacentRulesetNodesWithSameSelector, SplitRulesetNodes

public class SkippingTreeVisitor extends DefaultTreeVisitor
Any compiler pass which derives from this is able to skip processing rules that contain specific property names.

TODO(user): Should we move these functions to the DefaultVisitController?

  • Constructor Details

    • SkippingTreeVisitor

      public SkippingTreeVisitor(boolean skip)
      Constructor of a skipping tree visitor which sets the skipping property.
      Parameters:
      skip -
  • Method Details

    • canModifyRuleset

      public boolean canModifyRuleset(CssRulesetNode ruleset)
      This method checks if the given ruleset is safe to be changed.
      Returns:
      false if the ruleset is not safe to be modified (because it contains any of the pre-defined property names when skipping is turned on), true otherwise.
    • isSkipping

      public boolean isSkipping()