Fixing bug 440572. Make child frames whose names conflict with properties defined in IDL be accessable through XOWs again. r+sr=mrbkap@gmail.com
authorJohnny Stenback <jst@mozilla.com>
Wed, 25 Jun 2008 17:06:38 -0700
changeset 15541 0d840943cc7655c4117fdec62a11d840feb0987c
parent 15540 2164d824d250edb05cefc859e4cef803ec197997
child 15542 0c385f97b651b108f8103b93f97c9334bb26d19d
push id298
push userjst@mozilla.com
push dateThu, 26 Jun 2008 00:06:44 +0000
treeherdermozilla-central@0d840943cc76 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs440572
milestone1.9.1a1pre
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
dom/tests/mochitest/bugs/Makefile.in
--- 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)