From 6184f52ec890527adec281ebecff93ee0641759a Mon Sep 17 00:00:00 2001 From: Olli Pettay Date: Wed, 24 Sep 2008 12:47:35 +0300 Subject: [PATCH] Bug 455853 - Javascript: User defined properties disappear after 3 to 10 seconds from nodes that are added to a DOM document that is created using document.implementation.createDocument(), r+sr=peterv --- content/base/src/nsDocument.cpp | 4 ++- content/base/test/Makefile.in | 1 + content/base/test/test_bug455853.html | 41 +++++++++++++++++++++++++++ 3 files changed, 45 insertions(+), 1 deletion(-) create mode 100644 content/base/test/test_bug455853.html diff --git a/content/base/src/nsDocument.cpp b/content/base/src/nsDocument.cpp index 0949e8af9b2..47d9d948e8e 100644 --- a/content/base/src/nsDocument.cpp +++ b/content/base/src/nsDocument.cpp @@ -5760,7 +5760,9 @@ nsDocument::FlushPendingNotifications(mozFlushType aType) void nsDocument::AddReference(void *aKey, nsISupports *aReference) { - if (mScriptGlobalObject) { + PRBool dummy; + nsIScriptGlobalObject* scriptObject = GetScriptHandlingObject(dummy); + if (scriptObject) { if (!mContentWrapperHash) { mContentWrapperHash = new nsInterfaceHashtable; if (mContentWrapperHash) { diff --git a/content/base/test/Makefile.in b/content/base/test/Makefile.in index 614b9c9804b..767cb9460ee 100644 --- a/content/base/test/Makefile.in +++ b/content/base/test/Makefile.in @@ -212,6 +212,7 @@ _TEST_FILES = test_bug5141.html \ test_bug368972.html \ test_bug450160.html \ test_bug454326.html \ + test_bug455853.html \ $(NULL) libs:: $(_TEST_FILES) diff --git a/content/base/test/test_bug455853.html b/content/base/test/test_bug455853.html new file mode 100644 index 00000000000..78354911b6b --- /dev/null +++ b/content/base/test/test_bug455853.html @@ -0,0 +1,41 @@ + + + + + Test for Bug 455853 + + + + + +Mozilla Bug 455853 +

+ +
+
+
+ +