Bug 1271392 part 3 - Only merge in children from the EOC list that don't already have a prev-in-flow in this frame. r=dholbert

This commit is contained in:
Mats Palmgren 2016-05-18 13:49:33 +02:00
Родитель a1b690d0f2
Коммит 88e4ba9cfe
1 изменённых файлов: 32 добавлений и 5 удалений

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

@ -1673,15 +1673,42 @@ nsContainerFrame::DrainExcessOverflowContainersList(ChildFrameMerger aMergeFunc)
}
// Our own excess overflow containers from a previous reflow can still be
// present if our next-in-flow hasn't been reflown yet.
// present if our next-in-flow hasn't been reflown yet. Move any children
// from it that don't have a continuation in this frame to the
// OverflowContainers list.
nsFrameList* selfExcessOCFrames =
RemovePropTableFrames(ExcessOverflowContainersProperty());
if (selfExcessOCFrames) {
if (overflowContainers) {
aMergeFunc(*overflowContainers, *selfExcessOCFrames, this);
nsFrameList toMove;
auto child = selfExcessOCFrames->FirstChild();
while (child) {
auto next = child->GetNextSibling();
MOZ_ASSERT(child->GetPrevInFlow(),
"ExcessOverflowContainers frames must be continuations");
if (child->GetPrevInFlow()->GetParent() != this) {
selfExcessOCFrames->RemoveFrame(child);
toMove.AppendFrame(nullptr, child);
}
child = next;
}
if (toMove.IsEmpty()) {
SetPropTableFrames(selfExcessOCFrames, ExcessOverflowContainersProperty());
} else if (overflowContainers) {
aMergeFunc(*overflowContainers, toMove, this);
if (selfExcessOCFrames->IsEmpty()) {
selfExcessOCFrames->Delete(PresContext()->PresShell());
} else {
SetPropTableFrames(selfExcessOCFrames, ExcessOverflowContainersProperty());
}
} else {
if (selfExcessOCFrames->IsEmpty()) {
*selfExcessOCFrames = toMove;
overflowContainers = selfExcessOCFrames;
} else {
SetPropTableFrames(selfExcessOCFrames, ExcessOverflowContainersProperty());
auto shell = PresContext()->PresShell();
overflowContainers = new (shell) nsFrameList(toMove);
}
SetPropTableFrames(overflowContainers, OverflowContainersProperty());
}
}