Bug 942189 - Only avoid creating scroll info layers for root scroll frames in display root documents (not root content documents) because those have already had RecordFrameMetrics on them. r=roc, a=lsblakk
authorTimothy Nikkel <tnikkel@gmail.com>
Fri, 03 Jan 2014 14:48:57 -0600
changeset 175786 3bee85121042b1d0da47b2bfc4392dfa74628153
parent 175785 1ff5838f2a32871bd7f54d8086cec4bf6dd255bd
child 175787 1222ad5d15b402a10187678be338bc80f452f121
push id445
push userffxbld
push dateMon, 10 Mar 2014 22:05:19 +0000
treeherdermozilla-release@dc38b741b04e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersroc, lsblakk
bugs942189
milestone28.0a2
Bug 942189 - Only avoid creating scroll info layers for root scroll frames in display root documents (not root content documents) because those have already had RecordFrameMetrics on them. r=roc, a=lsblakk
layout/generic/nsGfxScrollFrame.cpp
--- a/layout/generic/nsGfxScrollFrame.cpp
+++ b/layout/generic/nsGfxScrollFrame.cpp
@@ -2422,17 +2422,20 @@ ScrollFrameHelper::BuildDisplayList(nsDi
 #ifdef XP_WIN
     if (XRE_GetWindowsEnvironment() == WindowsEnvironmentType_Metro) {
       wantSubAPZC = true;
     }
 #endif
     shouldBuildLayer =
       wantSubAPZC &&
       (wantLayerV || wantLayerH) &&
-      (!mIsRoot || !mOuter->PresContext()->IsRootContentDocument());
+      // If we are the root scroll frame for the display root then we don't need a scroll
+      // info layer to make a RecordFrameMetrics call for us as
+      // nsDisplayList::PaintForFrame already calls RecordFrameMetrics for us.
+      (!mIsRoot || aBuilder->RootReferenceFrame()->PresContext() != mOuter->PresContext());
   }
 
   if (shouldBuildLayer) {
     // ScrollLayerWrapper must always be created because it initializes the
     // scroll layer count. The display lists depend on this.
     ScrollLayerWrapper wrapper(mOuter, mScrolledFrame);
 
     if (mShouldBuildScrollableLayer) {