From 087669fc88dca5f2d2ca35e7c6e5d730bff6f0cd Mon Sep 17 00:00:00 2001 From: Chris Lord Date: Wed, 29 Feb 2012 16:45:50 +0000 Subject: [PATCH] Bug 729534 - Semi-fix scroll layer retention. r=mats When flattening the display list, the last child frame in a scroll layer is used to retain the associated ThebesLayer. Instead, use the first child, which tends to be more stable. This fixes retaining layers when scrolling through engadget.com. Fix by Robert O'Callahan --- layout/base/nsDisplayList.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/layout/base/nsDisplayList.cpp b/layout/base/nsDisplayList.cpp index 04d264048b6..f4e178d0632 100644 --- a/layout/base/nsDisplayList.cpp +++ b/layout/base/nsDisplayList.cpp @@ -2007,6 +2007,11 @@ nsDisplayScrollLayer::TryMerge(nsDisplayListBuilder* aBuilder, reinterpret_cast(GetScrollLayerCount() - 1)); mList.AppendToBottom(&other->mList); + // XXX - This ensures that the frame associated with a scroll layer after + // merging is the first, rather than the last. This tends to change less, + // ensuring we're more likely to retain the associated gfx layer. + // See Bug 729534 and Bug 731641. + mFrame = other->mFrame; return true; }