diff --git a/browser/base/content/browser.js b/browser/base/content/browser.js index 39c0761ff503..59789cd02316 100644 --- a/browser/base/content/browser.js +++ b/browser/base/content/browser.js @@ -4432,10 +4432,6 @@ nsBrowserAccess.prototype = { isTabContentWindow: function (aWindow) { return gBrowser.browsers.some(function (browser) browser.contentWindow == aWindow); - }, - - get contentWindow() { - return gBrowser.contentWindow; } } diff --git a/browser/metro/base/content/browser.js b/browser/metro/base/content/browser.js index 1e414a907368..d44ec31db76b 100644 --- a/browser/metro/base/content/browser.js +++ b/browser/metro/base/content/browser.js @@ -1205,10 +1205,6 @@ nsBrowserAccess.prototype = { isTabContentWindow: function(aWindow) { return Browser.browsers.some(function (browser) browser.contentWindow == aWindow); - }, - - get contentWindow() { - return Browser.selectedBrowser.contentWindow; } }; diff --git a/content/base/test/chrome/cpows_child.js b/content/base/test/chrome/cpows_child.js index a53c7c1940d5..edfbf5f311d4 100644 --- a/content/base/test/chrome/cpows_child.js +++ b/content/base/test/chrome/cpows_child.js @@ -27,15 +27,8 @@ function make_object() o.b = true; o.s = "hello"; o.x = { i: 10 }; - o.f = function () { return 99; }; - - // Doing anything with this Proxy will throw. - var throwing = new Proxy({}, new Proxy({}, { - get: function (trap) { throw trap; } - })); - + o.f = function () { return 99; } return { "data": o, - "throwing": throwing, "document": content.document }; } diff --git a/content/base/test/chrome/cpows_parent.xul b/content/base/test/chrome/cpows_parent.xul index 7d9592a8f96f..52461b42bcf2 100644 --- a/content/base/test/chrome/cpows_parent.xul +++ b/content/base/test/chrome/cpows_parent.xul @@ -37,39 +37,6 @@ ok(data.b === false, "boolean property"); ok(data.s === "bye", "string property"); ok(data.x === null, "nested property"); - - let throwing = message.objects.throwing; - // Based on the table on: - // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Proxy - let tests = [ - () => Object.getOwnPropertyDescriptor(throwing, 'test'), - () => Object.getOwnPropertyNames(throwing), - () => Object.defineProperty(throwing, 'test', {value: 1}), - () => delete throwing.test, - () => "test" in throwing, - () => Object.prototype.hasOwnProperty.call(throwing, 'test'), - () => throwing.test, - () => { throwing.test = 1 }, - // () => { for (let prop in throwing) {} }, Bug 783829 - () => { for (let prop of throwing) {} }, - () => Object.keys(throwing), - () => Function.prototype.call.call(throwing), - () => new throwing, - () => Object.preventExtensions(throwing), - () => Object.freeze(throwing), - () => Object.seal(throwing), - ] - - for (let test of tests) { - let threw = false; - try { - test() - } catch (e) { - threw = true; - } - ok(threw, "proxy operation threw exception"); - } - } function recvAsyncMessage(message) { @@ -90,7 +57,7 @@ run_tests("inprocess"); return; } - + finish(); } diff --git a/docshell/base/nsIDocShellTreeOwner.idl b/docshell/base/nsIDocShellTreeOwner.idl index 6bcd1f9b5018..74071acc988a 100644 --- a/docshell/base/nsIDocShellTreeOwner.idl +++ b/docshell/base/nsIDocShellTreeOwner.idl @@ -12,7 +12,7 @@ interface nsIDocShellTreeItem; -[scriptable, uuid(6cd89e60-1060-491e-8c31-ce969435ec56)] +[scriptable, uuid(932f9f93-8e21-4728-a527-cafc64b4d831)] interface nsIDocShellTreeOwner : nsISupports { /* @@ -64,9 +64,6 @@ interface nsIDocShellTreeOwner : nsISupports */ readonly attribute nsIDocShellTreeItem primaryContentShell; - [implicit_jscontext] - readonly attribute jsval contentWindow; - /* Tells the tree owner to size its window or parent window in such a way that the shell passed along will be the size specified. diff --git a/dom/base/nsGlobalWindow.cpp b/dom/base/nsGlobalWindow.cpp index e4e8b9d13e54..f18d63ecdb8a 100644 --- a/dom/base/nsGlobalWindow.cpp +++ b/dom/base/nsGlobalWindow.cpp @@ -3622,28 +3622,6 @@ nsGlobalWindow::GetContent(nsIDOMWindow** aContent) return NS_OK; } -NS_IMETHODIMP -nsGlobalWindow::GetScriptableContent(JSContext* aCx, JS::Value* aVal) -{ - nsCOMPtr content; - nsresult rv = GetContent(getter_AddRefs(content)); - NS_ENSURE_SUCCESS(rv, rv); - - if (content || !nsContentUtils::IsCallerChrome() || !IsChromeWindow()) { - JS::Rooted global(aCx, JS_GetGlobalForScopeChain(aCx)); - if (content && global) { - nsCOMPtr wrapper; - return nsContentUtils::WrapNative(aCx, global, content, aVal, - getter_AddRefs(wrapper)); - } - return NS_ERROR_FAILURE; - } - - // Something tries to get .content on a ChromeWindow, try to fetch the CPOW. - nsCOMPtr treeOwner = GetTreeOwner(); - NS_ENSURE_TRUE(treeOwner, NS_ERROR_FAILURE); - return treeOwner->GetContentWindow(aCx, aVal); -} NS_IMETHODIMP nsGlobalWindow::GetPrompter(nsIPrompt** aPrompt) diff --git a/dom/interfaces/base/nsIBrowserDOMWindow.idl b/dom/interfaces/base/nsIBrowserDOMWindow.idl index 8f009159a060..1eed33503800 100644 --- a/dom/interfaces/base/nsIBrowserDOMWindow.idl +++ b/dom/interfaces/base/nsIBrowserDOMWindow.idl @@ -9,7 +9,7 @@ interface nsIDOMWindow; interface nsIURI; interface nsIFrameLoaderOwner; -[scriptable, uuid(e420bd32-b8c4-4b47-8cca-09e0bddbb0c3)] +[scriptable, uuid(3ab89888-eb41-4dc8-b347-115555f47c80)] /** * The C++ source has access to the browser script source through @@ -92,12 +92,5 @@ interface nsIBrowserDOMWindow : nsISupports * currently open tab in this toplevel browser window. */ boolean isTabContentWindow(in nsIDOMWindow aWindow); - - /** - * The contentWindow property of the currently selected browser. - * This is used to implement .content in remote-Firefox. - */ - - readonly attribute jsval contentWindow; }; diff --git a/dom/interfaces/base/nsIDOMJSWindow.idl b/dom/interfaces/base/nsIDOMJSWindow.idl index 343a071a6edc..faef7e13e350 100644 --- a/dom/interfaces/base/nsIDOMJSWindow.idl +++ b/dom/interfaces/base/nsIDOMJSWindow.idl @@ -5,7 +5,7 @@ #include "domstubs.idl" -[scriptable, uuid(f28c92a2-302a-4448-b589-46af599de352)] +[scriptable, uuid(35b653f4-e679-4843-8391-89cb2f5a9ba4)] interface nsIDOMJSWindow : nsISupports { void dump(in DOMString str); @@ -66,7 +66,4 @@ interface nsIDOMJSWindow : nsISupports * This property is "replaceable" in JavaScript. */ readonly attribute nsIDOMWindow frames; - - [implicit_jscontext, binaryname(ScriptableContent)] - readonly attribute jsval content; }; diff --git a/dom/interfaces/base/nsIDOMWindow.idl b/dom/interfaces/base/nsIDOMWindow.idl index e769ed6d8b02..8fdb79cb89e6 100644 --- a/dom/interfaces/base/nsIDOMWindow.idl +++ b/dom/interfaces/base/nsIDOMWindow.idl @@ -25,7 +25,7 @@ interface nsIVariant; * @see */ -[scriptable, uuid(db8ea3c8-6997-460a-8715-0a1cbf20f15d)] +[scriptable, uuid(be62660a-e3f6-409c-a4a9-378364a9526f)] interface nsIDOMWindow : nsISupports { // the current browsing context @@ -360,7 +360,7 @@ interface nsIDOMWindow : nsISupports void sizeToContent(); /* [replaceable] content */ - [noscript] readonly attribute nsIDOMWindow content; + readonly attribute nsIDOMWindow content; /* [replaceable] prompter */ [noscript] readonly attribute nsIPrompt prompter; diff --git a/dom/ipc/ContentChild.cpp b/dom/ipc/ContentChild.cpp index 9ad914432d9a..08062664fd17 100644 --- a/dom/ipc/ContentChild.cpp +++ b/dom/ipc/ContentChild.cpp @@ -1181,13 +1181,10 @@ PreloadSlowThings() } bool -ContentChild::RecvAppInfo(const nsCString& version, const nsCString& buildID, - const nsCString& name, const nsCString& UAName) +ContentChild::RecvAppInfo(const nsCString& version, const nsCString& buildID) { mAppInfo.version.Assign(version); mAppInfo.buildID.Assign(buildID); - mAppInfo.name.Assign(name); - mAppInfo.UAName.Assign(UAName); // If we're part of the mozbrowser machinery, go ahead and start // preloading things. We can only do this for mozbrowser because // PreloadSlowThings() may set the docshell of the first TabChild diff --git a/dom/ipc/ContentChild.h b/dom/ipc/ContentChild.h index 127fad3de4f0..bdae4f9f4799 100644 --- a/dom/ipc/ContentChild.h +++ b/dom/ipc/ContentChild.h @@ -60,8 +60,6 @@ public: { nsCString version; nsCString buildID; - nsCString name; - nsCString UAName; }; bool Init(MessageLoop* aIOLoop, @@ -196,8 +194,7 @@ public: virtual bool RecvGarbageCollect(); virtual bool RecvCycleCollect(); - virtual bool RecvAppInfo(const nsCString& version, const nsCString& buildID, - const nsCString& name, const nsCString& UAName); + virtual bool RecvAppInfo(const nsCString& version, const nsCString& buildID); virtual bool RecvLastPrivateDocShellDestroyed(); diff --git a/dom/ipc/ContentParent.cpp b/dom/ipc/ContentParent.cpp index 85bdebd8c887..dad5ca324610 100644 --- a/dom/ipc/ContentParent.cpp +++ b/dom/ipc/ContentParent.cpp @@ -1133,11 +1133,9 @@ ContentParent::ContentParent(mozIApplication* aApp, if (gAppData) { nsCString version(gAppData->version); nsCString buildID(gAppData->buildID); - nsCString name(gAppData->name); - nsCString UAName(gAppData->UAName); //Sending all information to content process - unused << SendAppInfo(version, buildID, name, UAName); + unused << SendAppInfo(version, buildID); } } diff --git a/dom/ipc/PContent.ipdl b/dom/ipc/PContent.ipdl index 6acb5278e6dc..cc7bdb12bb88 100644 --- a/dom/ipc/PContent.ipdl +++ b/dom/ipc/PContent.ipdl @@ -258,7 +258,7 @@ child: */ ActivateA11y(); - AppInfo(nsCString version, nsCString buildID, nsCString name, nsCString UAName); + AppInfo(nsCString version, nsCString buildID); // Notify child that last-pb-context-exited notification was observed LastPrivateDocShellDestroyed(); diff --git a/dom/ipc/test.xul b/dom/ipc/test.xul index 3eede172db93..25efdb6f6ceb 100644 --- a/dom/ipc/test.xul +++ b/dom/ipc/test.xul @@ -253,9 +253,6 @@ }, openDialog: function(aType, aName, aFeatures, aArguments, aFrameElement) { alert(aType + ", " + aName + ", " + aFeatures + ", " + aArguments + ", " + aFrameElement); - }, - get contentWindow() { - return null; } } diff --git a/embedding/browser/webBrowser/nsDocShellTreeOwner.cpp b/embedding/browser/webBrowser/nsDocShellTreeOwner.cpp index 64fcf164df23..6fe02ef98ff8 100644 --- a/embedding/browser/webBrowser/nsDocShellTreeOwner.cpp +++ b/embedding/browser/webBrowser/nsDocShellTreeOwner.cpp @@ -353,7 +353,7 @@ nsDocShellTreeOwner::GetPrimaryContentShell(nsIDocShellTreeItem** aShell) { NS_ENSURE_ARG_POINTER(aShell); - if (mTreeOwner) + if(mTreeOwner) return mTreeOwner->GetPrimaryContentShell(aShell); *aShell = (mPrimaryContentShell ? mPrimaryContentShell : mWebBrowser->mDocShell); @@ -362,15 +362,6 @@ nsDocShellTreeOwner::GetPrimaryContentShell(nsIDocShellTreeItem** aShell) return NS_OK; } -NS_IMETHODIMP -nsDocShellTreeOwner::GetContentWindow(JSContext* aCx, JS::Value* aVal) -{ - if (mTreeOwner) - return mTreeOwner->GetContentWindow(aCx, aVal); - - return NS_ERROR_NOT_IMPLEMENTED; -} - NS_IMETHODIMP nsDocShellTreeOwner::SizeShellTo(nsIDocShellTreeItem* aShellItem, int32_t aCX, int32_t aCY) diff --git a/js/ipc/JavaScriptChild.cpp b/js/ipc/JavaScriptChild.cpp index 52bcfc904726..9ee02c5eebaa 100644 --- a/js/ipc/JavaScriptChild.cpp +++ b/js/ipc/JavaScriptChild.cpp @@ -434,7 +434,7 @@ JavaScriptChild::AnswerIsExtensible(const ObjectId &objId, ReturnStatus *rs, boo return fail(cx, rs); *result = !!extensible; - return ok(rs); + return true; } bool diff --git a/js/src/jsapi.cpp b/js/src/jsapi.cpp index 76dc052a843e..57711331d614 100644 --- a/js/src/jsapi.cpp +++ b/js/src/jsapi.cpp @@ -7206,11 +7206,12 @@ JS_GetScriptedGlobal(JSContext *cx) JS_PUBLIC_API(JSBool) JS_PreventExtensions(JSContext *cx, JS::HandleObject obj) { - bool extensible; - if (!JSObject::isExtensible(cx, obj, &extensible)) - return false; - if (!extensible) - return true; + JSBool extensible; + if (!JS_IsExtensible(cx, obj, &extensible)) + return JS_TRUE; + if (extensible) + return JS_TRUE; + return JSObject::preventExtensions(cx, obj); } diff --git a/mobile/android/chrome/content/browser.js b/mobile/android/chrome/content/browser.js index 99780a6da36b..3014ca00817d 100644 --- a/mobile/android/chrome/content/browser.js +++ b/mobile/android/chrome/content/browser.js @@ -2492,10 +2492,6 @@ nsBrowserAccess.prototype = { isTabContentWindow: function(aWindow) { return BrowserApp.getBrowserForWindow(aWindow) != null; - }, - - get contentWindow() { - return BrowserApp.selectedBrowser.contentWindow; } }; diff --git a/toolkit/content/browser-child.js b/toolkit/content/browser-child.js index 0ddc83790719..25176aaa1286 100644 --- a/toolkit/content/browser-child.js +++ b/toolkit/content/browser-child.js @@ -29,24 +29,12 @@ let WebProgressListener = { }; }, - _setupObjects: function setupObjects(aWebProgress) { - let win = docShell.QueryInterface(Ci.nsIInterfaceRequestor) - .getInterface(Ci.nsIDOMWindow); - return { - contentWindow: win, - // DOMWindow is not necessarily the content-window with subframes. - DOMWindow: aWebProgress.DOMWindow - }; - }, - onStateChange: function onStateChange(aWebProgress, aRequest, aStateFlags, aStatus) { let json = this._setupJSON(aWebProgress, aRequest); - let objects = this._setupObjects(aWebProgress); - json.stateFlags = aStateFlags; json.status = aStatus; - sendAsyncMessage("Content:StateChange", json, objects); + sendAsyncMessage("Content:StateChange", json); }, onProgressChange: function onProgressChange(aWebProgress, aRequest, aCurSelf, aMaxSelf, aCurTotal, aMaxTotal) { @@ -57,35 +45,29 @@ let WebProgressListener = { let charset = content.document.characterSet; let json = this._setupJSON(aWebProgress, aRequest); - let objects = this._setupObjects(aWebProgress); - json.documentURI = aWebProgress.DOMWindow.document.documentURIObject.spec; json.location = spec; json.canGoBack = docShell.canGoBack; json.canGoForward = docShell.canGoForward; json.charset = charset.toString(); - sendAsyncMessage("Content:LocationChange", json, objects); + sendAsyncMessage("Content:LocationChange", json); }, onStatusChange: function onStatusChange(aWebProgress, aRequest, aStatus, aMessage) { let json = this._setupJSON(aWebProgress, aRequest); - let objects = this._setupObjects(aWebProgress); - json.status = aStatus; json.message = aMessage; - sendAsyncMessage("Content:StatusChange", json, objects); + sendAsyncMessage("Content:StatusChange", json); }, onSecurityChange: function onSecurityChange(aWebProgress, aRequest, aState) { let json = this._setupJSON(aWebProgress, aRequest); - let objects = this._setupObjects(aWebProgress); - json.state = aState; json.status = SecurityUI.getSSLStatusAsString(); - sendAsyncMessage("Content:SecurityChange", json, objects); + sendAsyncMessage("Content:SecurityChange", json); }, QueryInterface: function QueryInterface(aIID) { diff --git a/toolkit/content/widgets/remote-browser.xml b/toolkit/content/widgets/remote-browser.xml index 478d55e68188..34611763d83f 100644 --- a/toolkit/content/widgets/remote-browser.xml +++ b/toolkit/content/widgets/remote-browser.xml @@ -62,16 +62,6 @@ onget="return this._characterSet" readonly="true"/> - null - - - - - GetAppInfo().name; - return NS_OK; + return NS_ERROR_NOT_AVAILABLE; } aResult.Assign(gAppData->name); @@ -698,9 +696,7 @@ NS_IMETHODIMP nsXULAppInfo::GetUAName(nsACString& aResult) { if (XRE_GetProcessType() == GeckoProcessType_Content) { - ContentChild* cc = ContentChild::GetSingleton(); - aResult = cc->GetAppInfo().UAName; - return NS_OK; + return NS_ERROR_NOT_AVAILABLE; } aResult.Assign(gAppData->UAName); diff --git a/xpfe/appshell/src/nsChromeTreeOwner.cpp b/xpfe/appshell/src/nsChromeTreeOwner.cpp index 9240472bf969..b5cdf2c0858c 100644 --- a/xpfe/appshell/src/nsChromeTreeOwner.cpp +++ b/xpfe/appshell/src/nsChromeTreeOwner.cpp @@ -24,8 +24,6 @@ #include "nsIDOMNodeList.h" #include "nsIDOMXULElement.h" #include "nsIXULBrowserWindow.h" -#include "nsIDOMChromeWindow.h" -#include "nsIBrowserDOMWindow.h" // CIDs static NS_DEFINE_CID(kWindowMediatorCID, NS_WINDOWMEDIATOR_CID); @@ -247,25 +245,6 @@ NS_IMETHODIMP nsChromeTreeOwner::GetPrimaryContentShell(nsIDocShellTreeItem** aS return mXULWindow->GetPrimaryContentShell(aShell); } -NS_IMETHODIMP -nsChromeTreeOwner::GetContentWindow(JSContext* aCx, JS::Value* aVal) -{ - NS_ENSURE_STATE(mXULWindow); - - nsCOMPtr domWin; - mXULWindow->GetWindowDOMWindow(getter_AddRefs(domWin)); - nsCOMPtr chromeWin = do_QueryInterface(domWin); - if (!chromeWin) - return NS_OK; - - nsCOMPtr browserDOMWin; - chromeWin->GetBrowserDOMWindow(getter_AddRefs(browserDOMWin)); - if (!browserDOMWin) - return NS_OK; - - return browserDOMWin->GetContentWindow(aVal); -} - NS_IMETHODIMP nsChromeTreeOwner::SizeShellTo(nsIDocShellTreeItem* aShellItem, int32_t aCX, int32_t aCY) { diff --git a/xpfe/appshell/src/nsContentTreeOwner.cpp b/xpfe/appshell/src/nsContentTreeOwner.cpp index 2a2e0dff8d10..ba985ddcd768 100644 --- a/xpfe/appshell/src/nsContentTreeOwner.cpp +++ b/xpfe/appshell/src/nsContentTreeOwner.cpp @@ -292,20 +292,12 @@ nsContentTreeOwner::ContentShellRemoved(nsIDocShellTreeItem* aContentShell) return mXULWindow->ContentShellRemoved(aContentShell); } -NS_IMETHODIMP -nsContentTreeOwner::GetPrimaryContentShell(nsIDocShellTreeItem** aShell) +NS_IMETHODIMP nsContentTreeOwner::GetPrimaryContentShell(nsIDocShellTreeItem** aShell) { NS_ENSURE_STATE(mXULWindow); return mXULWindow->GetPrimaryContentShell(aShell); } -NS_IMETHODIMP -nsContentTreeOwner::GetContentWindow(JSContext* aCx, JS::Value* aVal) -{ - NS_ENSURE_STATE(mXULWindow); - return NS_ERROR_NOT_IMPLEMENTED; -} - NS_IMETHODIMP nsContentTreeOwner::SizeShellTo(nsIDocShellTreeItem* aShellItem, int32_t aCX, int32_t aCY) {