Handle XUL popups gracefully in non-XUL documents. Bug 306940, r+sr=roc, a=dveditz for 1.8.0.7, a=schrep for 1.8.1
git-svn-id: svn://10.0.0.236/branches/MOZILLA_1_8_BRANCH@208154 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
@@ -6324,7 +6324,7 @@ nsCSSFrameConstructor::ConstructXULFrame(nsFrameConstructorState& aState,
|
||||
if (rootFrame)
|
||||
rootFrame = rootFrame->GetFirstChild(nsnull);
|
||||
nsCOMPtr<nsIRootBox> rootBox(do_QueryInterface(rootFrame));
|
||||
NS_ASSERTION(rootBox, "unexpected null pointer");
|
||||
PRBool added = PR_FALSE;
|
||||
if (rootBox) {
|
||||
nsIFrame* popupSetFrame;
|
||||
rootBox->GetPopupSetFrame(&popupSetFrame);
|
||||
@@ -6332,13 +6332,25 @@ nsCSSFrameConstructor::ConstructXULFrame(nsFrameConstructorState& aState,
|
||||
if (popupSetFrame) {
|
||||
nsCOMPtr<nsIPopupSetFrame> popupSet(do_QueryInterface(popupSetFrame));
|
||||
NS_ASSERTION(popupSet, "unexpected null pointer");
|
||||
if (popupSet)
|
||||
if (popupSet) {
|
||||
added = PR_TRUE;
|
||||
popupSet->AddPopupFrame(newFrame);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Add the placeholder frame to the flow
|
||||
aFrameItems.AddChild(placeholderFrame);
|
||||
if (added) {
|
||||
// Add the placeholder frame to the flow
|
||||
aFrameItems.AddChild(placeholderFrame);
|
||||
} else {
|
||||
// Didn't add the popup set frame... Need to clean up and
|
||||
// just not construct a frame here.
|
||||
aState.mFrameManager->UnregisterPlaceholderFrame(NS_STATIC_CAST(nsPlaceholderFrame*, placeholderFrame));
|
||||
newFrame->Destroy(aState.mPresContext);
|
||||
placeholderFrame->Destroy(aState.mPresContext);
|
||||
*aHaltProcessing = PR_TRUE;
|
||||
return NS_OK;
|
||||
}
|
||||
} else {
|
||||
#endif
|
||||
// Add the new frame to our list of frame items. Note that we
|
||||
|
||||
Reference in New Issue
Block a user