From b72fe90c7e60b64b47e458615f8d6960cefed2df Mon Sep 17 00:00:00 2001 From: "jkeiser%netscape.com" Date: Sat, 7 Sep 2002 00:58:08 +0000 Subject: [PATCH] Make save/restore in textfields / textare work again (bug 163714), r=rjesup@wgat e.com, sr=jst@netscape.com, a=asa --- content/base/src/nsGenericElement.cpp | 28 ++++----------------------- content/base/src/nsGenericElement.h | 2 -- 2 files changed, 4 insertions(+), 26 deletions(-) diff --git a/content/base/src/nsGenericElement.cpp b/content/base/src/nsGenericElement.cpp index 2e9c04f57a02..24a6f2d0c502 100644 --- a/content/base/src/nsGenericElement.cpp +++ b/content/base/src/nsGenericElement.cpp @@ -701,8 +701,9 @@ nsDOMEventRTTearoff::DispatchEvent(nsIDOMEvent *evt, PRBool* _retval) //---------------------------------------------------------------------- nsDOMSlots::nsDOMSlots(PtrBits aFlags) - : mFlags(aFlags), mChildNodes(nsnull), mStyle(nsnull), mAttributeMap(nsnull), - mBindingParent(nsnull), mContentID(0) + : mFlags(aFlags & ~GENERIC_ELEMENT_CONTENT_ID_MASK), mChildNodes(nsnull), + mStyle(nsnull), mAttributeMap(nsnull), mBindingParent(nsnull), + mContentID(aFlags >> GENERIC_ELEMENT_CONTENT_ID_BITS_OFFSET) { } @@ -851,26 +852,6 @@ nsGenericElement::~nsGenericElement() // No calling GetFlags() beond this point... } -void -nsGenericElement::MaybeClearDOMSlots() -{ - nsDOMSlots *slots = GetExistingDOMSlots(); - - if (!slots) { - return; - } - - if (slots->IsEmpty()) { - mFlagsOrSlots = slots->mFlags | GENERIC_ELEMENT_DOESNT_HAVE_DOMSLOTS; - - // Move the content id from the slots to mFlagsOrSlots too since - // it might have changed since we created the slots - SetContentID(slots->mContentID); - - delete slots; - } -} - PR_STATIC_CALLBACK(void) RangeListHashInitEntry(PLDHashTable *table, PLDHashEntryHdr *entry, const void *key) @@ -2146,8 +2127,7 @@ nsGenericElement::GetContentID(PRUint32* aID) NS_IMETHODIMP nsGenericElement::SetContentID(PRUint32 aID) { - if (aID > GENERIC_ELEMENT_CONTENT_ID_MAX_VALUE || - HasDOMSlots()) { + if (HasDOMSlots() || aID > GENERIC_ELEMENT_CONTENT_ID_MAX_VALUE) { nsDOMSlots *slots = GetDOMSlots(); if (!slots) { diff --git a/content/base/src/nsGenericElement.h b/content/base/src/nsGenericElement.h index c8f1f347f91a..fa834ae7eb2e 100644 --- a/content/base/src/nsGenericElement.h +++ b/content/base/src/nsGenericElement.h @@ -615,8 +615,6 @@ protected: return NS_REINTERPRET_CAST(nsDOMSlots *, mFlagsOrSlots); } - void MaybeClearDOMSlots(); - PtrBits GetFlags() const { if (HasDOMSlots()) {