Bug 838688 - Make ReparentFloats/CollectFloats not require a priori knowledge of which child list a float is expected to be on. r=bzbarsky

This commit is contained in:
Mats Palmgren
2013-02-28 00:05:45 +01:00
parent 7d8b692140
commit 69c777f14a
3 changed files with 30 additions and 35 deletions

View File

@@ -243,9 +243,7 @@ nsInlineFrame::ReparentFloatsForInlineChild(nsIFrame* aOurLineContainer,
}
nsIFrame* ancestor = aFrame;
nsIFrame* ancestorBlockChild;
do {
ancestorBlockChild = ancestor;
ancestor = ancestor->GetParent();
if (!ancestor)
return;
@@ -259,11 +257,8 @@ nsInlineFrame::ReparentFloatsForInlineChild(nsIFrame* aOurLineContainer,
nsBlockFrame* frameBlock = nsLayoutUtils::GetAsBlock(ancestor);
NS_ASSERTION(frameBlock, "ancestor not a block");
const nsFrameList& blockChildren(ancestor->PrincipalChildList());
bool isOverflow = !blockChildren.ContainsFrame(ancestorBlockChild);
while (true) {
ourBlock->ReparentFloats(aFrame, frameBlock, isOverflow, false);
ourBlock->ReparentFloats(aFrame, frameBlock, false);
if (!aReparentSiblings)
return;