From e432e55df3dfbc06ffa8ac1d7c47f4a26daa80e9 Mon Sep 17 00:00:00 2001 From: Johnny Stenback Date: Wed, 25 Jun 2008 17:06:38 -0700 Subject: [PATCH] Fixing bug 440572. Make child frames whose names conflict with properties defined in IDL be accessable through XOWs again. r+sr=mrbkap@gmail.com --- dom/src/base/nsDOMClassInfo.cpp | 8 ++++++-- dom/tests/mochitest/bugs/Makefile.in | 2 ++ 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/dom/src/base/nsDOMClassInfo.cpp b/dom/src/base/nsDOMClassInfo.cpp index 77f2c2204c5b..3eacc55cfb85 100644 --- a/dom/src/base/nsDOMClassInfo.cpp +++ b/dom/src/base/nsDOMClassInfo.cpp @@ -4510,10 +4510,14 @@ nsWindowSH::GetProperty(nsIXPConnectWrappedNative *wrapper, JSContext *cx, const char *name = JS_GET_CLASS(cx, JSVAL_TO_OBJECT(*vp))->name; // The list of Window class names here need to be kept in sync - // with the actual class names! + // with the actual class names! The class name + // XPCCrossOriginWrapper needs to be handled here too as XOWs + // define child frame names with a XOW as the value, and thus + // we'll need to get through here with XOWs class name too. if ((*name == 'W' && strcmp(name, "Window") == 0) || (*name == 'C' && strcmp(name, "ChromeWindow") == 0) || - (*name == 'M' && strcmp(name, "ModalContentWindow") == 0)) { + (*name == 'M' && strcmp(name, "ModalContentWindow") == 0) || + (*name == 'X' && strcmp(name, "XPCCrossOriginWrapper") == 0)) { nsCOMPtr vpwrapper; sXPConnect->GetWrappedNativeOfJSObject(cx, JSVAL_TO_OBJECT(*vp), getter_AddRefs(vpwrapper)); diff --git a/dom/tests/mochitest/bugs/Makefile.in b/dom/tests/mochitest/bugs/Makefile.in index 7fa42a52737f..6be268e47f5e 100644 --- a/dom/tests/mochitest/bugs/Makefile.in +++ b/dom/tests/mochitest/bugs/Makefile.in @@ -77,6 +77,8 @@ _TEST_FILES = \ test_bug430276.html \ iframe_bug430276.html \ iframe_bug430276-2.html \ + test_bug440572.html \ + iframe_bug440572.html \ $(NULL) libs:: $(_TEST_FILES)