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

dispatchEvent on XMLDocument fails with NS_ERROR_FAILURE

RESOLVED WORKSFORME

Status

()

Firefox
General
RESOLVED WORKSFORME
11 years ago
9 years ago

People

(Reporter: fcp, Unassigned)

Tracking

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

(Reporter)

Description

11 years ago
User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.1; ja; rv:1.8.1.3) Gecko/20070309 Firefox/2.0.0.3
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; ja; rv:1.8.1.3) Gecko/20070309 Firefox/2.0.0.3

If you create an XMLDocument, create a custom event and dispatch the event on the XMLDocument, dispatchEvent throws an exception NS_ERROR_FAILURE.  See the attached example.

This happens no matter whether the document has a "chrome:" URL or not.

This does not happen if you use window.document instead of the XMLDocument created by script.


Reproducible: Always

Steps to Reproduce:
1. Open attachment.

Actual Results:  
Nothing happens.  The Console^2 extension shows:
Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsIDOMEventTarget.dispatchEvent]


Expected Results:  
Two alert boxes should appear, one saying "testevent" and the other "Completed."
(Reporter)

Comment 1

11 years ago
Created attachment 262894 [details]
An example reproducing the bug
(Reporter)

Comment 2

11 years ago
Naturally you can work around this issue by maintaining event listeners on the custom event by yourself and avoiding using dispatchEvent.

Comment 3

9 years ago
This WFM in Fx 3.0 and higher. Likely due to bug 412567, but I can't prove it.
Status: UNCONFIRMED → RESOLVED
Last Resolved: 9 years ago
Resolution: --- → WORKSFORME
You need to log in before you can comment on or make changes to this bug.