The default bug view has changed. See this FAQ.

The "load" event on images does not achieve the capture phase

RESOLVED WORKSFORME

Status

()

Core
DOM: Events
RESOLVED WORKSFORME
11 years ago
11 years ago

People

(Reporter: Maciej Stachowiak, Unassigned)

Tracking

Trunk
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

(Reporter)

Description

11 years ago
User-Agent:       Mozilla/5.0 (Macintosh; U; Intel Mac OS X; en) AppleWebKit/417.9 (KHTML, like Gecko) Safari/417.8
Build Identifier: Mozilla/5.0 (Macintosh; U; PPC Mac OS X Mach-O; en-US; rv:1.8.0.1) Gecko/20060111 Firefox/1.5.0.1

Event listeners registered with a true useCapture argument on ancestors of an IMG element do not receive the "load" event. It is correct for them not to bubble, but every event on on element should achieve the capture phase.

Reproducible: Always

Steps to Reproduce:
1. Try test case to be attached shortly.
2.
3.
Actual Results:  
Capturing listeners on document and body do not fire when the image load event does. Not achieving the capture phase for "load" is contrary to DOM Level 2 Events and DOM Level 3 events. It also creates possible compatibility problems when sites write to firefox. For example, if content sets a capturing event listener for "load" on the window expecting it to fire on load of the document, it would fire for every image that loads in a conforming implementation.

See also related bug 235441 which causes capturing listeners to fire on the target of the event. The test logs:

IMG, phase: 2 target: [object HTMLDocument]
IMG, phase: 2 target: [object HTMLDocument]

As an additional bug, the event's target is the document even though it is dispatched on image elements. I'll file that one separately. Also, bug 235441 causes the capture handler on the img to fire, it should not.

Expected Results:  
Capturing listeners should have fired. Logging should be something like:

Window, phase: 1 target: [object IMG]
Document, phase: 1 target: [object IMG]
Body, phase: 1 target: [object IMG]
IMG, phase: 2 target: [object IMG]
(Reporter)

Comment 1

11 years ago
Created attachment 215862 [details]
test case that shows capture phase not happening for img load event
(Reporter)

Comment 2

11 years ago
See also related bug 331308
This appears working on trunk. Probably as a result of bug 234455.

Comment 4

11 years ago
(In reply to comment #3)
> This appears working on trunk. Probably as a result of bug 234455.
> 

Yep, this was fixed in bug 234455.
I'd like to fix bug 235441 too, but it is still
unclear what should happen when XBL is used.

Status: UNCONFIRMED → RESOLVED
Last Resolved: 11 years ago
Resolution: --- → FIXED

Updated

11 years ago
Status: RESOLVED → UNCONFIRMED
Resolution: FIXED → ---

Updated

11 years ago
Status: UNCONFIRMED → RESOLVED
Last Resolved: 11 years ago11 years ago
Resolution: --- → WORKSFORME
You need to log in before you can comment on or make changes to this bug.