Fixing
bug 440572. Make child frames whose names conflict with properties defined in IDL be accessable through XOWs again. r+sr=mrbkap@gmail.com
--- a/dom/src/base/nsDOMClassInfo.cpp
+++ b/dom/src/base/nsDOMClassInfo.cpp
@@ -4505,20 +4505,24 @@ nsWindowSH::GetProperty(nsIXPConnectWrap
//
// Calling GetWrappedNativeOfJSObject() is not all that cheap, so
// only do that if the JSClass name is one that is likely to be a
// window object.
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));
if (vpwrapper) {
nsCOMPtr<nsIDOMWindow> window(do_QueryWrappedNative(vpwrapper));
if (window) {
--- a/dom/tests/mochitest/bugs/Makefile.in
+++ b/dom/tests/mochitest/bugs/Makefile.in
@@ -72,12 +72,14 @@ include $(topsrcdir)/config/rules.mk
iframe_bug424093.html \
test_bug409349.html \
iframe_bug409349.html \
test_bug411103.html \
test_bug414291.html \
test_bug430276.html \
iframe_bug430276.html \
iframe_bug430276-2.html \
+ test_bug440572.html \
+ iframe_bug440572.html \
$(NULL)
libs:: $(_TEST_FILES)
$(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/_tests/testing/mochitest/tests/$(relativesrcdir)