Bug 1115812 patch 2 - Move the eRestyle_ChangeAnimationPhaseDescendants hint in DoRebuildAllStyleData so that the new rebuild-all codepaths will keep it. r=heycam

The patches in this series refactor the process of rebuilding all style
data (RestyleManager::RebuildAllStyleData and
RestyleManager::DoRebuildAllStyleData) so that the process of rebuilding
all style data uses the existing restyle processing loops in
ProcessPendingRestyles.  (Rebuilding all style data is what we do when
we need to throw away the rule tree because something has invalidated
the cached data in it.)  This removes (increasing, especially with bug
960465 coming) code duplicated between the two codepaths, fixes some
omissions from the separate rebuild-all codepath, and (more immediately)
allows fixing lifetime issues of ReframingStyleContexts objects in bug
1110277 so that we can have a single ReframingStyleContexts for all of
the restyle processing in each restyle processing operation.  In other
words, the goal is to change the rebuild-all process from a separate
codepath to a few variables that modify the way ProcessPendingRestyles
works (and make it do the extra work).

This is just a small first step in that process, which moves one piece
of code from a chunk of duplicated and to-be-removed code into a chunk
of code that will be preserved.
This commit is contained in:
L. David Baron 2015-01-13 21:03:11 -08:00
parent c18ac3eff2
commit 5d1c7926f6

View File

@ -1508,12 +1508,9 @@ RestyleManager::RebuildAllStyleData(nsChangeHint aExtraHint,
// Until we get rid of these phases in bug 960465, we need to skip
// animation restyles during the non-animation phase, and post
// animation restyles so that we restyle those elements again in the
// animation phase. Furthermore, we need to add
// eRestyle_ChangeAnimationPhaseDescendants so that we actually honor
// these booleans in all cases.
// animation phase.
mSkipAnimationRules = true;
mPostAnimationRestyles = true;
aRestyleHint |= eRestyle_ChangeAnimationPhaseDescendants;
DoRebuildAllStyleData(mPendingRestyles, aExtraHint, aRestyleHint);
@ -1542,6 +1539,11 @@ RestyleManager::DoRebuildAllStyleData(RestyleTracker& aRestyleTracker,
return;
}
// Until we get rid of these phases in bug 960465, we need to add
// eRestyle_ChangeAnimationPhaseDescendants so that we actually honor
// these booleans in all cases.
aRestyleHint |= eRestyle_ChangeAnimationPhaseDescendants;
aRestyleHint = aRestyleHint | eRestyle_ForceDescendants;
if (!(aRestyleHint & eRestyle_Subtree) &&