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
Родитель 7a907f23ca
Коммит b2b28bfe30
3 изменённых файлов: 40 добавлений и 12 удалений

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

@ -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>

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

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

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

@ -7683,20 +7683,27 @@ nsCSSFrameConstructor::ReconstructDocElementHierarchyInternal()
return rv; return rv;
} }
} }
}
mInitialContainingBlock = nsnull; }
mRootElementStyleFrame = nsnull;
if (rootContent && NS_SUCCEEDED(rv)) {
mInitialContainingBlock = nsnull;
mRootElementStyleFrame = nsnull;
// Create the new document element hierarchy // We don't reuse the old frame constructor state because,
nsIFrame* newChild; // for example, its mPopupItems may be stale
rv = ConstructDocElementFrame(state, rootContent, nsFrameConstructorState state(mPresShell, mFixedContainingBlock,
mDocElementContainingBlock, &newChild); nsnull, nsnull, mTempFrameTreeState);
// newChild could be null even if |rv| is success, thanks to XBL. // Create the new document element hierarchy
if (NS_SUCCEEDED(rv) && newChild) { nsIFrame* newChild;
rv = state.mFrameManager->InsertFrames(mDocElementContainingBlock, rv = ConstructDocElementFrame(state, rootContent,
nsnull, nsnull, newChild); mDocElementContainingBlock, &newChild);
}
// newChild could be null even if |rv| is success, thanks to XBL.
if (NS_SUCCEEDED(rv) && newChild) {
rv = state.mFrameManager->InsertFrames(mDocElementContainingBlock,
nsnull, nsnull, newChild);
} }
} }
} }