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

<iframe>s should fire error event if load fails

RESOLVED FIXED

Status

()

Core
DOM
RESOLVED FIXED
8 years ago
8 years ago

People

(Reporter: sicking, Assigned: sicking)

Tracking

Trunk
x86
Mac OS X
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

Created attachment 425630 [details] [diff] [review]
Patch to only fire events if we err before hitting network.

We currently for <img>s and other resources fire an "error" event if the loading of the resource fails. However we don't currently do this for <iframe>s (or any other frames).

Additionally calling |iframe.setAttribute("src", ...)| or |iframe.src = ...| throws an exception if the uri is file-url or any other url where CheckMayLoad fails. This should not happen since setting the attribute does in fact succeed.

Patch coming up to make us fire "error" events in a few of the cases where we should. It so far only fires the event if we fail to kick off the load. I.e. if we fail before we even hit the network.

I'm a little concerned about firing the event at more times since it will allow for probing for servers. So so far only firing if we fail for non-network related reasons.

I've tested that the patch works over in bug 543870. But need to write specific tests for this bug.
Attachment #425630 - Flags: review?(Olli.Pettay)

Comment 1

8 years ago
propagate is misspelled as propagage in a comment

Comment 2

8 years ago
(In reply to comment #0)
> But need to write specific
> tests for this bug.
Indeed. For each case an error event is fired.


HTML 5 draft isn't explaining too well when to fire error
"When content fails to load (e.g. due to a network error), then the user agent must queue a task to fire a simple event named error at the element instead."

Comment 3

8 years ago
(Oh, HTML5 draft may have a bug in iframe load event handling. Not related to this bug though.)

Comment 4

8 years ago
Comment on attachment 425630 [details] [diff] [review]
Patch to only fire events if we err before hitting network.

r+, if tests are written before committing.
Attachment #425630 - Flags: review?(Olli.Pettay) → review+
checked in

http://hg.mozilla.org/mozilla-central/rev/ff870ef6501d
Status: NEW → RESOLVED
Last Resolved: 8 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.