processTree static method
processTree optimizes the StyledElement tree so all BlockElement
s are
on the first level, redundant levels are collapsed, empty elements are
removed, and specialty elements are processed.
Implementation
static StyledElement processTree(
StyledElement tree, double devicePixelRatio) {
tree = _processInternalWhitespace(tree);
tree = _processInlineWhitespace(tree);
tree = _removeEmptyElements(tree);
tree = _calculateRelativeValues(tree, devicePixelRatio);
tree = _preprocessListMarkers(tree);
tree = _processCounters(tree);
tree = _processListMarkers(tree);
tree = _processBeforesAndAfters(tree);
tree = _collapseMargins(tree);
return tree;
}