If you think a bug might affect users in the 57 release, please set the correct tracking and status flags for Release Management.

Image.onerror doesn't fire if image missing

RESOLVED DUPLICATE of bug 269125

Status

()

Core
Event Handling
RESOLVED DUPLICATE of bug 269125
13 years ago
9 years ago

People

(Reporter: Brian L. Matthews, Unassigned)

Tracking

(Depends on: 1 bug)

Trunk
PowerPC
Mac OS X
Points:
---
Bug Flags:
in-testsuite ?

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

(Reporter)

Description

13 years ago
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."
(Reporter)

Comment 1

13 years ago
Created attachment 154263 [details]
A simple HTML & JavaScript file demonstrating the problem.
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). 

Comment 3

13 years ago
I see this using LInux 2004101106.
I see this even when running from file://.

Comment 4

13 years ago

*** This bug has been marked as a duplicate of 269125 ***
Status: UNCONFIRMED → RESOLVED
Last Resolved: 13 years ago
Resolution: --- → DUPLICATE
We should add this testcase once we have file:// mochitests.
Depends on: 424484
Flags: in-testsuite?
You need to log in before you can comment on or make changes to this bug.