зеркало из https://github.com/mozilla/gecko-dev.git
Fixing bug 148782. Don't let images or form controls named 'submit' shadow the method form.submit. r=caillon@returnzero.com, sr=peterv@netscape.com, a=sspitzer@netscape.com
This commit is contained in:
Родитель
ceab6587af
Коммит
d9d2d1abdf
|
@ -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<nsISupports> native;
|
||||
|
||||
wrapper->GetNative(getter_AddRefs(native));
|
||||
|
|
|
@ -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;
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче