From 2a8ab96873adc3a33e6bb426ed22b822c2b7564a Mon Sep 17 00:00:00 2001 From: "bzbarsky%mit.edu" Date: Thu, 14 Feb 2008 05:05:27 +0000 Subject: [PATCH] Stop treating _new as a special window target. No other browser does. Bug 417067, r+sr=jst, a=beltzner git-svn-id: svn://10.0.0.236/trunk@245671 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/browser/base/content/metaData.js | 1 - mozilla/docshell/base/nsDocShell.cpp | 3 +-- .../components/windowwatcher/src/nsWindowWatcher.cpp | 5 ++--- mozilla/toolkit/content/tests/chrome/test_largemenu.xul | 2 +- mozilla/toolkit/content/tests/chrome/test_panel_focus.xul | 2 +- mozilla/toolkit/content/tests/chrome/test_popup_anchor.xul | 2 +- .../tests/chrome/test_popup_preventdefault_chrome.xul | 2 +- mozilla/toolkit/content/tests/widgets/test_menubar.xul | 2 +- mozilla/toolkit/content/tests/widgets/test_menuchecks.xul | 2 +- .../toolkit/content/tests/widgets/test_popup_attribute.xul | 2 +- mozilla/toolkit/content/tests/widgets/test_popup_button.xul | 2 +- mozilla/toolkit/content/tests/widgets/test_tooltip.xul | 2 +- 12 files changed, 12 insertions(+), 15 deletions(-) diff --git a/mozilla/browser/base/content/metaData.js b/mozilla/browser/base/content/metaData.js index 2a9adb8db16..c37d1c306fb 100644 --- a/mozilla/browser/base/content/metaData.js +++ b/mozilla/browser/base/content/metaData.js @@ -327,7 +327,6 @@ function checkForLink(elem, htmllocalname) setInfo("link-target", gMetadataBundle.getString("parentFrameText")); break; case "_blank": - case "_new": var where = "Window"; var newWindowPref = prefs.getIntPref("browser.link.open_newwindow"); if (newWindowPref == 3) diff --git a/mozilla/docshell/base/nsDocShell.cpp b/mozilla/docshell/base/nsDocShell.cpp index d26ac8edbec..d7b2033e960 100644 --- a/mozilla/docshell/base/nsDocShell.cpp +++ b/mozilla/docshell/base/nsDocShell.cpp @@ -2028,8 +2028,7 @@ nsDocShell::FindItemWithName(const PRUnichar * aName, if (name.LowerCaseEqualsLiteral("_self")) { foundItem = this; } - else if (name.LowerCaseEqualsLiteral("_blank") || - name.LowerCaseEqualsLiteral("_new")) + else if (name.LowerCaseEqualsLiteral("_blank")) { // Just return null. Caller must handle creating a new window with // a blank name himself. diff --git a/mozilla/embedding/components/windowwatcher/src/nsWindowWatcher.cpp b/mozilla/embedding/components/windowwatcher/src/nsWindowWatcher.cpp index a3d1da29286..44b87838d35 100644 --- a/mozilla/embedding/components/windowwatcher/src/nsWindowWatcher.cpp +++ b/mozilla/embedding/components/windowwatcher/src/nsWindowWatcher.cpp @@ -738,11 +738,10 @@ nsWindowWatcher::OpenWindowJSInternal(nsIDOMWindow *aParent, /* allow a window that we found by name to keep its name (important for cases like _self where the given name is different (and invalid)). Also, _blank - and _new are not window names. */ + is not a window name. */ if (windowNeedsName) newDocShellItem->SetName(nameSpecified && - !name.LowerCaseEqualsLiteral("_blank") && - !name.LowerCaseEqualsLiteral("_new") ? + !name.LowerCaseEqualsLiteral("_blank") ? name.get() : nsnull); diff --git a/mozilla/toolkit/content/tests/chrome/test_largemenu.xul b/mozilla/toolkit/content/tests/chrome/test_largemenu.xul index fcc8927446f..40c0c452d50 100644 --- a/mozilla/toolkit/content/tests/chrome/test_largemenu.xul +++ b/mozilla/toolkit/content/tests/chrome/test_largemenu.xul @@ -17,7 +17,7 @@ SimpleTest.waitForExplicitFinish(); function runTest() { - window.open("window_largemenu.xul", "_new", "chrome,width=200,height=200"); + window.open("window_largemenu.xul", "_blank", "chrome,width=200,height=200"); } diff --git a/mozilla/toolkit/content/tests/chrome/test_panel_focus.xul b/mozilla/toolkit/content/tests/chrome/test_panel_focus.xul index 2b7ff18e840..4fac6bc45e6 100644 --- a/mozilla/toolkit/content/tests/chrome/test_panel_focus.xul +++ b/mozilla/toolkit/content/tests/chrome/test_panel_focus.xul @@ -26,7 +26,7 @@ function runTest() // test can fail on Mac synthesizeMouse(document.documentElement, 1, 1, { type: "mousemove" }); - window.open("window_panel_focus.xul", "_new", "chrome,width=600,height=600"); + window.open("window_panel_focus.xul", "_blank", "chrome,width=600,height=600"); } diff --git a/mozilla/toolkit/content/tests/chrome/test_popup_anchor.xul b/mozilla/toolkit/content/tests/chrome/test_popup_anchor.xul index 5a719ce16dc..aa91d5fe4e6 100644 --- a/mozilla/toolkit/content/tests/chrome/test_popup_anchor.xul +++ b/mozilla/toolkit/content/tests/chrome/test_popup_anchor.xul @@ -16,7 +16,7 @@ SimpleTest.waitForExplicitFinish(); function runTest() { - window.open("window_popup_anchor.xul", "_new", "chrome,width=600,height=600"); + window.open("window_popup_anchor.xul", "_blank", "chrome,width=600,height=600"); } diff --git a/mozilla/toolkit/content/tests/chrome/test_popup_preventdefault_chrome.xul b/mozilla/toolkit/content/tests/chrome/test_popup_preventdefault_chrome.xul index b96b67a73ad..90fb0549721 100644 --- a/mozilla/toolkit/content/tests/chrome/test_popup_preventdefault_chrome.xul +++ b/mozilla/toolkit/content/tests/chrome/test_popup_preventdefault_chrome.xul @@ -17,7 +17,7 @@ SimpleTest.waitForExplicitFinish(); function runTest() { - window.open("window_popup_preventdefault_chrome.xul", "_new", "chrome,width=600,height=600"); + window.open("window_popup_preventdefault_chrome.xul", "_blank", "chrome,width=600,height=600"); } diff --git a/mozilla/toolkit/content/tests/widgets/test_menubar.xul b/mozilla/toolkit/content/tests/widgets/test_menubar.xul index 7124cc8aba4..7f860fd5a09 100644 --- a/mozilla/toolkit/content/tests/widgets/test_menubar.xul +++ b/mozilla/toolkit/content/tests/widgets/test_menubar.xul @@ -15,7 +15,7 @@ SimpleTest.waitForExplicitFinish(); function runTest() { - window.open("window_menubar.xul", "_new", "width=600,height=600"); + window.open("window_menubar.xul", "_blank", "width=600,height=600"); } diff --git a/mozilla/toolkit/content/tests/widgets/test_menuchecks.xul b/mozilla/toolkit/content/tests/widgets/test_menuchecks.xul index 5c14ee7c6d0..587958b3c9b 100644 --- a/mozilla/toolkit/content/tests/widgets/test_menuchecks.xul +++ b/mozilla/toolkit/content/tests/widgets/test_menuchecks.xul @@ -18,7 +18,7 @@ SimpleTest.waitForExplicitFinish(); function runTest() { - window.open("window_menuchecks.xul", "_new", "width=600,height=600"); + window.open("window_menuchecks.xul", "_blank", "width=600,height=600"); } diff --git a/mozilla/toolkit/content/tests/widgets/test_popup_attribute.xul b/mozilla/toolkit/content/tests/widgets/test_popup_attribute.xul index 85fc9be1722..4e67e5148b8 100644 --- a/mozilla/toolkit/content/tests/widgets/test_popup_attribute.xul +++ b/mozilla/toolkit/content/tests/widgets/test_popup_attribute.xul @@ -15,7 +15,7 @@ SimpleTest.waitForExplicitFinish(); function runTest() { - window.open("window_popup_attribute.xul", "_new", "width=600,height=600"); + window.open("window_popup_attribute.xul", "_blank", "width=600,height=600"); } diff --git a/mozilla/toolkit/content/tests/widgets/test_popup_button.xul b/mozilla/toolkit/content/tests/widgets/test_popup_button.xul index 483756d5251..e6489d28704 100644 --- a/mozilla/toolkit/content/tests/widgets/test_popup_button.xul +++ b/mozilla/toolkit/content/tests/widgets/test_popup_button.xul @@ -15,7 +15,7 @@ SimpleTest.waitForExplicitFinish(); function runTest() { - window.open("window_popup_button.xul", "_new", "width=600,height=600"); + window.open("window_popup_button.xul", "_blank", "width=600,height=600"); } diff --git a/mozilla/toolkit/content/tests/widgets/test_tooltip.xul b/mozilla/toolkit/content/tests/widgets/test_tooltip.xul index 1f985e382ba..8777dc86aba 100644 --- a/mozilla/toolkit/content/tests/widgets/test_tooltip.xul +++ b/mozilla/toolkit/content/tests/widgets/test_tooltip.xul @@ -16,7 +16,7 @@ SimpleTest.waitForExplicitFinish(); function runTest() { - window.open("window_tooltip.xul", "_new", "width=600,height=600"); + window.open("window_tooltip.xul", "_blank", "width=600,height=600"); }