зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1047928 patch 9 - Don't rerun selector matching for viewport units. r=bzbarsky
This commit is contained in:
Родитель
58593a97a3
Коммит
ec4c95d775
|
@ -1885,19 +1885,27 @@ void
|
|||
nsPresContext::MediaFeatureValuesChanged(StyleRebuildType aShouldRebuild,
|
||||
nsChangeHint aChangeHint)
|
||||
{
|
||||
NS_ASSERTION(aShouldRebuild == eAlwaysRebuildStyle || aChangeHint == 0,
|
||||
"If you don't know if we need a rebuild, how can you provide a hint?");
|
||||
|
||||
mPendingMediaFeatureValuesChanged = false;
|
||||
|
||||
// MediumFeaturesChanged updates the applied rules, so it always gets called.
|
||||
bool mediaFeaturesDidChange = mShell ? mShell->StyleSet()->MediumFeaturesChanged(this)
|
||||
: false;
|
||||
nsRestyleHint aRestyleHint = nsRestyleHint(0);
|
||||
|
||||
if (aShouldRebuild == eAlwaysRebuildStyle ||
|
||||
mediaFeaturesDidChange ||
|
||||
(mUsesViewportUnits && mPendingViewportChange)) {
|
||||
RebuildAllStyleData(aChangeHint, eRestyle_Subtree);
|
||||
if (aShouldRebuild == eAlwaysRebuildStyle) {
|
||||
// FIXME: Pass restyle hint from caller.
|
||||
aRestyleHint |= eRestyle_Subtree;
|
||||
}
|
||||
|
||||
// MediumFeaturesChanged updates the applied rules, so it always gets called.
|
||||
if (mShell && mShell->StyleSet()->MediumFeaturesChanged(this)) {
|
||||
aRestyleHint |= eRestyle_Subtree;
|
||||
}
|
||||
|
||||
if (mUsesViewportUnits && mPendingViewportChange) {
|
||||
// Rebuild all style data without rerunning selector matching.
|
||||
aRestyleHint |= eRestyle_ForceDescendants;
|
||||
}
|
||||
|
||||
if (aRestyleHint || aChangeHint) {
|
||||
RebuildAllStyleData(aChangeHint, aRestyleHint);
|
||||
}
|
||||
|
||||
mPendingViewportChange = false;
|
||||
|
|
Загрузка…
Ссылка в новой задаче