Bug 1227766 patch 2 - Add will-change bit for establishing a containing block for fixed positioned elements. r=dholbert
authorL. David Baron <dbaron@dbaron.org>
Mon, 30 Nov 2015 15:46:44 -0800
changeset 308934 d272cd8346700eca2940496711697bada98f01f8
parent 308933 02f0d955ce78b140efcbf42e8027cd3d7a92cdc5
child 308935 daf35b346b5d103dce479ac8368a642d867cacd7
push id5513
push userraliiev@mozilla.com
push dateMon, 25 Jan 2016 13:55:34 +0000
treeherdermozilla-beta@5ee97dd05b5c [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdholbert
bugs1227766
milestone45.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 1227766 patch 2 - Add will-change bit for establishing a containing block for fixed positioned elements. r=dholbert
layout/style/nsRuleNode.cpp
layout/style/nsStyleConsts.h
--- a/layout/style/nsRuleNode.cpp
+++ b/layout/style/nsRuleNode.cpp
@@ -6083,21 +6083,26 @@ nsRuleNode::ComputeDisplayData(void* aSt
         if (buffer.EqualsLiteral("scroll-position")) {
           display->mWillChangeBitField |= NS_STYLE_WILL_CHANGE_SCROLL;
         }
 
         nsCSSProperty prop =
           nsCSSProps::LookupProperty(buffer,
                                      nsCSSProps::eEnabledForAllContent);
         if (prop != eCSSProperty_UNKNOWN &&
-            prop != eCSSPropertyExtra_variable &&
-            nsCSSProps::PropHasFlags(prop,
-                                     CSS_PROPERTY_CREATES_STACKING_CONTEXT))
-        {
-          display->mWillChangeBitField |= NS_STYLE_WILL_CHANGE_STACKING_CONTEXT;
+            prop != eCSSPropertyExtra_variable) {
+          if (nsCSSProps::PropHasFlags(prop,
+                CSS_PROPERTY_CREATES_STACKING_CONTEXT)) {
+            display->mWillChangeBitField |=
+              NS_STYLE_WILL_CHANGE_STACKING_CONTEXT;
+          }
+          if (nsCSSProps::PropHasFlags(prop, CSS_PROPERTY_FIXPOS_CB)) {
+            display->mWillChangeBitField |=
+              NS_STYLE_WILL_CHANGE_FIXPOS_CB;
+          }
         }
       }
     }
     break;
   }
 
   case eCSSUnit_Inherit:
     display->mWillChange = parentDisplay->mWillChange;
--- a/layout/style/nsStyleConsts.h
+++ b/layout/style/nsStyleConsts.h
@@ -238,16 +238,17 @@ enum class StyleBoxSizing : uint8_t {
 #define NS_COLOR_CONTEXT_FILL                   -7
 #define NS_COLOR_CONTEXT_STROKE                 -8
 
 // See nsStyleDisplay
 #define NS_STYLE_WILL_CHANGE_STACKING_CONTEXT   (1<<0)
 #define NS_STYLE_WILL_CHANGE_TRANSFORM          (1<<1)
 #define NS_STYLE_WILL_CHANGE_SCROLL             (1<<2)
 #define NS_STYLE_WILL_CHANGE_OPACITY            (1<<3)
+#define NS_STYLE_WILL_CHANGE_FIXPOS_CB          (1<<4)
 
 // See AnimationEffectReadOnly.webidl
 // and mozilla/dom/AnimationEffectReadOnlyBinding.h
 namespace dom {
 enum class PlaybackDirection : uint32_t;
 enum class FillMode : uint32_t;
 }