mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-16 14:55:47 +00:00
Bail out of ReconstructDocElementHierarchy early if there is no root frame(which shouldn't even happen!). Bug 377850, r=mats, sr=dbaron
This commit is contained in:
parent
073d7a78a6
commit
d32b8338c4
@ -7645,6 +7645,10 @@ nsCSSFrameConstructor::ReconstructDocElementHierarchyInternal()
|
||||
// Get the frame that corresponds to the document element
|
||||
nsIFrame* docElementFrame =
|
||||
state.mFrameManager->GetPrimaryFrameFor(rootContent, -1);
|
||||
if (!docElementFrame) {
|
||||
NS_NOTREACHED("Really should have doc element frame here");
|
||||
return NS_ERROR_UNEXPECTED;
|
||||
}
|
||||
|
||||
// Remove any existing fixed items: they are always on the
|
||||
// FixedContainingBlock. Note that this has to be done before we call
|
||||
@ -7658,21 +7662,18 @@ nsCSSFrameConstructor::ReconstructDocElementHierarchyInternal()
|
||||
state.mFrameManager->ClearPlaceholderFrameMap();
|
||||
state.mFrameManager->ClearUndisplayedContentMap();
|
||||
|
||||
if (docElementFrame) {
|
||||
// Take the docElementFrame, and remove it from its parent.
|
||||
// Take the docElementFrame, and remove it from its parent.
|
||||
|
||||
// XXXbz So why can't we reuse ContentRemoved?
|
||||
// XXXbz So why can't we reuse ContentRemoved?
|
||||
|
||||
NS_ASSERTION(docElementFrame->GetParent() == mDocElementContainingBlock,
|
||||
"Unexpected doc element parent frame");
|
||||
|
||||
// Remove the old document element hieararchy
|
||||
rv = state.mFrameManager->RemoveFrame(mDocElementContainingBlock,
|
||||
nsnull, docElementFrame);
|
||||
if (NS_FAILED(rv)) {
|
||||
return rv;
|
||||
}
|
||||
NS_ASSERTION(docElementFrame->GetParent() == mDocElementContainingBlock,
|
||||
"Unexpected doc element parent frame");
|
||||
|
||||
// Remove the old document element hieararchy
|
||||
rv = state.mFrameManager->RemoveFrame(mDocElementContainingBlock,
|
||||
nsnull, docElementFrame);
|
||||
if (NS_FAILED(rv)) {
|
||||
return rv;
|
||||
}
|
||||
|
||||
// Create the new document element hierarchy
|
||||
|
Loading…
Reference in New Issue
Block a user