Bug 1077849 - Use eRestyle_ForceDescendants for all cases of rebuilding the rule tree. r=heycam
Bug 931668 added the eRestyle_ForceDescendants case for all cases that
go through RebuildAllStyleData, but there is another case that calls
DoRebuildAllStyleData directly, and we should cover that too.
This is needed because when we're rebuilding the rule tree, we need to
create new style contexts for all frames.
I don't know of any bugs caused by this, but it seems worth fixing.

--- a/layout/base/RestyleManager.cpp+++ b/layout/base/RestyleManager.cpp@@ -1449,19 +1449,17 @@ RestyleManager::RebuildAllStyleData(nsCh mPostAnimationRestyles = true; // FIXME (bug 1047928): Many of the callers probably don't need // eRestyle_Subtree because they're changing things that affect data // computation rather than selector matching; we could have a restyle // hint passed in, and substantially improve the performance of things // like pref changes and the restyling that we do for downloadable // font loads.- DoRebuildAllStyleData(mPendingRestyles, aExtraHint,- nsRestyleHint(eRestyle_Subtree |- eRestyle_ForceDescendants));+ DoRebuildAllStyleData(mPendingRestyles, aExtraHint, eRestyle_Subtree); mPostAnimationRestyles = false; mSkipAnimationRules = false; #ifdef DEBUG mIsProcessingRestyles = false; #endif // Make sure that we process any pending animation restyles from the@@ -1478,18 +1476,20 @@ RestyleManager::DoRebuildAllStyleData(Re { // Tell the style set to get the old rule tree out of the way // so we can recalculate while maintaining rule tree immutability nsresult rv = mPresContext->StyleSet()->BeginReconstruct(); if (NS_FAILED(rv)) { return; }- if ((aRestyleHint & (eRestyle_Subtree | eRestyle_ForceDescendants)) !=- (eRestyle_Subtree | eRestyle_ForceDescendants)) {+ aRestyleHint = aRestyleHint | eRestyle_ForceDescendants;++ if (!(aRestyleHint & eRestyle_Subtree) &&+ (aRestyleHint & ~(eRestyle_Force | eRestyle_ForceDescendants))) { // We want this hint to apply to the root node's primary frame // rather than the root frame, since it's the primary frame that has // the styles for the root element (rather than the ancestors of the // primary frame whose mContent is the root node but which have // different styles). If we use up the hint for one of the // ancestors that we hit first, then we'll fail to do the restyling // we need to do. aRestyleTracker.AddPendingRestyle(mPresContext->Document()->GetRootElement(),