Closed Bug 252961 Opened 20 years ago Closed 20 years ago

Image.onerror doesn't fire if image missing

Categories

(Core :: DOM: UI Events & Focus Handling, defect)

PowerPC
macOS
defect
Not set
normal

Tracking

()

RESOLVED DUPLICATE of bug 269125

People

(Reporter: blmatthews, Unassigned)

References

(Depends on 1 open bug)

Details

Attachments

(1 file)

User-Agent:       Mozilla/5.0 (Macintosh; U; PPC Mac OS X Mach-O; en-US; rv:1.7) Gecko/20040616
Build Identifier: Mozilla/5.0 (Macintosh; U; PPC Mac OS X Mach-O; en-US; rv:1.7) Gecko/20040616

With:

    var img = new Image();
    img.onerror = imageError;
    img.onload = imageLoad;
    img.src = 'file:///test.gif';

imageError isn't called if test.gif doesn't exist at root. imageLoad is called
as expected if test.gif does exist at root.

Reproducible: Always
Steps to Reproduce:
1.Open attached sample file.
2.Make sure file:///test.gif doesn't exist.
3.Click Go.

Actual Results:  
Nothing

Expected Results:  
The imageError function should have run, resulting in an alert stating "Image
failed to load."
I think a security issue is going on here. 
Mozilla is probably not firing the onerror event, because you use 'file:///'.
When using 'http://' the onerror gets fired (at least it does here). 
I see this using LInux 2004101106.
I see this even when running from file://.

*** This bug has been marked as a duplicate of 269125 ***
Status: UNCONFIRMED → RESOLVED
Closed: 20 years ago
Resolution: --- → DUPLICATE
We should add this testcase once we have file:// mochitests.
Depends on: 424484
Flags: in-testsuite?
Component: Event Handling → User events and focus handling
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: