On 2/9/14 1:24 PM, Patrick Walton wrote:
(2) it's easier to benchmark style recalc against Gecko and WebKit when it's not intertwined with intrinsic width calculation.
One note here. It's not uncommon for pages to do things that need a style recalc (e.g. a getComputedStyle() call) but don't need any sort of layout at all, including intrinsic width calculation.
In Gecko such calls do perform box construction right now but that's due to Gecko storing the nsStyleContext in the nsIFrame. In an ideal world a pure-style flush would just recompute styles and not touch the box tree at all. At least in Gecko, where you can't do the box tree bits in parallel with running the part of the script after the getComputedStyle() call.
Gecko also has internal code that wants to trigger box construction but not any layout activity.
Realistically, I think you want two slightly different kinds of style recalc. The ones triggered by the refresh driver (or whatever servo's equivalent), which want to immediately segue into layout. And the ones triggered by someone asking for up-to-date style information, probably because they plan to then change it. Doing any unnecessary work here is probably a waste of time.
-Boris _______________________________________________ dev-servo mailing list dev-servo@lists.mozilla.org https://lists.mozilla.org/listinfo/dev-servo