Backing out due to mochitest failure

This commit is contained in:
jonas@sicking.cc 2007-11-29 01:34:51 -08:00
Родитель 32cfa72536
Коммит 929e6f34af
13 изменённых файлов: 30 добавлений и 87 удалений

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

@ -62,8 +62,8 @@ class nsIDocShell;
// IID for the nsIContent interface
#define NS_ICONTENT_IID \
{ 0xe0c5d967, 0x2c15, 0x4097, \
{ 0xb0, 0xdc, 0x75, 0xa3, 0xa7, 0xfc, 0xcd, 0x1a } }
{ 0x36b375cb, 0xf01e, 0x4c18, \
{ 0xbf, 0x9e, 0xba, 0xad, 0x77, 0x1d, 0xce, 0x22 } }
// hack to make egcs / gcc 2.95.2 happy
class nsIContent_base : public nsINode {
@ -792,12 +792,6 @@ public:
*/
virtual void UpdateEditableState();
/**
* Destroy this node and it's children. Ideally this shouldn't be needed
* but for now we need to do it to break cycles.
*/
virtual void DestroyContent() = 0;
#ifdef DEBUG
/**
* List the content (and anything it contains) out to the given

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

@ -2057,10 +2057,7 @@ SubDocClearEntry(PLDHashTable *table, PLDHashEntryHdr *entry)
SubDocMapEntry *e = static_cast<SubDocMapEntry *>(entry);
NS_RELEASE(e->mKey);
if (e->mSubDocument) {
e->mSubDocument->SetParentDocument(nsnull);
NS_RELEASE(e->mSubDocument);
}
NS_IF_RELEASE(e->mSubDocument);
}
PR_STATIC_CALLBACK(PRBool)
@ -2093,6 +2090,8 @@ nsDocument::SetSubDocumentFor(nsIContent *aContent, nsIDocument* aSubDoc)
PL_DHASH_LOOKUP));
if (PL_DHASH_ENTRY_IS_BUSY(entry)) {
entry->mSubDocument->SetParentDocument(nsnull);
PL_DHashTableRawRemove(mSubDocuments, entry);
}
}
@ -5581,16 +5580,26 @@ nsDocument::Destroy()
if (mIsGoingAway)
return;
PRInt32 count = mChildren.ChildCount();
mIsGoingAway = PR_TRUE;
PRUint32 i, count = mChildren.ChildCount();
for (i = 0; i < count; ++i) {
mChildren.ChildAt(i)->DestroyContent();
DestroyLinkMap();
for (PRInt32 indx = 0; indx < count; ++indx) {
// XXXbz what we _should_ do here is to clear mChildren and null out
// mRootContent. If we did this (or at least the latter), we could remove
// the silly null-checks in nsHTMLDocument::MatchLinks. Unfortunately,
// doing that introduces several problems:
// 1) Focus issues (see bug 341730). The fix for bug 303260 may fix these.
// 2) Crashes in OnPageHide if it fires after Destroy. See bug 303260
// comments 9 and 10.
// So we're just creating an inconsistent DOM for now and hoping. :(
mChildren.ChildAt(indx)->UnbindFromTree();
}
mLayoutHistoryState = nsnull;
nsContentList::OnDocumentDestroy(this);
delete mContentWrapperHash;
mContentWrapperHash = nsnull;
}
already_AddRefed<nsILayoutHistoryState>

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

@ -811,10 +811,6 @@ nsGenericDOMDataNode::IsNodeOfType(PRUint32 aFlags) const
return !(aFlags & ~(eCONTENT | eDATA_NODE));
}
void
nsGenericDOMDataNode::DestroyContent()
{
}
#ifdef DEBUG
void

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

@ -225,7 +225,6 @@ public:
PRBool aNotify);
virtual PRBool TextIsOnlyWhitespace();
virtual void AppendTextTo(nsAString& aResult);
virtual void DestroyContent();
#ifdef DEBUG
virtual void List(FILE* out, PRInt32 aIndent) const;
virtual void DumpContent(FILE* out, PRInt32 aIndent, PRBool aDumpAll) const;

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

@ -2857,22 +2857,6 @@ nsGenericElement::GetPrimaryFrameFor(nsIContent* aContent,
return presShell->GetPrimaryFrameFor(aContent);
}
void
nsGenericElement::DestroyContent()
{
nsIDocument *document = GetOwnerDoc();
if (document) {
document->BindingManager()->ChangeDocumentFor(this, document, nsnull);
document->ClearBoxObjectFor(this);
}
PRUint32 i, count = mAttrsAndChildren.ChildCount();
for (i = 0; i < count; ++i) {
// The child can remove itself from the parent in BindToTree.
mAttrsAndChildren.ChildAt(i)->DestroyContent();
}
}
//----------------------------------------------------------------------
// Generic DOMNode implementations
@ -3364,11 +3348,8 @@ NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN(nsGenericElement)
// Unlink any DOM slots of interest.
{
nsDOMSlots *slots = tmp->GetExistingDOMSlots();
if (slots) {
if (slots)
slots->mAttributeMap = nsnull;
if (tmp->IsNodeOfType(nsINode::eXUL))
NS_IF_RELEASE(slots->mControllers);
}
}
NS_IMPL_CYCLE_COLLECTION_UNLINK_END

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

@ -434,7 +434,6 @@ public:
virtual PRUint32 GetScriptTypeID() const;
virtual nsresult SetScriptTypeID(PRUint32 aLang);
virtual void DestroyContent();
#ifdef DEBUG
virtual void List(FILE* out, PRInt32 aIndent) const
{

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

@ -3066,17 +3066,6 @@ nsGenericHTMLFrameElement::SetAttr(PRInt32 aNameSpaceID, nsIAtom* aName,
return rv;
}
void
nsGenericHTMLFrameElement::DestroyContent()
{
if (mFrameLoader) {
mFrameLoader->Destroy();
mFrameLoader = nsnull;
}
nsGenericHTMLElement::DestroyContent();
}
//----------------------------------------------------------------------
void

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

@ -933,7 +933,6 @@ public:
virtual nsresult SetAttr(PRInt32 aNameSpaceID, nsIAtom* aName,
nsIAtom* aPrefix, const nsAString& aValue,
PRBool aNotify);
virtual void DestroyContent();
// nsIDOMNSHTMLElement
NS_IMETHOD GetTabIndex(PRInt32 *aTabIndex);

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

@ -323,7 +323,7 @@ protected:
/** The request currently being submitted */
nsCOMPtr<nsIRequest> mSubmittingRequest;
/** The web progress object we are currently listening to */
nsWeakPtr mWebProgress;
nsCOMPtr<nsIWebProgress> mWebProgress;
/** The default submit element -- WEAK */
nsIFormControl* mDefaultSubmitElement;
@ -1103,12 +1103,10 @@ nsHTMLFormElement::SubmitSubmission(nsIFormSubmission* aFormSubmission)
PRBool pending = PR_FALSE;
mSubmittingRequest->IsPending(&pending);
if (pending && !schemeIsJavaScript) {
nsCOMPtr<nsIWebProgress> webProgress = do_GetInterface(docShell);
NS_ASSERTION(webProgress, "nsIDocShell not converted to nsIWebProgress!");
rv = webProgress->AddProgressListener(this, nsIWebProgress::NOTIFY_STATE_ALL);
mWebProgress = do_GetInterface(docShell);
NS_ASSERTION(mWebProgress, "nsIDocShell not converted to nsIWebProgress!");
rv = mWebProgress->AddProgressListener(this, nsIWebProgress::NOTIFY_STATE_ALL);
NS_ENSURE_SUBMIT_SUCCESS(rv);
mWebProgress = do_GetWeakReference(webProgress);
NS_ASSERTION(mWebProgress, "can't hold weak ref to webprogress!");
} else {
ForgetCurrentSubmission();
}
@ -1725,11 +1723,10 @@ nsHTMLFormElement::ForgetCurrentSubmission()
mNotifiedObservers = PR_FALSE;
mIsSubmitting = PR_FALSE;
mSubmittingRequest = nsnull;
nsCOMPtr<nsIWebProgress> webProgress = do_QueryReferent(mWebProgress);
if (webProgress) {
webProgress->RemoveProgressListener(this);
}
if (mWebProgress) {
mWebProgress->RemoveProgressListener(this);
mWebProgress = nsnull;
}
}
// nsIWebProgressListener

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

