diff --git a/dom/src/base/nsDOMClassInfo.cpp b/dom/src/base/nsDOMClassInfo.cpp index 17e01c0355d..305d778f8a1 100644 --- a/dom/src/base/nsDOMClassInfo.cpp +++ b/dom/src/base/nsDOMClassInfo.cpp @@ -890,6 +890,7 @@ jsval nsDOMClassInfo::sDocument_id = JSVAL_VOID; jsval nsDOMClassInfo::sWindow_id = JSVAL_VOID; jsval nsDOMClassInfo::sFrames_id = JSVAL_VOID; jsval nsDOMClassInfo::sSelf_id = JSVAL_VOID; +jsval nsDOMClassInfo::sSubmit_id = JSVAL_VOID; const JSClass *nsDOMClassInfo::sObjectClass = nsnull; @@ -992,6 +993,7 @@ nsDOMClassInfo::DefineStaticJSVals(JSContext *cx) SET_JSVAL_TO_STRING(sWindow_id, cx, "window"); SET_JSVAL_TO_STRING(sFrames_id, cx, "frames"); SET_JSVAL_TO_STRING(sSelf_id, cx, "self"); + SET_JSVAL_TO_STRING(sSubmit_id, cx, "submit"); return NS_OK; } @@ -2829,6 +2831,7 @@ nsDOMClassInfo::ShutDown() sWindow_id = JSVAL_VOID; sFrames_id = JSVAL_VOID; sSelf_id = JSVAL_VOID; + sSubmit_id = JSVAL_VOID; NS_IF_RELEASE(sXPConnect); NS_IF_RELEASE(sSecMan); @@ -5279,7 +5282,11 @@ nsHTMLFormElementSH::NewResolve(nsIXPConnectWrappedNative *wrapper, PRUint32 flags, JSObject **objp, PRBool *_retval) { - if ((!(JSRESOLVE_ASSIGNING & flags)) && JSVAL_IS_STRING(id)) { + // If we're resolving a string other than "submit", and we're not + // resolving for assignment, check if the form knows about the + // resolved string. + if ((!(JSRESOLVE_ASSIGNING & flags)) && JSVAL_IS_STRING(id) && + id != sSubmit_id) { nsCOMPtr native; wrapper->GetNative(getter_AddRefs(native)); diff --git a/dom/src/base/nsDOMClassInfo.h b/dom/src/base/nsDOMClassInfo.h index 582d4350c89..a3f974db21b 100644 --- a/dom/src/base/nsDOMClassInfo.h +++ b/dom/src/base/nsDOMClassInfo.h @@ -259,6 +259,7 @@ protected: static jsval sWindow_id; static jsval sFrames_id; static jsval sSelf_id; + static jsval sSubmit_id; static const JSClass *sObjectClass;