Bug 1047928 patch 3 - Pass restyle hint to nsPresContext::RebuildAllStyleData. r=bzbarsky

This patch is not intended to contain any changes in behavior.

The behavior changes for these callers are in the following patch.
This commit is contained in:
L. David Baron 2014-10-08 14:26:57 -07:00
Родитель acfd59047e
Коммит 396b48143a
5 изменённых файлов: 14 добавлений и 12 удалений

Просмотреть файл

@ -847,10 +847,11 @@ nsFrameLoader::MarginsChanged(uint32_t aMarginWidth,
mDocShell->SetMarginHeight(aMarginHeight);
// Trigger a restyle if there's a prescontext
// FIXME: This could do something much less expensive.
nsRefPtr<nsPresContext> presContext;
mDocShell->GetPresContext(getter_AddRefs(presContext));
if (presContext)
presContext->RebuildAllStyleData(nsChangeHint(0));
presContext->RebuildAllStyleData(nsChangeHint(0), eRestyle_Subtree);
}
bool

Просмотреть файл

@ -167,7 +167,7 @@ nsHistory::Go(int32_t aDelta, ErrorResult& aRv)
nsIPresShell *shell;
nsPresContext *pcx;
if (doc && (shell = doc->GetShell()) && (pcx = shell->GetPresContext())) {
pcx->RebuildAllStyleData(NS_STYLE_HINT_REFLOW);
pcx->RebuildAllStyleData(NS_STYLE_HINT_REFLOW, eRestyle_Subtree);
}
return;

Просмотреть файл

@ -923,7 +923,7 @@ nsLocation::Reload(bool aForceget)
nsIPresShell *shell;
nsPresContext *pcx;
if (doc && (shell = doc->GetShell()) && (pcx = shell->GetPresContext())) {
pcx->RebuildAllStyleData(NS_STYLE_HINT_REFLOW);
pcx->RebuildAllStyleData(NS_STYLE_HINT_REFLOW, eRestyle_Subtree);
}
return NS_OK;

Просмотреть файл

@ -945,7 +945,7 @@ nsPresContext::UpdateAfterPreferencesChanged()
NS_UpdateHint(hint, NS_STYLE_HINT_REFLOW);
}
RebuildAllStyleData(hint);
RebuildAllStyleData(hint, eRestyle_Subtree);
}
nsresult
@ -1172,7 +1172,7 @@ nsPresContext::DoChangeCharSet(const nsCString& aCharSet)
{
UpdateCharSet(aCharSet);
mDeviceContext->FlushFontCache();
RebuildAllStyleData(NS_STYLE_HINT_REFLOW);
RebuildAllStyleData(NS_STYLE_HINT_REFLOW, eRestyle_Subtree);
}
void
@ -1742,7 +1742,7 @@ nsPresContext::SysColorChangedInternal()
// The system color values are computed to colors in the style data,
// so normal style data comparison is sufficient here.
RebuildAllStyleData(nsChangeHint(0));
RebuildAllStyleData(nsChangeHint(0), eRestyle_Subtree);
}
void
@ -1852,7 +1852,8 @@ void nsPresContext::StopEmulatingMedium()
}
void
nsPresContext::RebuildAllStyleData(nsChangeHint aExtraHint)
nsPresContext::RebuildAllStyleData(nsChangeHint aExtraHint,
nsRestyleHint aRestyleHint)
{
if (!mShell) {
// We must have been torn down. Nothing to do here.
@ -1864,8 +1865,7 @@ nsPresContext::RebuildAllStyleData(nsChangeHint aExtraHint)
RebuildUserFontSet();
RebuildCounterStyles();
// FIXME: Pass through from callers
RestyleManager()->RebuildAllStyleData(aExtraHint, eRestyle_Subtree);
RestyleManager()->RebuildAllStyleData(aExtraHint, aRestyleHint);
}
void
@ -1894,7 +1894,7 @@ nsPresContext::MediaFeatureValuesChanged(StyleRebuildType aShouldRebuild,
if (aShouldRebuild == eAlwaysRebuildStyle ||
mediaFeaturesDidChange ||
(mUsesViewportUnits && mPendingViewportChange)) {
RebuildAllStyleData(aChangeHint);
RebuildAllStyleData(aChangeHint, eRestyle_Subtree);
}
mPendingViewportChange = false;
@ -2243,7 +2243,7 @@ nsPresContext::EnsureSafeToHandOutCSSRules()
}
MOZ_ASSERT(res == CSSStyleSheet::eUniqueInner_ClonedInner);
RebuildAllStyleData(nsChangeHint(0));
RebuildAllStyleData(nsChangeHint(0), eRestyle_Subtree);
}
void

Просмотреть файл

@ -254,9 +254,10 @@ public:
* Rebuilds all style data by throwing out the old rule tree and
* building a new one, and additionally applying aExtraHint (which
* must not contain nsChangeHint_ReconstructFrame) to the root frame.
* For aRestyleHint, see RestyleManager::RebuildAllStyleData.
* Also rebuild the user font set and counter style manager.
*/
void RebuildAllStyleData(nsChangeHint aExtraHint);
void RebuildAllStyleData(nsChangeHint aExtraHint, nsRestyleHint aRestyleHint);
/**
* Just like RebuildAllStyleData, except (1) asynchronous and (2) it
* doesn't rebuild the user font set.