Closed Bug 1186291 Opened 9 years ago Closed 6 years ago

make the ReparentStyleContext path of ElementRestyler::RestyleSelf faster

Categories

(Core :: CSS Parsing and Computation, defect)

defect
Not set
normal

Tracking

()

RESOLVED INVALID
Tracking Status
firefox42 --- affected

People

(Reporter: heycam, Unassigned)

Details

When we decide in ElementRestyler::RestyleSelf that we can call ReparentStyleContext -- which is when we don't have eRestyle_{Self,Subtree,Force,ForceDescendants} restyle hints -- we're creating a new style context with the same rule node as the old one.  Later in RestyleSelf we compute the structs on the new style context that were cached on the old one so that we can compare them.  In many cases we should be able to know before that point that the styles are indeed going to be the same.  If so, and we know that we're going to swap the structs from the old context to the new one, then we should be able to avoid computing the structs in the new context altogether -- they are just being thrown away anyway.

This would hopefully make restyling cheaper if we get to a point where we know that we'd like to be able to return eRestyle_Stop to take advantage of the bug 931668 optimizations, but are unable to due to various conditions.
And for cases where we're not allowed to swap structs, it might well be quicker to copy construct the new structs and then skip calling CalcStyleDifference.
This code is gone.
Status: NEW → RESOLVED
Closed: 6 years ago
Resolution: --- → INVALID
You need to log in before you can comment on or make changes to this bug.