зеркало из https://github.com/mozilla/pjs.git
Fix WipeContainingBlock() to work in more cases. Bug 291902, bug 296086, bug
285964, bug 310933, r+sr=dbaron
This commit is contained in:
Родитель
75a7867512
Коммит
41ba4b6dae
|
@ -13147,6 +13147,18 @@ nsCSSFrameConstructor::WipeContainingBlock(nsFrameConstructorState& aState,
|
||||||
tmp.DestroyFrames(presContext);
|
tmp.DestroyFrames(presContext);
|
||||||
aState.mFloatedItems.childList = nsnull;
|
aState.mFloatedItems.childList = nsnull;
|
||||||
|
|
||||||
|
// If we don't have a containing block, try to find our closest non-inline
|
||||||
|
// ancestor. We're guaranteed to have one, since
|
||||||
|
// nsStyleContext::ApplyStyleFixups enforces that the root is display:none,
|
||||||
|
// display:table, or display:block.
|
||||||
|
if (!aContainingBlock) {
|
||||||
|
aContainingBlock = aFrame;
|
||||||
|
do {
|
||||||
|
aContainingBlock = aContainingBlock->GetParent();
|
||||||
|
NS_ASSERTION(aContainingBlock, "Must have non-inline frame as root!");
|
||||||
|
} while (IsInlineFrame(aContainingBlock));
|
||||||
|
}
|
||||||
|
|
||||||
// Tell parent of the containing block to reformulate the
|
// Tell parent of the containing block to reformulate the
|
||||||
// entire block. This is painful and definitely not optimal
|
// entire block. This is painful and definitely not optimal
|
||||||
// but it will *always* get the right answer.
|
// but it will *always* get the right answer.
|
||||||
|
@ -13169,8 +13181,8 @@ nsCSSFrameConstructor::WipeContainingBlock(nsFrameConstructorState& aState,
|
||||||
if (parentContainer) {
|
if (parentContainer) {
|
||||||
ReinsertContent(parentContainer, blockContent);
|
ReinsertContent(parentContainer, blockContent);
|
||||||
}
|
}
|
||||||
else {
|
else if (blockContent->GetCurrentDoc() == mDocument) {
|
||||||
NS_ERROR("uh oh. the block we need to reframe has no parent!");
|
ReconstructDocElementHierarchy();
|
||||||
}
|
}
|
||||||
return PR_TRUE;
|
return PR_TRUE;
|
||||||
}
|
}
|
||||||
|
|
Загрузка…
Ссылка в новой задаче