DescriptionAvoid calling markAncestorsWithChildNeedsStyleRecalc() constantly in childrenChanged
This shows up in the Shadow DOM benchmark where childrenChanged is 2% of
the profile because we're calling into inActiveDocument() which is not
inline and then doing markAncestorsWithChildNeedsStyleRecalc() which is
also not inline without checking if the ancestor marking is actually needed.
markAncestorsWithChildNeedsStyleRecalc() also blindly calls
document().scheduleRenderTreeUpdate() which is not inline and does a bunch
of work.
This patch fixes the checks in ::childrenChanged to check the childNeedsStyleRecalc()
bit before calling markAncestorsWithChildNeedsStyleRecalc. This is equivalent to
checking inActiveDocument() as well since all nodes not in the tree have this bit set,
and all nodes in an inactive document will also have this bit set, so we'd never call
into markAncestorsWithChildNeedsStyleRecalc() in those trees.
It also adds an early out so we don't call into scheduleRenderTreeUpdate() so often
when invalidating style.
R=eseidel@chromium.org,abarth@chromium.org
BUG=357087
Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=170705
Patch Set 1 #
Total comments: 1
Patch Set 2 : fix it #Patch Set 3 : fix it again #Patch Set 4 : and again #Patch Set 5 : and again #Patch Set 6 : plus test #Patch Set 7 : Fix accessibility test and causing recalcs on removal #
Total comments: 1
Messages
Total messages: 41 (0 generated)
|