Fixing bug 440572. Make child frames whose names conflict with properties defined in IDL be accessable through XOWs again. r+sr=mrbkap@gmail.com

This commit is contained in:
Johnny Stenback 2008-06-25 17:06:38 -07:00
parent a743b87dec
commit 8d2a15b00b
2 changed files with 8 additions and 2 deletions

View File

@ -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<nsIXPConnectWrappedNative> vpwrapper;
sXPConnect->GetWrappedNativeOfJSObject(cx, JSVAL_TO_OBJECT(*vp),
getter_AddRefs(vpwrapper));

View File

@ -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)