Class UnsafeMergeRulesetNodes
- java.lang.Object
-
- com.google.common.css.compiler.passes.UnsafeMergeRulesetNodes
-
- All Implemented Interfaces:
CssCompilerPass
public class UnsafeMergeRulesetNodes extends java.lang.Object implements 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 theMarkRemovableRulesetNodespass 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.FOOand.BARmight conflict if these classes co-occur on a DOM element. As another example,.FOO spanand.BAR spanmight conflict say if aspanDOM element has a parent with aFOOclass and a grandparent with aBARclass.
-
-
Constructor Summary
Constructors Constructor Description UnsafeMergeRulesetNodes(CssTree tree, boolean byPartition, boolean skipping)Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidrunPass()
-
-
-
Constructor Detail
-
UnsafeMergeRulesetNodes
public UnsafeMergeRulesetNodes(CssTree tree, boolean byPartition, boolean skipping)
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 Detail
-
runPass
public void runPass()
- Specified by:
runPassin interfaceCssCompilerPass
-
-