From c9d7b4d88029b0b57830527133ef7e48b8c0a2ed Mon Sep 17 00:00:00 2001 From: Peter Van der Beken Date: Wed, 22 Jul 2009 20:50:24 +0200 Subject: [PATCH] Fix for bug 500349 (DOMParser no longer available in Greasemonkey scripts). r/sr=jst. --HG-- extra : rebase_source : e42a5ad4bc82ef7b6933e9420840f83548ecde2c --- dom/base/nsDOMClassInfo.cpp | 17 +++++++++++++++++ parser/html/javasrc/README.txt | 6 ------ 2 files changed, 17 insertions(+), 6 deletions(-) delete mode 100644 parser/html/javasrc/README.txt diff --git a/dom/base/nsDOMClassInfo.cpp b/dom/base/nsDOMClassInfo.cpp index 8be8cd69b46..47cd5a69e52 100644 --- a/dom/base/nsDOMClassInfo.cpp +++ b/dom/base/nsDOMClassInfo.cpp @@ -5918,6 +5918,23 @@ nsWindowSH::GlobalResolve(nsGlobalWindow *aWin, JSContext *cx, rv = GetXPCProto(sXPConnect, cx, aWin, name_struct, getter_AddRefs(proto_holder)); + if (NS_SUCCEEDED(rv) && obj != aWin->GetGlobalJSObject()) { + JSObject* dot_prototype; + rv = proto_holder->GetJSObject(&dot_prototype); + NS_ENSURE_SUCCESS(rv, rv); + + const nsDOMClassInfoData *ci_data; + if (name_struct->mType == nsGlobalNameStruct::eTypeClassConstructor) { + ci_data = &sClassInfoData[name_struct->mDOMClassInfoID]; + } else { + ci_data = name_struct->mData; + } + + return ResolvePrototype(sXPConnect, aWin, cx, obj, class_name, ci_data, + name_struct, nameSpaceManager, dot_prototype, + PR_TRUE, did_resolve); + } + *did_resolve = NS_SUCCEEDED(rv); return rv; diff --git a/parser/html/javasrc/README.txt b/parser/html/javasrc/README.txt deleted file mode 100644 index 4555969cadf..00000000000 --- a/parser/html/javasrc/README.txt +++ /dev/null @@ -1,6 +0,0 @@ -The .java files in this directory were placed here by the Java-to-C++ -translator that lives in parser/html/java/translator. Together they represent -a snapshot of the Java code that was translated to produce the corresponding -.h and .cpp files in the parent directory. Changing these .java files is not -worthwhile, as they will just be overwritten by the next translation. See -parser/html/java/README.txt for information about performing the translation.