bug with image named "link"

VERIFIED INVALID

Status

()

Core
Event Handling
P3
minor
VERIFIED INVALID
18 years ago
18 years ago

People

(Reporter: T'aZ, Assigned: joki (gone))

Tracking

Trunk
x86
Windows 95
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

(URL)

(Reporter)

Description

18 years ago
From Bugzilla Helper:
User-Agent: Mozilla/4.7 [en] (Win95; I)
BuildID:    2000061311

in a page, when there is a javascript which change the image when mouse is on 
this image (mouse over), 
the image doesn't change when his name is "link"


Reproducible: Always
Steps to Reproduce:
1.go to http://qtaz.citeweb.net
2.look at the menu at the top of the page
3.now, put your mouse on one of the menu, the image change..
4.but not when you are on the "link"

Actual Results:  nothing special, it just doesn t work

Expected Results:  use the "second" image like the others		

some code of my page
<script language="JavaScript">
//... other code (not important)
link1 = new Image;
link2 = new Image;
//...
link1.src = "link1.png";
link2.src = "link2.png";
//...
</script>
//...
<A HREF="link/link.html" OnMouseOver="link.src=link2.src" 
OnMouseOut="link.src=link1.src" target="centre">
<IMG SRC="link1.png" name=link BORDER=0 alt="LinK : Des liens avec logos"></A>

Comment 1

18 years ago
A browser issue, not JS Engine issue. Reassigning to Event Handling 
for triage or acceptance -

Assignee: rogerl → joki
Component: Javascript Engine → Event Handling
QA Contact: pschwartau → janc
Status: UNCONFIRMED → RESOLVED
Last Resolved: 18 years ago
Resolution: --- → INVALID
In my opinion Mozilla's behaviour is the correct one. Because of scoping, 
Mozilla finds the "background" (yes, the background link does not work either) 
and "link" properties from the BODY element (they are implied). See:

http://www.w3.org/TR/html4/struct/global.html#edef-BODY

You can verify that this is what is happening by adding, for example, 
"dump(background+'\n');" to the beginning of the background link OnMouseOver, 
and adding a non-empty background attribute to the BODY element.

There are ways you can work around this behaviour. One is to not use the 
"reserved" DOM properties, so you would need to change the names of the 
background and link names to something that do not collide with DOM. Another way  
is to forget the names altogether and use relative addressing. Instead of 
"background.src" you could write "firstChild.src" because the IMG element is the 
first child of the A element.

Updated URL so that it points to the actual frame where the "bug" appears.

If you think I am wrong in my assesment, please reopen this bug and state why 
you think it really is a bug. Thank you for testing and reporting problems with 
Mozilla.

Comment 3

18 years ago
Mass update:  changing qacontact to ckritzer@netscape.com
QA Contact: janc → ckritzer

Comment 4

18 years ago
Updating QA Contact.
QA Contact: ckritzer → lorca

Comment 5

18 years ago
Mozilla handles this correctly. Marking as verified.
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.