Class UnsafeMergeRulesetNodes
java.lang.Object
com.google.common.css.compiler.passes.UnsafeMergeRulesetNodes
- All Implemented Interfaces:
CssCompilerPass
Compiler pass that merges rulesets aggressively. The ordering of
the rulesets ensures that shorthand properties appear before their
detailed properties, and that the ordering of conflicting shorthand
properties is preserved. It assumes all other ordering is
irrelevant. When the
MarkRemovableRulesetNodes pass is run
before this pass, the assumptions of this pass will be valid if no
DOM element matches two or more selectors of the same specificity
with conflicting declarations. For example, selectors .FOO
and .BAR might conflict if these classes co-occur on a DOM
element. As another example, .FOO span and .BAR span
might conflict say if a span DOM element has a parent with
a FOO class and a grandparent with a BAR class.-
Constructor Summary
ConstructorsConstructorDescriptionUnsafeMergeRulesetNodes(CssTree tree, boolean byPartition, boolean skipping) Constructor. -
Method Summary
-
Constructor Details
-
UnsafeMergeRulesetNodes
Constructor.This pass runs in two modes, depending on the value of
byPartition. IfbyPartitionistrue, all declarations on a selector are first grouped by their partition (as defined byCssPropertyNode.getPartition()). Then, selectors which have the same declarations for a partition are grouped together into a ruleset. IfbyPartitionisfalse(recommended), partitioning is only performed on order-dependent partitions (as defined byORDER_DEPENDENT_PARTITIONS.- Parameters:
tree- the tree to run the pass onbyPartition- whether to group all declarations by partition (and not just the ones such as border where order matters)skipping- whether to skip certain properties as defined bySkippingTreeVisitor
-
-
Method Details
-
runPass
public void runPass()- Specified by:
runPassin interfaceCssCompilerPass
-