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:184.108.40.206) Gecko/20060111 Firefox/220.127.116.11 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]
Created attachment 215862 [details] test case that shows capture phase not happening for img load event
See also related bug 331308
This appears working on trunk. Probably as a result of bug 234455.
(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.