processTree static method

StyledElement processTree(
  1. StyledElement tree,
  2. double devicePixelRatio
)

processTree optimizes the StyledElement tree so all BlockElements 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;
}