Bug 966397. Don't try to add fixed-pos metadata for inactive layer subtrees. r=mattwoodrow
authorRobert O'Callahan <robert@ocallahan.org>
Mon, 17 Feb 2014 14:51:49 +1300
changeset 169462 1cbbc597b7b5385b78a0f97cb2e2da5a29d8c1cc
parent 169461 4e6633cbb6975e60ceb0beed6f2020317517be0a
child 169463 4df228e4fa8bb25bf68d91d9178dbeb2c8fde62e
push id270
push userpvanderbeken@mozilla.com
push dateThu, 06 Mar 2014 09:24:21 +0000
reviewersmattwoodrow
bugs966397
milestone30.0a1
Bug 966397. Don't try to add fixed-pos metadata for inactive layer subtrees. r=mattwoodrow
layout/base/FrameLayerBuilder.cpp
--- a/layout/base/FrameLayerBuilder.cpp
+++ b/layout/base/FrameLayerBuilder.cpp
@@ -1661,16 +1661,21 @@ ThebesLayerData::CanOptimizeImageLayer(n
 }
 
 const nsIFrame*
 ContainerState::FindFixedPosFrameForLayerData(const nsIFrame* aAnimatedGeometryRoot,
                                               const nsIntRegion& aDrawRegion,
                                               nsIntRegion* aVisibleRegion,
                                               bool* aIsSolidColorInVisibleRegion)
 {
+  if (!mManager->IsWidgetLayerManager()) {
+    // Never attach any fixed-pos metadata to inactive layers, it's pointless!
+    return nullptr;
+  }
+
   nsPresContext* presContext = mContainerFrame->PresContext();
   nsIFrame* viewport = presContext->PresShell()->GetRootFrame();
   const nsIFrame* result = nullptr;
   nsRect displayPort;
 
   if (viewport == aAnimatedGeometryRoot &&
       nsLayoutUtils::ViewportHasDisplayPort(presContext, &displayPort)) {
     // Probably a background-attachment:fixed item