Bug 959847. Part 6. Only call RecordFrameMetrics from PaintForFrame if we are ignoring viewport scrolling so that we don't call it twice for the same scroll frame (the other one being the scroll layers created by nsGfxScrollFrame). r=roc
authorTimothy Nikkel <tnikkel@gmail.com>
Thu, 27 Feb 2014 16:01:53 -0600
changeset 171558 ed8cade5616fb0039c9ca5d31d1d129d576b3496
parent 171557 c984b7ac2a845b4734f6e4731473df7c6c6c905a
child 171559 dc9252c6de8d95034ebdf7643e15559b4809df2f
push id270
push userpvanderbeken@mozilla.com
push dateThu, 06 Mar 2014 09:24:21 +0000
reviewersroc
bugs959847
milestone30.0a1
Bug 959847. Part 6. Only call RecordFrameMetrics from PaintForFrame if we are ignoring viewport scrolling so that we don't call it twice for the same scroll frame (the other one being the scroll layers created by nsGfxScrollFrame). r=roc
layout/base/nsDisplayList.cpp
--- a/layout/base/nsDisplayList.cpp
+++ b/layout/base/nsDisplayList.cpp
@@ -1239,22 +1239,27 @@ void nsDisplayList::PaintForFrame(nsDisp
       if (isRoot) {
         id = nsLayoutUtils::FindOrCreateIDFor(content);
       }
     }
   }
 
   nsRect viewport(aBuilder->ToReferenceFrame(aForFrame), aForFrame->GetSize());
 
-  RecordFrameMetrics(aForFrame, rootScrollFrame,
-                     aBuilder->FindReferenceFrameFor(aForFrame),
-                     root, mVisibleRect, viewport,
-                     (usingDisplayport ? &displayport : nullptr),
-                     (usingCriticalDisplayport ? &criticalDisplayport : nullptr),
-                     id, isRoot, containerParameters);
+  // If we are ignoring the root scroll frame we make the RecordFrameMetrics
+  // call for it. Otherwise nsGfxScrollFrame will create scroll layer(s) that
+  // will do that.
+  if (aBuilder->GetIgnoreScrollFrame() == rootScrollFrame) {
+    RecordFrameMetrics(aForFrame, rootScrollFrame,
+                       aBuilder->FindReferenceFrameFor(aForFrame),
+                       root, mVisibleRect, viewport,
+                       (usingDisplayport ? &displayport : nullptr),
+                       (usingCriticalDisplayport ? &criticalDisplayport : nullptr),
+                       id, isRoot, containerParameters);
+  }
   if (usingDisplayport &&
       !(root->GetContentFlags() & Layer::CONTENT_OPAQUE)) {
     // See bug 693938, attachment 567017
     NS_WARNING("Transparent content with displayports can be expensive.");
   }
 
   layerManager->SetRoot(root);
   layerBuilder->WillEndTransaction();