Bug 959847. Part 5. Only call RecordFrameMetrics for subdocuments 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

This commit is contained in:
Timothy Nikkel 2014-02-27 16:01:53 -06:00
parent c5eadf4d6e
commit c1ef4c92c7

View File

@ -464,24 +464,30 @@ nsSubDocumentFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder,
// created, we don't need to create a separate nsDisplaySubDocument. // created, we don't need to create a separate nsDisplaySubDocument.
uint32_t flags = nsDisplayOwnLayer::GENERATE_SUBDOC_INVALIDATIONS; uint32_t flags = nsDisplayOwnLayer::GENERATE_SUBDOC_INVALIDATIONS;
// We also want to add nsDisplayOwnLayer::GENERATE_SCROLLABLE_LAYER to whatever // If ignoreViewportScrolling is true then the top most layer we create here
// layer becomes the topmost. We do this below. // is going to become the scrollable layer for the root scroll frame, so we
// want to add nsDisplayOwnLayer::GENERATE_SCROLLABLE_LAYER to whatever layer
// becomes the topmost. We do this below.
if (constructZoomItem) { if (constructZoomItem) {
uint32_t zoomFlags = flags;
if (ignoreViewportScrolling && !constructResolutionItem) {
zoomFlags |= nsDisplayOwnLayer::GENERATE_SCROLLABLE_LAYER;
}
nsDisplayZoom* zoomItem = nsDisplayZoom* zoomItem =
new (aBuilder) nsDisplayZoom(aBuilder, subdocRootFrame, &childItems, new (aBuilder) nsDisplayZoom(aBuilder, subdocRootFrame, &childItems,
subdocAPD, parentAPD, subdocAPD, parentAPD, zoomFlags);
flags |
(constructResolutionItem ?
0 : nsDisplayOwnLayer::GENERATE_SCROLLABLE_LAYER));
childItems.AppendToTop(zoomItem); childItems.AppendToTop(zoomItem);
needsOwnLayer = false; needsOwnLayer = false;
} }
// Wrap the zoom item in the resolution item if we have both because we want the // Wrap the zoom item in the resolution item if we have both because we want the
// resolution scale applied on top of the app units per dev pixel conversion. // resolution scale applied on top of the app units per dev pixel conversion.
if (ignoreViewportScrolling) {
flags |= nsDisplayOwnLayer::GENERATE_SCROLLABLE_LAYER;
}
if (constructResolutionItem) { if (constructResolutionItem) {
nsDisplayResolution* resolutionItem = nsDisplayResolution* resolutionItem =
new (aBuilder) nsDisplayResolution(aBuilder, subdocRootFrame, &childItems, new (aBuilder) nsDisplayResolution(aBuilder, subdocRootFrame, &childItems,
flags | nsDisplayOwnLayer::GENERATE_SCROLLABLE_LAYER); flags);
childItems.AppendToTop(resolutionItem); childItems.AppendToTop(resolutionItem);
needsOwnLayer = false; needsOwnLayer = false;
} }
@ -489,7 +495,7 @@ nsSubDocumentFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder,
// We always want top level content documents to be in their own layer. // We always want top level content documents to be in their own layer.
nsDisplaySubDocument* layerItem = new (aBuilder) nsDisplaySubDocument( nsDisplaySubDocument* layerItem = new (aBuilder) nsDisplaySubDocument(
aBuilder, subdocRootFrame ? subdocRootFrame : this, aBuilder, subdocRootFrame ? subdocRootFrame : this,
&childItems, flags | nsDisplayOwnLayer::GENERATE_SCROLLABLE_LAYER); &childItems, flags);
childItems.AppendToTop(layerItem); childItems.AppendToTop(layerItem);
} }