window.name should reflect link target attribute even if I use e.g. "Open Link in New Tab"

RESOLVED WONTFIX

Status

()

RESOLVED WONTFIX
13 years ago
a year ago

People

(Reporter: robertotest, Unassigned)

Tracking

1.8 Branch
x86
Windows XP
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

(Whiteboard: parity-ie)

(Reporter)

Description

13 years ago
User-Agent:       Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 1.1.4322)
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.0.1) Gecko/20060111 Firefox/1.5.0.1

 have a page with a a href tag like this: 
<a href="mypage.html" target="xxx">Click here</a> 

User can so open it click directly on the iperlink or decide to open in another window/tab. 

the mypage.html try to get the window.name but this is not correct (i think so) if the page is open in a new window/tab with Firefox 1.x (i try with 1.5.0.1 too). On IE all works fine (and if i remember well also with older version of Mozilla and so maybe with a older version of gecko engine). 

in every case with IE the window.name return "xxx" either if it's open in the same window or in a new window. 
Using Firefox instead window.name return "xxx" only if open in the same window. 
If the user open the linked page using "open in a new window/tab" the window.name value is void. 

From http://www.w3.org/TR/REC-html40/present/frames.html#h-16.3.2 you can read that :

"If an element has its target attribute set to a known frame, when the element is activated (i.e., a link is followed or a form is processed), the resource designated by the element should be loaded into the target frame"

So also if the user open the link in a new window, the window name must be the target one..


Reproducible: Always

Steps to Reproduce:
To reproduce the bug use this html page:

TestFirefox.html 

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
<HTML dir="">
<HEAD>
<META http-equiv="Content-Style-Type" content="text/css; charset=">
<META HTTP-EQUIV="Expires" CONTENT="0">
</HEAD>
<BODY>
<FORM>
<a href="TestFirefox2.html" target="main">Click Here</a><br>
If you open the link directly the results is correct, <br>
istead if you open the link using "open in a new window (or tab)" the window.name is not valid.<br>
In every case the value must be equal to the target one (so "main" in this example).
</FORM>
</BODY>
</HTML>


TestFirefox2.html

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
<HTML dir="">
<HEAD>
<META http-equiv="Content-Style-Type" content="text/css; charset=">
<META HTTP-EQUIV="Expires" CONTENT="0">
<SCRIPT>
alert("window name:" +window.name);
</SCRIPT>
</HEAD>
<BODY>
The alest must show "main" as window name!!!
</BODY>
</HTML>


Actual Results:  
Now you can execute the TestFirefox.html page.
Try it using Firefox and IE. and open the link click directly or using the open in new window or tab.
You can see that if you open the link in a new window (e.g. using the context menu) the value on the TestFirefox2.html of window.name is void instead that "main".

Expected Results:  
window.name in TestFirefox2.html must be always equals to the target set in the caller window (so "main")

Updated

13 years ago
Assignee: nobody → general
Component: General → DOM: Level 0
Product: Firefox → Core
QA Contact: general → ian
Summary: Open in new window and window.name bug → window.name should reflect link target attribute even if I use e.g. "Open Link in New Tab"
Whiteboard: parity-ie
Version: unspecified → 1.8 Branch

Comment 1

13 years ago
Related to bug 314402 comment 5 -> bug 121377?
Assignee: general → nobody
QA Contact: ian → general

Comment 2

2 years ago
data:text/html,<a href="data:text/html,<script>document.write(window.name==='')</script>" target=test>test</a>

I can reproduce this still. Seems to work in Chrome too. Middle-click doesn't really change the name of the target window. Not sure if I prefer the Chrome behavior though.
Status: UNCONFIRMED → NEW
Ever confirmed: true

Comment 3

a year ago
I don't think we should fix this. Safari doesn't do this either. The less names are leaked the better.
Status: NEW → RESOLVED
Last Resolved: a year ago
Resolution: --- → WONTFIX
You need to log in before you can comment on or make changes to this bug.