Bug 1221094 - Don't mutate local mParameters with stuff that we only want to pass somewhere else. r?mattwoodrow draft
authorMarkus Stange <mstange@themasta.com>
Fri, 04 Dec 2015 13:15:08 +0100
changeset 318190 45bc718213407413b68c1fbde0f1201db8e5f104
parent 318189 0dc1f6cc52806a8dfd0212210be32d7c27702e97
child 318191 1a7844269f10dbb7b01bef3181bfadecad3285cb
push id8848
push usermstange@themasta.com
push dateThu, 31 Dec 2015 15:26:17 +0000
reviewersmattwoodrow
bugs1221094
milestone46.0a1
Bug 1221094 - Don't mutate local mParameters with stuff that we only want to pass somewhere else. r?mattwoodrow
layout/base/FrameLayerBuilder.cpp
--- a/layout/base/FrameLayerBuilder.cpp
+++ b/layout/base/FrameLayerBuilder.cpp
@@ -4060,26 +4060,27 @@ ContainerState::ProcessDisplayItems(nsDi
         // be too small if the contents can move, because it only looks at the
         // contents' current bounds and doesn't anticipate any animations.
         // Time will tell whether this is good enough, or whether we need to do
         // something more sophisticated here.
         mPaintedLayerDataTree.AddingOwnLayer(animatedGeometryRoot,
                                              &itemVisibleRect, uniformColorPtr);
       }
 
-      mParameters.mBackgroundColor = uniformColor;
-      mParameters.mScrollClip = DisplayItemScrollClip::PickInnermost(agrScrollClip, mContainerScrollClip);
+      ContainerLayerParameters params = mParameters;
+      params.mScrollClip = DisplayItemScrollClip::PickInnermost(agrScrollClip, mContainerScrollClip);
+      params.mBackgroundColor = uniformColor;
 
       // Just use its layer.
       // Set layerContentsVisibleRect.width/height to -1 to indicate we
       // currently don't know. If BuildContainerLayerFor gets called by
       // item->BuildLayer, this will be set to a proper rect.
       nsIntRect layerContentsVisibleRect(0, 0, -1, -1);
-      mParameters.mLayerContentsVisibleRect = &layerContentsVisibleRect;
-      RefPtr<Layer> ownLayer = item->BuildLayer(mBuilder, mManager, mParameters);
+      params.mLayerContentsVisibleRect = &layerContentsVisibleRect;
+      RefPtr<Layer> ownLayer = item->BuildLayer(mBuilder, mManager, params);
       if (!ownLayer) {
         continue;
       }
 
       NS_ASSERTION(!ownLayer->AsPaintedLayer(),
                    "Should never have created a dedicated Painted layer!");
 
       if (item->BackfaceIsHidden()) {