Closed
Bug 300852
Opened 19 years ago
Closed 19 years ago
addEventListener throws an exception with FF 1.0.5
Categories
(Core :: DOM: Events, defect)
Tracking
()
RESOLVED
FIXED
People
(Reporter: legege, Unassigned)
Details
(Keywords: fixed-aviary1.0.6, fixed1.7.10, regression)
Attachments
(1 file)
1.66 KB,
patch
|
bzbarsky
:
review+
bzbarsky
:
superreview+
chase
:
approval-aviary1.0.6+
chase
:
approval1.7.10+
|
Details | Diff | Splinter Review |
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.9) Gecko/20050711 Firefox/1.0.5 Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.9) Gecko/20050711 Firefox/1.0.5 With Firefox 1.0.5, the addEventListener throws an Exception for an element that is in the chrome. This is what I do : ***** var sb = document.getElementById("searchbar"); sb.addEventListener("input", function() { alert('it works'); }, false, true); ***** This code throws this exception : ***** Error: [Exception... "'JavaScript component threw a null value as an exception' when calling method: [nsIDOMEventListener::handleEvent]" nsresult: "0x8057001d (NS_ERROR_XPC_JS_THREW_NULL)" location: "<unknown>" data: no] ***** I have to use XPCNativeWrapper to make it works. But this causes me many others problems. ***** var sb = new XPCNativeWrapper(document.getElementById("searchbar"), "addEventListener()"); ***** With Firefox 1.0.4, everything was fine. Reproducible: Always Actual Results: The event listener isn't added. Expected Results: No exception, and the event listener is added.
Reporter | ||
Updated•19 years ago
|
Summary: Incompatible extension with Firefox 1.0.5 → addEventListener throws an exception with FF 1.0.5
Updated•19 years ago
|
Severity: normal → major
Updated•19 years ago
|
Assignee: nobody → events
Component: General → DOM: Events
Product: Firefox → Core
QA Contact: general → ian
Version: unspecified → 1.0 Branch
Comment 1•19 years ago
|
||
Out of interest, does it work if you use this: var sb = document.getElementById("searchbar"); sb.addEventListener("input", { handleEvent: function() { alert('it works'); } }, false, true);
Comment 2•19 years ago
|
||
Can you please attach a testcase that shows this problem?
Comment 3•19 years ago
|
||
Found the problem, no need for a testcase.
Status: UNCONFIRMED → ASSIGNED
Ever confirmed: true
Comment 4•19 years ago
|
||
This was due to a difference in the nsXULElement code on the trunk and branches. On the trunk, where the patch that introduced this was developed, nsXULElement inherits nsGenericElement and gets a QI that returns an interface for nsIDOMNSEventTarget, but on the trunk there's no such inheritance, so nsXULElement's QI needs to deal. This is a trivial fix to simply add the missing code.
Attachment #189458 -
Flags: superreview?(brendan)
Attachment #189458 -
Flags: review?(dveditz)
Comment 5•19 years ago
|
||
Comment on attachment 189458 [details] [diff] [review] Fix. r+sr=bzbarsky; requesting branch approvals (this is not needed on trunk)
Attachment #189458 -
Flags: superreview?(brendan)
Attachment #189458 -
Flags: superreview+
Attachment #189458 -
Flags: review?(dveditz)
Attachment #189458 -
Flags: review+
Attachment #189458 -
Flags: approval1.7.10?
Attachment #189458 -
Flags: approval-aviary1.0.6?
Updated•19 years ago
|
Flags: blocking-aviary1.0.6?
Updated•19 years ago
|
Flags: blocking1.7.10?
Keywords: regression
Reporter | ||
Comment 6•19 years ago
|
||
Do you know if there is a work around for this problem in FF 1.0.5?
Comment 7•19 years ago
|
||
You can add an event handler that listens for all events and explicitly check the trusted flag on them...
Comment 8•19 years ago
|
||
Comment on attachment 189458 [details] [diff] [review] Fix. a=chase. API fix, needs to land soon to catch respins.
Attachment #189458 -
Flags: approval1.7.10?
Attachment #189458 -
Flags: approval1.7.10+
Attachment #189458 -
Flags: approval-aviary1.0.6?
Attachment #189458 -
Flags: approval-aviary1.0.6+
Updated•19 years ago
|
Flags: blocking-aviary1.0.6? → blocking-aviary1.0.6+
Updated•19 years ago
|
Flags: blocking1.7.10? → blocking1.7.10+
Comment 9•19 years ago
|
||
Fixed on branches, not a problem on the trunk.
Status: ASSIGNED → RESOLVED
Closed: 19 years ago
Flags: blocking1.7.10?
Flags: blocking1.7.10+
Flags: blocking-aviary1.0.6?
Flags: blocking-aviary1.0.6+
Keywords: fixed-aviary1.0.6,
fixed1.7.10
Resolution: --- → FIXED
Updated•19 years ago
|
Flags: blocking1.7.10?
Flags: blocking1.7.10+
Flags: blocking-aviary1.0.6?
Flags: blocking-aviary1.0.6+
You need to log in
before you can comment on or make changes to this bug.
Description
•