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
--- 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();