Image can't be changed in JS. Recent regression

VERIFIED FIXED in mozilla0.9.6

Status

()

Core
ImageLib
P2
critical
VERIFIED FIXED
17 years ago
17 years ago

People

(Reporter: Marc Boullet, Assigned: Stuart Parmenter)

Tracking

({regression})

Trunk
mozilla0.9.6
x86
All
regression
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(2 attachments)

(Reporter)

Description

17 years ago
The following example is extracted from one
of my pages and was still working a few days ago.
I use 2001101503 NT4

<html>
<head>
<script language="Javascript" type="text/javascript">
function changeImages() {
  document.getElementsByName("cgim")[0].src="test1.gif"
  document.getElementsByName("spsh")[0].src="test1.gif"
}
</script>
</head>
<body onload="changeImages()">
<table border="1" cellpadding="0" cellspacing="0" align="left" hspace="0"
bgcolor="#BBDDFF">
<tr><td valign="top"><img name="cgim" src="cgempty.gif" alt="" width="652"
height="510"></td>
    <td valign="top"><img name="spsh" src="cgempty.gif" alt="" width="309"
height="510"></td></tr>
</table>
</body>
</html>


Maybe it's a dup of some recent bugs on rollover images. But
since the rollover problem can stem from a "onmousover" problem
or a image SRC change problem, I prefer to file this bug.
imagelib
Assignee: jst → pavlov
Component: DOM Level 0 → ImageLib
QA Contact: amar → tpreston

Comment 2

17 years ago
Confirming on Win2K 2001101603.

I filed rollover bug 105095 yesterday, which I will mark as a dupe of this bug
since it's more general (per Marc's comment).
Status: UNCONFIRMED → NEW
Ever confirmed: true

Comment 3

17 years ago
*** Bug 105095 has been marked as a duplicate of this bug. ***

Comment 4

17 years ago
*** Bug 105416 has been marked as a duplicate of this bug. ***

Updated

17 years ago
Keywords: mozilla0.9.6, nsCatFood, regression

Comment 5

17 years ago
*** Bug 105460 has been marked as a duplicate of this bug. ***
*** Bug 105342 has been marked as a duplicate of this bug. ***
Recommend P1, blocker for Moz0.9.6.  This is a fatal regression to one of the
most common uses of JavaScript.

Comment 8

17 years ago
Think so too!
Bug 105460 confirms this on Linux and WinNT; independently confirmed on irc.  OS
-> All.
OS: Windows NT → All
On advice from jst, bumping severity to critical.  (jst advised not to set to
blocker)
Severity: major → critical

Comment 11

17 years ago
Note that the image's src property *is* being properly changed, and the new
image *is* retrieved from the network when it is called.  It is just not displayed.

Comment 12

17 years ago
I made this testcase for Bug 104817 (who is probably a dup of this one):

http://bugzilla.mozilla.org/attachment.cgi?id=53940&action=view
I'm having some trouble with this testcase.  Sometimes the src property returns
the mouseover src, sometimes it returns the original src.

javascript:alert(document.images[0].src) using CTRL+L while the mouse is over
the image.

Mozilla/5.0 (Windows; U; Win98; en-US; rv:0.9.5+) Gecko/20011018
Created attachment 54236 [details]
Same testcase, XHTML-based to prevent possible DOM glitches
Okay, revised testcase now shows indeed the src property is changing, but the
image is not, as reported earlier.  :)
*** Bug 104817 has been marked as a duplicate of this bug. ***
(Assignee)

Comment 17

17 years ago
Created attachment 54376 [details] [diff] [review]
fix typo
(Assignee)

Comment 18

17 years ago
the 2 should be a 1.
Status: NEW → ASSIGNED
Keywords: patch
Priority: -- → P2
Target Milestone: --- → mozilla0.9.6
Comment on attachment 54376 [details] [diff] [review]
fix typo

r=dbaron.  Pavlov explained to me on IRC that "when i removed lowsrc, all 2's
became 1's except for that one".
Attachment #54376 - Flags: review+

Comment 20

17 years ago
Comment on attachment 54376 [details] [diff] [review]
fix typo

sr=mscott
Attachment #54376 - Flags: superreview+
(Assignee)

Comment 21

17 years ago
fixed.
Status: ASSIGNED → RESOLVED
Last Resolved: 17 years ago
Resolution: --- → FIXED
(Assignee)

Comment 22

17 years ago
*** Bug 98229 has been marked as a duplicate of this bug. ***

Comment 23

17 years ago
And this is another reason why one should use constant names ;-)

Comment 24

17 years ago
Verified fixed Win XP build 2002012903, linux build 2002012909 and Mac OS X
build 2002012808
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.