If we need to recalc style for a single or very few elements in a large DOM tree, considerable time can be spent traversing from the document root down to those elements as we traverse all siblings of all ancestors looking for dirty bits.
In particular, a local experiment showed that most of the time updating hover state for sections in the whatwg single page html spec was spent unnecessarily traversing the dom.
This can be solved by storing a common ancestor of the elements which needs style invalidation/recalc or layout tree update and start from that root.
Comment 1 by futhark@chromium.org
, Aug 13