Stop treating _new as a special window target. No other browser does. Bug 417067, r+sr=jst, a=beltzner
authorbzbarsky@mit.edu
Wed, 13 Feb 2008 21:05:25 -0800
changeset 11699 2d5191c5c86d1d529666a54ab0d2365c2ed293c6
parent 11698 2d795dc577827cf738cb206f1ddfede6703f1c2a
child 11700 5943e539a3aa6d35f725be05a2a7208a4faed9e0
push idunknown
push userunknown
push dateunknown
reviewersbeltzner
bugs417067
milestone1.9b4pre
Stop treating _new as a special window target. No other browser does. Bug 417067, r+sr=jst, a=beltzner
browser/base/content/metaData.js
docshell/base/nsDocShell.cpp
embedding/components/windowwatcher/src/nsWindowWatcher.cpp
toolkit/content/tests/chrome/test_largemenu.xul
toolkit/content/tests/chrome/test_panel_focus.xul
toolkit/content/tests/chrome/test_popup_anchor.xul
toolkit/content/tests/chrome/test_popup_preventdefault_chrome.xul
toolkit/content/tests/widgets/test_menubar.xul
toolkit/content/tests/widgets/test_menuchecks.xul
toolkit/content/tests/widgets/test_popup_attribute.xul
toolkit/content/tests/widgets/test_popup_button.xul
toolkit/content/tests/widgets/test_tooltip.xul
--- a/browser/base/content/metaData.js
+++ b/browser/base/content/metaData.js
@@ -322,17 +322,16 @@ function checkForLink(elem, htmllocalnam
     switch (target) {
     case "_top":
       setInfo("link-target", gMetadataBundle.getString("sameWindowText"));
       break;
     case "_parent":
       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)
         where = "Tab";
       setInfo("link-target", gMetadataBundle.getString("new" + where + "Text"));
       break;
     case "":
     case "_self":
--- a/docshell/base/nsDocShell.cpp
+++ b/docshell/base/nsDocShell.cpp
@@ -2023,18 +2023,17 @@ nsDocShell::FindItemWithName(const PRUni
         // This is the entry point into the target-finding algorithm.  Check
         // for special names.  This should only be done once, hence the check
         // for a null aRequestor.
 
         nsDependentString name(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.
             return NS_OK;
         }
         else if (name.LowerCaseEqualsLiteral("_parent"))
         {
             GetSameTypeParent(getter_AddRefs(foundItem));
--- a/embedding/components/windowwatcher/src/nsWindowWatcher.cpp
+++ b/embedding/components/windowwatcher/src/nsWindowWatcher.cpp
@@ -733,21 +733,20 @@ nsWindowWatcher::OpenWindowJSInternal(ns
     nsCOMPtr<nsIScriptGlobalObject> scriptGlobal(do_QueryInterface(*_retval));
     NS_ENSURE_TRUE(scriptGlobal, NS_ERROR_UNEXPECTED);
     rv = scriptGlobal->SetNewArguments(argv);
     NS_ENSURE_SUCCESS(rv, rv);
   }
 
   /* 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);
 
 
   // Inherit the right character set into the new window to use as a fallback
   // in the event the document being loaded does not specify a charset.  When
   // aCalledFromJS is true, we want to use the character set of the document in
   // the caller; otherwise we want to use the character set of aParent's
   // docshell. Failing to set this charset is not fatal, so we want to continue
--- a/toolkit/content/tests/chrome/test_largemenu.xul
+++ b/toolkit/content/tests/chrome/test_largemenu.xul
@@ -12,17 +12,17 @@
           src="chrome://mochikit/content/MochiKit/packed.js"/>
   <script type="application/javascript"
           src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"/>
 
 <script>
 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");
 }
 </script>
 
 <body xmlns="http://www.w3.org/1999/xhtml">
 <p id="display">
 </p>
 <div id="content" style="display: none">
 </div>
--- a/toolkit/content/tests/chrome/test_panel_focus.xul
+++ b/toolkit/content/tests/chrome/test_panel_focus.xul
@@ -21,17 +21,17 @@
  
 SimpleTest.waitForExplicitFinish();
 function runTest()
 {
   // move the mouse so any tooltips that might be open go away, otherwise this
   // 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");
 }
 </script>
 
 <body xmlns="http://www.w3.org/1999/xhtml">
 <p id="display">
 </p>
 <div id="content" style="display: none">
 </div>
--- a/toolkit/content/tests/chrome/test_popup_anchor.xul
+++ b/toolkit/content/tests/chrome/test_popup_anchor.xul
@@ -11,17 +11,17 @@
           src="chrome://mochikit/content/MochiKit/packed.js"/>
   <script type="application/javascript"
           src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"/>
 
 <script>
 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");
 }
 </script>
 
 <body xmlns="http://www.w3.org/1999/xhtml">
 <p id="display">
 </p>
 <div id="content" style="display: none">
 </div>
--- a/toolkit/content/tests/chrome/test_popup_preventdefault_chrome.xul
+++ b/toolkit/content/tests/chrome/test_popup_preventdefault_chrome.xul
@@ -12,17 +12,17 @@
           src="chrome://mochikit/content/MochiKit/packed.js"/>
   <script type="application/javascript"
           src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"/>
 
 <script>
 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");
 }
 </script>
 
 <body xmlns="http://www.w3.org/1999/xhtml">
 <p id="display">
 </p>
 <div id="content" style="display: none">
 </div>
--- a/toolkit/content/tests/widgets/test_menubar.xul
+++ b/toolkit/content/tests/widgets/test_menubar.xul
@@ -10,17 +10,17 @@
   <title>Menubar Popup Tests</title>
   <script type="application/javascript" src="/MochiKit/packed.js"></script>
   <script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>      
 
 <script>
 SimpleTest.waitForExplicitFinish();
 function runTest()
 {
-  window.open("window_menubar.xul", "_new", "width=600,height=600");
+  window.open("window_menubar.xul", "_blank", "width=600,height=600");
 }
 </script>
 
 <body xmlns="http://www.w3.org/1999/xhtml">
 <p id="display">
 </p>
 <div id="content" style="display: none">
 </div>
--- a/toolkit/content/tests/widgets/test_menuchecks.xul
+++ b/toolkit/content/tests/widgets/test_menuchecks.xul
@@ -13,17 +13,17 @@
 
 <!--
   This test checks that checkbox and radio menu items work properly
   -->
 <script>
 SimpleTest.waitForExplicitFinish();
 function runTest()
 {
-  window.open("window_menuchecks.xul", "_new", "width=600,height=600");
+  window.open("window_menuchecks.xul", "_blank", "width=600,height=600");
 }
 </script>
 
 <body xmlns="http://www.w3.org/1999/xhtml">
 <p id="display">
 </p>
 <div id="content" style="display: none">
 </div>
--- a/toolkit/content/tests/widgets/test_popup_attribute.xul
+++ b/toolkit/content/tests/widgets/test_popup_attribute.xul
@@ -10,17 +10,17 @@
   <title>Popup Attribute Tests</title>
   <script type="application/javascript" src="/MochiKit/packed.js"></script>
   <script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>      
 
 <script>
 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");
 }
 </script>
 
 <body xmlns="http://www.w3.org/1999/xhtml">
 <p id="display">
 </p>
 <div id="content" style="display: none">
 </div>
--- a/toolkit/content/tests/widgets/test_popup_button.xul
+++ b/toolkit/content/tests/widgets/test_popup_button.xul
@@ -10,17 +10,17 @@
   <title>Menu Button Popup Tests</title>
   <script type="application/javascript" src="/MochiKit/packed.js"></script>
   <script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>      
 
 <script>
 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");
 }
 </script>
 
 <body xmlns="http://www.w3.org/1999/xhtml">
 <p id="display">
 </p>
 <div id="content" style="display: none">
 </div>
--- a/toolkit/content/tests/widgets/test_tooltip.xul
+++ b/toolkit/content/tests/widgets/test_tooltip.xul
@@ -11,17 +11,17 @@
   <script type="application/javascript" src="/MochiKit/packed.js"></script>
   <script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>      
   <script type="application/javascript" src="/tests/SimpleTest/EventUtils.js"></script>      
 
 <script>
 SimpleTest.waitForExplicitFinish();
 function runTest()
 {
-  window.open("window_tooltip.xul", "_new", "width=600,height=600");
+  window.open("window_tooltip.xul", "_blank", "width=600,height=600");
 }
 </script>
 
 <body xmlns="http://www.w3.org/1999/xhtml">
 <p id="display">
 </p>
 <div id="content" style="display: none">
 </div>