зеркало из 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,
|
nsPresContext::MediaFeatureValuesChanged(StyleRebuildType aShouldRebuild,
|
||||||
nsChangeHint aChangeHint)
|
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;
|
mPendingMediaFeatureValuesChanged = false;
|
||||||
|
|
||||||
// MediumFeaturesChanged updates the applied rules, so it always gets called.
|
nsRestyleHint aRestyleHint = nsRestyleHint(0);
|
||||||
bool mediaFeaturesDidChange = mShell ? mShell->StyleSet()->MediumFeaturesChanged(this)
|
|
||||||
: false;
|
|
||||||
|
|
||||||
if (aShouldRebuild == eAlwaysRebuildStyle ||
|
if (aShouldRebuild == eAlwaysRebuildStyle) {
|
||||||
mediaFeaturesDidChange ||
|
// FIXME: Pass restyle hint from caller.
|
||||||
(mUsesViewportUnits && mPendingViewportChange)) {
|
aRestyleHint |= eRestyle_Subtree;
|
||||||
RebuildAllStyleData(aChangeHint, 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;
|
mPendingViewportChange = false;
|
||||||
|
|
Загрузка…
Ссылка в новой задаче