Stop treating _new as a special window target. No other browser does. Bug 417067, r+sr=jst, a=beltzner

This commit is contained in:
bzbarsky@mit.edu 2008-02-13 21:05:25 -08:00
parent d2a6517917
commit 41f1d79e6e
12 changed files with 12 additions and 15 deletions

View File

@ -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)

View File

@ -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.

View File

@ -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);

View File

@ -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");
}
</script>

View File

@ -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");
}
</script>

View File

@ -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");
}
</script>

View File

@ -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");
}
</script>

View File

@ -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");
}
</script>

View File

@ -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");
}
</script>

View File

@ -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");
}
</script>

View File

@ -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");
}
</script>

View File

@ -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");
}
</script>