gngr icon indicating copy to clipboard operation
gngr copied to clipboard

Use an optimised one-shot DOM analyser for CSS

Open hrj opened this issue 10 years ago • 0 comments

Currently jStyleParser has two types of analysers:

  • A DirectAnalyser which accepts a single element, and returns NodeData for that element.
  • Analyser.evaluateDOM which processes the whole DOM and creates a gigantic Map[Element, NodeData].

A third approach can be considered, where the Analyser.evaluateDOM traverses the tree and invokes a callback function for every element, passing it the NodeData. The callback function can then store the NodeData or the computed styles into the element.

Needs further thought.

hrj avatar Jul 05 '15 17:07 hrj