gngr
gngr copied to clipboard
Use an optimised one-shot DOM analyser for CSS
Currently jStyleParser has two types of analysers:
- A DirectAnalyser which accepts a single element, and returns
NodeDatafor that element. Analyser.evaluateDOMwhich processes the whole DOM and creates a giganticMap[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.