Bug 454751. Use a fresh nsFrameConstructorState when we construct new frames in ReconstructDocElementHierarchyInternal, so internal state pointing to deleted frames is flushed out. r+sr=bzbarsky

This commit is contained in:
Robert O'Callahan 2008-11-26 11:12:06 +13:00
parent 3f3b6013d1
commit 98a52f5f6c
3 changed files with 40 additions and 12 deletions

View File

@ -0,0 +1,20 @@
<?xml version="1.0"?>
<?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
<window xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" onload="addStyleSheet('window { display: table; }');">
<script type="text/javascript">
function addStyleSheet(text)
{
var sheet = document.createElementNS("http://www.w3.org/1999/xhtml", "style");
sheet.appendChild(document.createTextNode(text));
document.documentElement.appendChild(sheet);
}
</script>
<treecols/>
</window>

View File

@ -125,6 +125,7 @@ load 429088-2.html
load 432752-1.svg
load 433450-1.html
load 444925-1.xul
load 454751-1.xul
load 455063-1.html
load 455063-2.html
load 455063-3.html

View File

@ -7683,10 +7683,18 @@ nsCSSFrameConstructor::ReconstructDocElementHierarchyInternal()
return rv;
}
}
}
}
if (rootContent && NS_SUCCEEDED(rv)) {
mInitialContainingBlock = nsnull;
mRootElementStyleFrame = nsnull;
// We don't reuse the old frame constructor state because,
// for example, its mPopupItems may be stale
nsFrameConstructorState state(mPresShell, mFixedContainingBlock,
nsnull, nsnull, mTempFrameTreeState);
// Create the new document element hierarchy
nsIFrame* newChild;
rv = ConstructDocElementFrame(state, rootContent,
@ -7699,7 +7707,6 @@ nsCSSFrameConstructor::ReconstructDocElementHierarchyInternal()
}
}
}
}
return rv;
}