From d71824c07dccaf273ade632cc8d3aef195c7f366 Mon Sep 17 00:00:00 2001 From: "leaf%mozilla.org" Date: Fri, 19 Jul 2002 21:58:09 +0000 Subject: [PATCH] backout dataloss-causing fixes for 143862 and 156719, a=asa git-svn-id: svn://10.0.0.236/trunk@125515 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/content/html/content/src/nsHTMLOptionElement.cpp | 6 +----- mozilla/content/html/content/src/nsHTMLSelectElement.cpp | 7 +------ mozilla/layout/base/nsCSSFrameConstructor.cpp | 8 -------- mozilla/layout/html/style/src/nsCSSFrameConstructor.cpp | 8 -------- mozilla/layout/xul/base/src/nsRootBoxFrame.cpp | 9 +++------ 5 files changed, 5 insertions(+), 33 deletions(-) diff --git a/mozilla/content/html/content/src/nsHTMLOptionElement.cpp b/mozilla/content/html/content/src/nsHTMLOptionElement.cpp index b465ea974db..29b745ca9e3 100644 --- a/mozilla/content/html/content/src/nsHTMLOptionElement.cpp +++ b/mozilla/content/html/content/src/nsHTMLOptionElement.cpp @@ -311,11 +311,7 @@ nsHTMLOptionElement::GetSelected(PRBool* aValue) // This does not need to be SetSelected (which sets selected in the select) // because we *will* be initialized when we are placed into a select. Plus // it seems like that's just inviting an infinite loop. - // We can pass |aNotify == PR_FALSE| since |GetSelected| is called - // from |nsHTMLSelectElement::InsertOptionsIntoList|, which is - // guaranteed to be called before frames are created for the - // content. - SetSelectedInternal(selected, PR_FALSE); + SetSelectedInternal(selected, PR_TRUE); } *aValue = mIsSelected; diff --git a/mozilla/content/html/content/src/nsHTMLSelectElement.cpp b/mozilla/content/html/content/src/nsHTMLSelectElement.cpp index 3983a19c07d..54f306b1ea7 100644 --- a/mozilla/content/html/content/src/nsHTMLSelectElement.cpp +++ b/mozilla/content/html/content/src/nsHTMLSelectElement.cpp @@ -466,7 +466,7 @@ nsHTMLSelectElement::InsertOptionsIntoList(nsIContent* aOptions, // This is sort of a hack ... we need to notify that the option was // set and change selectedIndex even though we didn't really change // its value. - OnOptionSelected(selectFrame, presContext, i, PR_TRUE, PR_FALSE); + OnOptionSelected(selectFrame, presContext, i, PR_TRUE, PR_TRUE); } } } @@ -655,11 +655,6 @@ nsHTMLSelectElement::RemoveOptionsFromListRecurse(nsIContent* aOptions, return NS_OK; } -// XXXldb Doing the processing before the content nodes have been added -// to the document (as the name of this function seems to require, and -// as the callers do), is highly unusual. Passing around unparented -// content to other parts of the app can make those things think the -// options are the root content node. NS_IMETHODIMP nsHTMLSelectElement::WillAddOptions(nsIContent* aOptions, nsIContent* aParent, diff --git a/mozilla/layout/base/nsCSSFrameConstructor.cpp b/mozilla/layout/base/nsCSSFrameConstructor.cpp index b2149f28aef..74d33afc082 100644 --- a/mozilla/layout/base/nsCSSFrameConstructor.cpp +++ b/mozilla/layout/base/nsCSSFrameConstructor.cpp @@ -12225,14 +12225,6 @@ nsCSSFrameConstructor::RecreateFramesForContent(nsIPresContext* aPresContext, rv = ContentInserted(aPresContext, container, aContent, indexInContainer, mTempFrameTreeState, PR_FALSE); } } - } else { - // The content is the root node, so just rebuild the world. -#ifdef DEBUG - nsCOMPtr doc; - aContent->GetDocument(*getter_AddRefs(doc)); - NS_ASSERTION(doc, "content not in document"); -#endif - ReconstructDocElementHierarchy(aPresContext); } return rv; } diff --git a/mozilla/layout/html/style/src/nsCSSFrameConstructor.cpp b/mozilla/layout/html/style/src/nsCSSFrameConstructor.cpp index b2149f28aef..74d33afc082 100644 --- a/mozilla/layout/html/style/src/nsCSSFrameConstructor.cpp +++ b/mozilla/layout/html/style/src/nsCSSFrameConstructor.cpp @@ -12225,14 +12225,6 @@ nsCSSFrameConstructor::RecreateFramesForContent(nsIPresContext* aPresContext, rv = ContentInserted(aPresContext, container, aContent, indexInContainer, mTempFrameTreeState, PR_FALSE); } } - } else { - // The content is the root node, so just rebuild the world. -#ifdef DEBUG - nsCOMPtr doc; - aContent->GetDocument(*getter_AddRefs(doc)); - NS_ASSERTION(doc, "content not in document"); -#endif - ReconstructDocElementHierarchy(aPresContext); } return rv; } diff --git a/mozilla/layout/xul/base/src/nsRootBoxFrame.cpp b/mozilla/layout/xul/base/src/nsRootBoxFrame.cpp index 638b9df060f..e26438cb964 100644 --- a/mozilla/layout/xul/base/src/nsRootBoxFrame.cpp +++ b/mozilla/layout/xul/base/src/nsRootBoxFrame.cpp @@ -289,12 +289,9 @@ nsRootBoxFrame::GetPopupSetFrame(nsIFrame** aResult) NS_IMETHODIMP nsRootBoxFrame::SetPopupSetFrame(nsIFrame* aPopupSet) { - // Under normal conditions this should only be called once. However, - // if something triggers ReconstructDocElementHierarchy, we will - // destroy this frame's child (the nsDocElementBoxFrame), but not this - // frame. Since the anonymous content is associated with the - // nsDocElementBoxFrame, we'll get a new popupset. - mPopupSetFrame = aPopupSet; + NS_ASSERTION(!mPopupSetFrame, "Popup set is already defined! Only 1 allowed."); + if (!mPopupSetFrame) + mPopupSetFrame = aPopupSet; return NS_OK; }