Backed out changeset 23c6326dd926 (bug 1382077) on request from xidorn
authorCarsten "Tomcat" Book <cbook@mozilla.com>
Tue, 25 Jul 2017 12:17:56 +0200
changeset 419516 a34cb0f468bce65e7b8e7eae1c86bcbd4529fa10
parent 419515 d173f12089ac56c3ae080aa4af5cba357ba0d56d
child 419517 d7eb050d790601812c56f8b1dba8bd916cd9fce5
push id7566
push usermtabara@mozilla.com
push dateWed, 02 Aug 2017 08:25:16 +0000
treeherdermozilla-beta@86913f512c3c [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1382077
milestone56.0a1
backs out23c6326dd926bb60c59c684b6c6304e2cb8af035
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Backed out changeset 23c6326dd926 (bug 1382077) on request from xidorn
layout/base/nsPresContext.cpp
layout/style/ServoStyleSet.cpp
layout/style/ServoStyleSet.h
layout/style/StyleSetHandle.h
layout/style/StyleSetHandleInlines.h
layout/style/nsStyleSet.cpp
layout/style/nsStyleSet.h
--- a/layout/base/nsPresContext.cpp
+++ b/layout/base/nsPresContext.cpp
@@ -2112,19 +2112,18 @@ nsPresContext::MediaFeatureValuesChanged
 
 void
 nsPresContext::MediaFeatureValuesChanged(nsRestyleHint aRestyleHint,
                                          nsChangeHint aChangeHint)
 {
   mPendingMediaFeatureValuesChanged = false;
 
   // MediumFeaturesChanged updates the applied rules, so it always gets called.
-  if (mShell) {
-    aRestyleHint |= mShell->
-      StyleSet()->MediumFeaturesChanged(mPendingViewportChange);
+  if (mShell && mShell->StyleSet()->MediumFeaturesChanged()) {
+    aRestyleHint |= eRestyle_Subtree;
   }
 
   if (mPendingViewportChange &&
       (mUsesViewportUnits || mDocument->IsStyledByServo())) {
     // Rebuild all style data without rerunning selector matching.
     //
     // FIXME(emilio, bug 1328652): We don't set mUsesViewportUnits in stylo yet,
     // so assume the worst.
--- a/layout/style/ServoStyleSet.cpp
+++ b/layout/style/ServoStyleSet.cpp
@@ -108,23 +108,20 @@ ServoStyleSet::Shutdown()
 
 void
 ServoStyleSet::InvalidateStyleForCSSRuleChanges()
 {
   MOZ_ASSERT(StylistNeedsUpdate());
   mPresContext->RestyleManager()->AsServo()->PostRestyleEventForCSSRuleChanges();
 }
 
-nsRestyleHint
-ServoStyleSet::MediumFeaturesChanged(bool aViewportChanged) const
+bool
+ServoStyleSet::MediumFeaturesChanged() const
 {
-  if (Servo_StyleSet_MediumFeaturesChanged(mRawSet.get())) {
-    return eRestyle_Subtree;
-  }
-  return nsRestyleHint(0);
+  return Servo_StyleSet_MediumFeaturesChanged(mRawSet.get());
 }
 
 size_t
 ServoStyleSet::SizeOfIncludingThis(MallocSizeOf aMallocSizeOf) const
 {
   size_t n = aMallocSizeOf(this);
 
   if (mStyleRuleMap) {
--- a/layout/style/ServoStyleSet.h
+++ b/layout/style/ServoStyleSet.h
@@ -110,17 +110,17 @@ public:
     ForceAllStyleDirty();
   }
 
   bool StyleSheetsHaveChanged() const
   {
     return StylistNeedsUpdate();
   }
 
-  nsRestyleHint MediumFeaturesChanged(bool aViewportChanged) const;
+  bool MediumFeaturesChanged() const;
 
   void InvalidateStyleForCSSRuleChanges();
 
   size_t SizeOfIncludingThis(mozilla::MallocSizeOf aMallocSizeOf) const;
   const RawServoStyleSet* RawSet() const {
     return mRawSet.get();
   }
 
--- a/layout/style/StyleSetHandle.h
+++ b/layout/style/StyleSetHandle.h
@@ -155,17 +155,17 @@ public:
     inline StyleSheet* StyleSheetAt(SheetType aType, int32_t aIndex) const;
     inline void AppendAllXBLStyleSheets(nsTArray<StyleSheet*>& aArray) const;
     inline nsresult RemoveDocStyleSheet(StyleSheet* aSheet);
     inline nsresult AddDocStyleSheet(StyleSheet* aSheet, nsIDocument* aDocument);
     inline void RecordStyleSheetChange(StyleSheet* aSheet, StyleSheet::ChangeType);
     inline void RecordShadowStyleChange(mozilla::dom::ShadowRoot* aShadowRoot);
     inline bool StyleSheetsHaveChanged() const;
     inline void InvalidateStyleForCSSRuleChanges();
-    inline nsRestyleHint MediumFeaturesChanged(bool aViewportChanged);
+    inline bool MediumFeaturesChanged();
     inline already_AddRefed<nsStyleContext>
     ProbePseudoElementStyle(dom::Element* aParentElement,
                             mozilla::CSSPseudoElementType aType,
                             nsStyleContext* aParentContext);
     inline already_AddRefed<nsStyleContext>
     ProbePseudoElementStyle(dom::Element* aParentElement,
                             mozilla::CSSPseudoElementType aType,
                             nsStyleContext* aParentContext,
--- a/layout/style/StyleSetHandleInlines.h
+++ b/layout/style/StyleSetHandleInlines.h
@@ -251,20 +251,20 @@ StyleSetHandle::Ptr::RecordShadowStyleCh
   FORWARD(RecordShadowStyleChange, (aShadowRoot));
 }
 
 bool
 StyleSetHandle::Ptr::StyleSheetsHaveChanged() const
 {
   FORWARD(StyleSheetsHaveChanged, ());
 }
-nsRestyleHint
-StyleSetHandle::Ptr::MediumFeaturesChanged(bool aViewportChanged)
+bool
+StyleSetHandle::Ptr::MediumFeaturesChanged()
 {
-  FORWARD(MediumFeaturesChanged, (aViewportChanged));
+  FORWARD(MediumFeaturesChanged, ());
 }
 void
 StyleSetHandle::Ptr::InvalidateStyleForCSSRuleChanges()
 {
   FORWARD(InvalidateStyleForCSSRuleChanges, ());
 }
 
 // check whether there is ::before/::after style for an element
--- a/layout/style/nsStyleSet.cpp
+++ b/layout/style/nsStyleSet.cpp
@@ -2669,18 +2669,18 @@ nsStyleSet::HasAttributeDependentStyle(E
   if (!(data.mHint & eRestyle_Subtree)) {
     // No point keeping the list of selectors around if we are going to
     // restyle the whole subtree unconditionally.
     aRestyleHintDataResult = Move(data.mHintData);
   }
   return data.mHint;
 }
 
-nsRestyleHint
-nsStyleSet::MediumFeaturesChanged(bool aViewportChanged)
+bool
+nsStyleSet::MediumFeaturesChanged()
 {
   NS_ASSERTION(mBatching == 0, "rule processors out of date");
 
   // We can't use WalkRuleProcessors without a content node.
   nsPresContext* presContext = PresContext();
   bool stylesChanged = false;
   for (nsIStyleRuleProcessor* processor : mRuleProcessors) {
     if (!processor) {
@@ -2695,20 +2695,17 @@ nsStyleSet::MediumFeaturesChanged(bool a
   }
 
   if (mBindingManager) {
     bool thisChanged = false;
     mBindingManager->MediumFeaturesChanged(presContext, &thisChanged);
     stylesChanged = stylesChanged || thisChanged;
   }
 
-  if (stylesChanged) {
-    return eRestyle_Subtree;
-  }
-  return nsRestyleHint(0);
+  return stylesChanged;
 }
 
 bool
 nsStyleSet::EnsureUniqueInnerOnCSSSheets()
 {
   AutoTArray<StyleSheet*, 32> queue;
   for (SheetType type : gCSSSheetTypes) {
     for (StyleSheet* sheet : mSheets[type]) {
--- a/layout/style/nsStyleSet.h
+++ b/layout/style/nsStyleSet.h
@@ -375,20 +375,20 @@ class nsStyleSet final
                                            int32_t        aModType,
                                            bool           aAttrHasChanged,
                                            const nsAttrValue* aOtherValue,
                                            mozilla::RestyleHintData&
                                              aRestyleHintDataResult);
 
   /*
    * Do any processing that needs to happen as a result of a change in
-   * the characteristics of the medium, and return restyle hint needed
-   * for the change.
+   * the characteristics of the medium, and return whether style rules
+   * may have changed as a result.
    */
-  nsRestyleHint MediumFeaturesChanged(bool aViewportChanged);
+  bool MediumFeaturesChanged();
 
   // APIs to manipulate the style sheet lists.  The sheets in each
   // list are stored with the most significant sheet last.
   nsresult AppendStyleSheet(mozilla::SheetType aType,
                             mozilla::CSSStyleSheet* aSheet);
   nsresult PrependStyleSheet(mozilla::SheetType aType,
                              mozilla::CSSStyleSheet* aSheet);
   nsresult RemoveStyleSheet(mozilla::SheetType aType,