@ -104,15 +104,8 @@ nsXTFElementWrapper::Init()
//----------------------------------------------------------------------
// nsISupports implementation
NS_IMPL_ADDREF_INHERITED(nsXTFElementWrapper, nsXTFElementWrapperBase)
NS_IMPL_RELEASE_INHERITED(nsXTFElementWrapper, nsXTFElementWrapperBase)
NS_IMPL_CYCLE_COLLECTION_CLASS(nsXTFElementWrapper)
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN_INHERITED(nsXTFElementWrapper,
nsXTFElementWrapperBase)
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_NSCOMPTR(mXTFElement)
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_NSCOMPTR(mAttributeHandler)
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END
NS_IMPL_ADDREF_INHERITED(nsXTFElementWrapper,nsXTFElementWrapperBase)
NS_IMPL_RELEASE_INHERITED(nsXTFElementWrapper,nsXTFElementWrapperBase)
NS_IMETHODIMP
nsXTFElementWrapper::QueryInterface(REFNSIID aIID, void** aInstancePtr)

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

@ -65,8 +65,6 @@ public:
// nsISupports interface
NS_DECL_ISUPPORTS_INHERITED
NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED_NO_UNLINK(nsXTFElementWrapper,
nsXTFElementWrapperBase)
// nsIXTFElementWrapper
NS_DECL_NSIXTFELEMENTWRAPPER

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

@ -1471,16 +1471,6 @@ nsXULElement::GetAttrCount() const
return count;
}
void
nsXULElement::DestroyContent()
{
nsDOMSlots* slots = GetExistingDOMSlots();
if (slots) {
NS_IF_RELEASE(slots->mControllers);
}
nsGenericElement::DestroyContent();
}
#ifdef DEBUG
void

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

@ -568,7 +568,6 @@ public:
PRBool aNotify);
virtual const nsAttrName* GetAttrNameAt(PRUint32 aIndex) const;
virtual PRUint32 GetAttrCount() const;
virtual void DestroyContent();
#ifdef DEBUG
virtual void List(FILE* out, PRInt32 aIndent) const;