Bug 966397. Part 2: Don't look at ancestors of mContainerReferenceFrame when searching for a fixed-pos ancestor we belong to, since we'll change coordinate spaces. The metadata will be attached to an ancestor layer in that case. r=mattwoodrow
authorRobert O'Callahan <robert@ocallahan.org>
Mon, 17 Feb 2014 14:51:49 +1300
changeset 169463 4df228e4fa8bb25bf68d91d9178dbeb2c8fde62e
parent 169462 1cbbc597b7b5385b78a0f97cb2e2da5a29d8c1cc
child 169464 7bbace751a5862c6c1cfe98a65bc52a73a1e09ab
push id270
push userpvanderbeken@mozilla.com
push dateThu, 06 Mar 2014 09:24:21 +0000
reviewersmattwoodrow
bugs966397
milestone30.0a1
Bug 966397. Part 2: Don't look at ancestors of mContainerReferenceFrame when searching for a fixed-pos ancestor we belong to, since we'll change coordinate spaces. The metadata will be attached to an ancestor layer in that case. r=mattwoodrow
layout/base/FrameLayerBuilder.cpp
--- a/layout/base/FrameLayerBuilder.cpp
+++ b/layout/base/FrameLayerBuilder.cpp
@@ -1685,16 +1685,20 @@ ContainerState::FindFixedPosFrameForLaye
     if (!viewport->GetFirstChild(nsIFrame::kFixedList)) {
       return nullptr;
     }
     for (const nsIFrame* f = aAnimatedGeometryRoot; f; f = f->GetParent()) {
       if (nsLayoutUtils::IsFixedPosFrameInDisplayPort(f, &displayPort)) {
         result = f;
         break;
       }
+      if (f == mContainerReferenceFrame) {
+        // The metadata will go on an ancestor layer if necessary.
+        return nullptr;
+      }
     }
     if (!result) {
       return nullptr;
     }
   }
 
   // Display ports are relative to the viewport, convert it to be relative
   // to our reference frame.