Closed Bug 105257 Opened 23 years ago Closed 23 years ago

Image can't be changed in JS. Recent regression

Categories

(Core :: Graphics: ImageLib, defect, P2)

x86
All
defect

Tracking

()

VERIFIED FIXED
mozilla0.9.6

People

(Reporter: boullet.marc, Assigned: pavlov)

References

Details

(Keywords: regression)

Attachments

(2 files)

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
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
*** Bug 105095 has been marked as a duplicate of this bug. ***
*** Bug 105416 has been marked as a duplicate of this bug. ***
*** 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.
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
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.
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
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. ***
Attached patch fix typoSplinter Review
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 on attachment 54376 [details] [diff] [review]
fix typo

sr=mscott
Attachment #54376 - Flags: superreview+
fixed.
Status: ASSIGNED → RESOLVED
Closed: 23 years ago
Resolution: --- → FIXED
*** Bug 98229 has been marked as a duplicate of this bug. ***
And this is another reason why one should use constant names ;-)
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.

Attachment

General

Created:
Updated:
Size: