Bug 950993 - Fix async scrolling of fixed layers within scrollable sub-layers. r=roc

Fixed layers are relative to their nearest scrollable ancestor, so when we
encounter a scrollable layer in AlignFixedAndStickyLayers, reset the transform
and sub-tree root to start from that scrollable layer.

This fixes async scrolling of the fixed header in the Firefox marketplace on
B2G.
This commit is contained in:
Chris Lord 2014-01-15 12:15:50 +00:00
Родитель 4db7806fe4
Коммит 9123b70f17
1 изменённых файлов: 10 добавлений и 0 удалений

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

@ -326,6 +326,16 @@ AsyncCompositionManager::AlignFixedAndStickyLayers(Layer* aLayer,
return;
}
// Fixed layers are relative to their nearest scrollable layer, so when we
// encounter a scrollable layer, reset the transform to that layer and remove
// the fixed margins.
if (aLayer->AsContainerLayer() &&
aLayer->AsContainerLayer()->GetFrameMetrics().IsScrollable() &&
aLayer != aTransformedSubtreeRoot) {
AlignFixedAndStickyLayers(aLayer, aLayer, aLayer->GetTransform(), LayerMargin(0, 0, 0, 0));
return;
}
for (Layer* child = aLayer->GetFirstChild();
child; child = child->GetNextSibling()) {
AlignFixedAndStickyLayers(child, aTransformedSubtreeRoot,