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 <robert@ocallahan.org>
This commit is contained in:
Chris Lord 2012-02-29 17:01:50 +00:00
parent d6487f0c45
commit 8411b7d48d

View File

@ -2007,6 +2007,11 @@ nsDisplayScrollLayer::TryMerge(nsDisplayListBuilder* aBuilder,
reinterpret_cast<void*>(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;
}