зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1382077 part 1 - Have StyleSet::MediumFeaturesChanged return nsRestyleHint rather than a bool. r=heycam
MozReview-Commit-ID: 5g3mHU8pxXP --HG-- extra : rebase_source : aff51be14395850620fe43d814c49e30a3048be5
This commit is contained in:
Родитель
f54d2052b3
Коммит
d8543d6975
|
@ -2117,8 +2117,9 @@ nsPresContext::MediaFeatureValuesChanged(nsRestyleHint aRestyleHint,
|
|||
mPendingMediaFeatureValuesChanged = false;
|
||||
|
||||
// MediumFeaturesChanged updates the applied rules, so it always gets called.
|
||||
if (mShell && mShell->StyleSet()->MediumFeaturesChanged()) {
|
||||
aRestyleHint |= eRestyle_Subtree;
|
||||
if (mShell) {
|
||||
aRestyleHint |= mShell->
|
||||
StyleSet()->MediumFeaturesChanged(mPendingViewportChange);
|
||||
}
|
||||
|
||||
if (mPendingViewportChange &&
|
||||
|
|
|
@ -113,10 +113,13 @@ ServoStyleSet::InvalidateStyleForCSSRuleChanges()
|
|||
mPresContext->RestyleManager()->AsServo()->PostRestyleEventForCSSRuleChanges();
|
||||
}
|
||||
|
||||
bool
|
||||
ServoStyleSet::MediumFeaturesChanged() const
|
||||
nsRestyleHint
|
||||
ServoStyleSet::MediumFeaturesChanged(bool aViewportChanged) const
|
||||
{
|
||||
return Servo_StyleSet_MediumFeaturesChanged(mRawSet.get());
|
||||
if (Servo_StyleSet_MediumFeaturesChanged(mRawSet.get())) {
|
||||
return eRestyle_Subtree;
|
||||
}
|
||||
return nsRestyleHint(0);
|
||||
}
|
||||
|
||||
size_t
|
||||
|
|
|
@ -115,7 +115,7 @@ public:
|
|||
return StylistNeedsUpdate();
|
||||
}
|
||||
|
||||
bool MediumFeaturesChanged() const;
|
||||
nsRestyleHint MediumFeaturesChanged(bool aViewportChanged) const;
|
||||
|
||||
void InvalidateStyleForCSSRuleChanges();
|
||||
|
||||
|
|
|
@ -160,7 +160,7 @@ public:
|
|||
inline void RecordShadowStyleChange(mozilla::dom::ShadowRoot* aShadowRoot);
|
||||
inline bool StyleSheetsHaveChanged() const;
|
||||
inline void InvalidateStyleForCSSRuleChanges();
|
||||
inline bool MediumFeaturesChanged();
|
||||
inline nsRestyleHint MediumFeaturesChanged(bool aViewportChanged);
|
||||
inline already_AddRefed<nsStyleContext>
|
||||
ProbePseudoElementStyle(dom::Element* aParentElement,
|
||||
mozilla::CSSPseudoElementType aType,
|
||||
|
|
|
@ -256,10 +256,10 @@ StyleSetHandle::Ptr::StyleSheetsHaveChanged() const
|
|||
{
|
||||
FORWARD(StyleSheetsHaveChanged, ());
|
||||
}
|
||||
bool
|
||||
StyleSetHandle::Ptr::MediumFeaturesChanged()
|
||||
nsRestyleHint
|
||||
StyleSetHandle::Ptr::MediumFeaturesChanged(bool aViewportChanged)
|
||||
{
|
||||
FORWARD(MediumFeaturesChanged, ());
|
||||
FORWARD(MediumFeaturesChanged, (aViewportChanged));
|
||||
}
|
||||
void
|
||||
StyleSetHandle::Ptr::InvalidateStyleForCSSRuleChanges()
|
||||
|
|
|
@ -2674,8 +2674,8 @@ nsStyleSet::HasAttributeDependentStyle(Element* aElement,
|
|||
return data.mHint;
|
||||
}
|
||||
|
||||
bool
|
||||
nsStyleSet::MediumFeaturesChanged()
|
||||
nsRestyleHint
|
||||
nsStyleSet::MediumFeaturesChanged(bool aViewportChanged)
|
||||
{
|
||||
NS_ASSERTION(mBatching == 0, "rule processors out of date");
|
||||
|
||||
|
@ -2700,7 +2700,10 @@ nsStyleSet::MediumFeaturesChanged()
|
|||
stylesChanged = stylesChanged || thisChanged;
|
||||
}
|
||||
|
||||
return stylesChanged;
|
||||
if (stylesChanged) {
|
||||
return eRestyle_Subtree;
|
||||
}
|
||||
return nsRestyleHint(0);
|
||||
}
|
||||
|
||||
bool
|
||||
|
|
|
@ -380,10 +380,10 @@ class nsStyleSet final
|
|||
|
||||
/*
|
||||
* Do any processing that needs to happen as a result of a change in
|
||||
* the characteristics of the medium, and return whether style rules
|
||||
* may have changed as a result.
|
||||
* the characteristics of the medium, and return restyle hint needed
|
||||
* for the change.
|
||||
*/
|
||||
bool MediumFeaturesChanged();
|
||||
nsRestyleHint MediumFeaturesChanged(bool aViewportChanged);
|
||||
|
||||
// APIs to manipulate the style sheet lists. The sheets in each
|
||||
// list are stored with the most significant sheet last.
|
||||
|
|
Загрузка…
Ссылка в новой задаче