Bug 1180899 - Do not clobber frame metrics on the root layer added during a previous paint if there is no other frame metrics for the root scroll frame. r=tn

--HG--
extra : rebase_source : 25f54891b69373fd570ad86f9e2aaed852c10d03
extra : source : b0c9f2c474e9b446fb008023c6e7f423931e59cd
This commit is contained in:
Botond Ballo 2015-07-13 17:48:14 -04:00
Родитель dbf162b6fd
Коммит acce0aee65
1 изменённых файлов: 7 добавлений и 3 удалений

Просмотреть файл

@ -1541,6 +1541,13 @@ already_AddRefed<LayerManager> nsDisplayList::PaintRoot(nsDisplayListBuilder* aB
props = Move(LayerProperties::CloneFrom(layerManager->GetRoot()));
}
// Clear any FrameMetrics that may have been set on the root layer on a
// previous paint. This paint will set new metrics if necessary, and if we
// don't clear the old one here, we may be left with extra metrics.
if (Layer* root = layerManager->GetRoot()) {
root->SetFrameMetrics(nsTArray<FrameMetrics>());
}
ContainerLayerParameters containerParameters
(presShell->GetResolution(), presShell->GetResolution());
nsRefPtr<ContainerLayer> root = layerBuilder->
@ -1616,9 +1623,6 @@ already_AddRefed<LayerManager> nsDisplayList::PaintRoot(nsDisplayListBuilder* aB
aBuilder->FindReferenceFrameFor(frame),
root, FrameMetrics::NULL_SCROLL_ID, viewport, Nothing(),
isRootContent, containerParameters));
} else {
// Set empty metrics to clear any metrics that might be on a recycled layer.
root->SetFrameMetrics(nsTArray<FrameMetrics>());
}
// NS_WARNING is debug-only, so don't even bother checking the conditions in