From d66eefbe686ffa601099207f4d0bc316077857a2 Mon Sep 17 00:00:00 2001 From: "bzbarsky%mit.edu" Date: Sat, 9 Sep 2006 04:44:22 +0000 Subject: [PATCH] Create inner windows when resolving on an XPCNativeWrapper for an inner-less outer window, not just when resolving on a raw inner-less outer window. Bug 348990 and bug 323641, r+sr=jst, a=beltzner for 1.8.1 drivers git-svn-id: svn://10.0.0.236/branches/MOZILLA_1_8_BRANCH@209538 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/dom/src/base/nsDOMClassInfo.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/mozilla/dom/src/base/nsDOMClassInfo.cpp b/mozilla/dom/src/base/nsDOMClassInfo.cpp index df69315f546..8fde47db0d8 100644 --- a/mozilla/dom/src/base/nsDOMClassInfo.cpp +++ b/mozilla/dom/src/base/nsDOMClassInfo.cpp @@ -5790,9 +5790,10 @@ nsWindowSH::NewResolve(nsIXPConnectWrappedNative *wrapper, JSContext *cx, // Note, we won't forward resolve of the location property to the // inner window, we need to deal with that one for the outer too // since we've got special security protection code for that - // property. - if (win->IsOuterWindow() && id != sLocation_id && - !ObjectIsNativeWrapper(cx, obj)) { + // property. Also note that we want to enter this block even for + // native wrappers, so that we'll ensure an inner window to wrap + // against for the result of whatever we're getting. + if (win->IsOuterWindow() && id != sLocation_id) { // XXXjst: Do security checks here when we remove the security // checks on the inner window. @@ -5826,7 +5827,8 @@ nsWindowSH::NewResolve(nsIXPConnectWrappedNative *wrapper, JSContext *cx, } JSObject *innerObj; - if (innerWin && (innerObj = innerWin->GetGlobalJSObject())) { + if (!ObjectIsNativeWrapper(cx, obj) && + innerWin && (innerObj = innerWin->GetGlobalJSObject())) { #ifdef DEBUG_SH_FORWARDING printf(" --- Forwarding resolve to inner window %p\n", (void *)innerWin); #endif