This style selector optimization is currently enable during style recalc only. It should also be enabled for tree building.
Created attachment 82048 [details] patch Call CSSStyleSelector::push/popParent() during tree building too, fix up the parent element stack as needed. This roughly halves the remaining time in style matching over a typical page load.
Comment on attachment 82048 [details] patch r=me. Run layout tests and make sure it's all still ok.
http://trac.webkit.org/changeset/78322