Closed
Bug 151245
Opened 22 years ago
Closed 22 years ago
img src not able to be set in onerror/onclick handler
Categories
(Core :: DOM: Events, defect)
Tracking
()
People
(Reporter: bc, Assigned: bryner)
Details
(Keywords: topembed+)
Attachments
(5 files, 1 obsolete file)
I looked but could not find this bug in bugzilla. The following two test cases
work in IE6 and Nav4 but do not work in Mozilla trunk or branch 2002 06 10
This bug is important for a major web site. I need to know what the situation is
with this bug ASAP.
Reporter | ||
Comment 1•22 years ago
|
||
Reporter | ||
Comment 2•22 years ago
|
||
Reporter | ||
Updated•22 years ago
|
Reporter | ||
Comment 3•22 years ago
|
||
Note that onmouseover can change the src of an img
Reporter | ||
Comment 4•22 years ago
|
||
Reporter | ||
Comment 5•22 years ago
|
||
Attachment #87506 -
Attachment is obsolete: true
Assignee | ||
Comment 7•22 years ago
|
||
So, the main problem here is that kicking off a new image load happens via
nsImageFrame's handling of the 'src' attribute change. In the case where the
image originally failed to load, we've constructed an nsInlineFrame instead of
an nsImageFrame, so there is no handling of the src attribute change. I think
we need to make a reframe happen in this case.
Assignee | ||
Comment 8•22 years ago
|
||
It's kind of gross, but I came up with a workaround that tells the document that
the image content has been replaced if 'src' is set and we have a frame that's
not an image frame.
Per conversation with dbaron, a better way to fix this would be to move the
image loading code into nsHTMLImageElement and then notify the frame constructor
that it needs to construct a new frame, either via a direct API or by having a
CSS pseudoclass that indicates that the element is replaced (we would unset the
pseudoclass when the 'src' is chanegd, and the style system would know to
construct a new frame).
Status: NEW → ASSIGNED
Assignee | ||
Comment 9•22 years ago
|
||
Assignee | ||
Comment 10•22 years ago
|
||
Actually, there's a better discussion of the problem and a possible fix over in
bug 22820. The failure of the testcases here does not have anything to do with
being in an onerror or onclick handler, it's all because the original image src
was invalid.
*** This bug has been marked as a duplicate of 22820 ***
Status: ASSIGNED → RESOLVED
Closed: 22 years ago
Resolution: --- → DUPLICATE
You need to log in
before you can comment on or make changes to this bug.
Description
•