Interesting. That's a very good point that seems to argue in favor of keeping 
the distinction between the selector matching/cascading functions and the flow 
construction functions that we have, and making any optimization that combines 
the two passes operate at a higher level (as I was figuring we'd do anyway). 
That is, combining the two passes should be done with a routine that simply 
invokes the two functions one after another in the proper order, instead of 
ripping apart and intertwining the two functions together into one. That way we 
can have separate paths that invoke them separately without having to duplicate 
code.

Patrick

Boris Zbarsky <bzbar...@mit.edu> wrote:
>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

-- 
Sent from my Android phone with K-9 Mail. Please excuse my brevity.
_______________________________________________
dev-servo mailing list
dev-servo@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-servo

Reply via email to