Bug 1332193 - Fix several properties to return NeutralChange hint. r=heycam
authorXidorn Quan <me@upsuper.org>
Thu, 19 Jan 2017 19:13:02 +1100
changeset 377315 168ea3e9ff0bad286676173263613703187ab8f1
parent 377314 fa590ad0b31c0bfba57af5e9788b9abaa73316e4
child 377391 a3978751f45108ff1ae002ecebdc0fa23fc52b84
child 377445 335c864df46df0b894d8d5f78aec957649d86e97
push id1419
push userjlund@mozilla.com
push dateMon, 10 Apr 2017 20:44:07 +0000
treeherdermozilla-release@5e6801b73ef6 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersheycam
bugs1332193
milestone53.0a1
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
Bug 1332193 - Fix several properties to return NeutralChange hint. r=heycam MozReview-Commit-ID: GDNRy6vqmL8
layout/style/nsStyleStruct.cpp
layout/style/nsStyleStruct.h
--- a/layout/style/nsStyleStruct.cpp
+++ b/layout/style/nsStyleStruct.cpp
@@ -484,18 +484,17 @@ nsStyleBorder::CalcDifference(const nsSt
   }
 
   if (IsBorderImageLoaded() || aNewData.IsBorderImageLoaded()) {
     if (mBorderImageSource  != aNewData.mBorderImageSource  ||
         mBorderImageRepeatH != aNewData.mBorderImageRepeatH ||
         mBorderImageRepeatV != aNewData.mBorderImageRepeatV ||
         mBorderImageSlice   != aNewData.mBorderImageSlice   ||
         mBorderImageFill    != aNewData.mBorderImageFill    ||
-        mBorderImageWidth   != aNewData.mBorderImageWidth   ||
-        mBorderImageOutset  != aNewData.mBorderImageOutset) {
+        mBorderImageWidth   != aNewData.mBorderImageWidth) {
       return nsChangeHint_RepaintFrame;
     }
   }
 
   // Note that at this point if mBorderColors is non-null so is
   // aNewData.mBorderColors
   if (mBorderColors) {
     NS_FOR_CSS_SIDES(ix) {
@@ -508,16 +507,28 @@ nsStyleBorder::CalcDifference(const nsSt
 
   // mBorder is the specified border value.  Changes to this don't
   // need any change processing, since we operate on the computed
   // border values instead.
   if (mBorder != aNewData.mBorder) {
     return nsChangeHint_NeutralChange;
   }
 
+  // mBorderImage* fields are checked only when border image was
+  // actualy loaded. But we need to return neutral change even when
+  // they are not actually used.
+  if (mBorderImageSource  != aNewData.mBorderImageSource  ||
+      mBorderImageRepeatH != aNewData.mBorderImageRepeatH ||
+      mBorderImageRepeatV != aNewData.mBorderImageRepeatV ||
+      mBorderImageSlice   != aNewData.mBorderImageSlice   ||
+      mBorderImageFill    != aNewData.mBorderImageFill    ||
+      mBorderImageWidth   != aNewData.mBorderImageWidth) {
+    return nsChangeHint_NeutralChange;
+  }
+
   return nsChangeHint(0);
 }
 
 nsStyleOutline::nsStyleOutline(const nsPresContext* aContext)
   : mOutlineWidth((StaticPresData::Get()
                      ->GetBorderWidthTable())[NS_STYLE_BORDER_WIDTH_MEDIUM])
   , mOutlineOffset(0)
   , mOutlineColor(StyleComplexColor::CurrentColor())
@@ -4130,16 +4141,20 @@ nsStyleUIReset::CalcDifference(const nsS
   if (mUserSelect != aNewData.mUserSelect) {
     return NS_STYLE_HINT_VISUAL;
   }
 
   if (mWindowDragging != aNewData.mWindowDragging) {
     return nsChangeHint_SchedulePaint;
   }
 
+  if (mIMEMode != aNewData.mIMEMode) {
+    return nsChangeHint_NeutralChange;
+  }
+
   return nsChangeHint(0);
 }
 
 //-----------------------
 // nsStyleVariables
 //
 
 nsStyleVariables::nsStyleVariables()
--- a/layout/style/nsStyleStruct.h
+++ b/layout/style/nsStyleStruct.h
@@ -3400,17 +3400,18 @@ struct MOZ_NEEDS_MEMMOVABLE_MEMBERS nsSt
     this->~nsStyleUIReset();
     aContext->PresShell()->
       FreeByObjectID(mozilla::eArenaObjectID_nsStyleUIReset, this);
   }
 
   nsChangeHint CalcDifference(const nsStyleUIReset& aNewData) const;
   static nsChangeHint MaxDifference() {
     return nsChangeHint_ReconstructFrame |
-           NS_STYLE_HINT_REFLOW;
+           NS_STYLE_HINT_REFLOW |
+           nsChangeHint_NeutralChange;
   }
   static nsChangeHint DifferenceAlwaysHandledForDescendants() {
     // CalcDifference never returns the reflow hints that are sometimes
     // handled for descendants as hints not handled for descendants.
     return nsChangeHint_NeedReflow |
            nsChangeHint_ReflowChangesSizeOrPosition |
            nsChangeHint_ClearAncestorIntrinsics;
   }