Closed Bug 646687 Opened 13 years ago Closed 13 years ago

In addEventListener useCapture is not optional, but should default to false

Categories

(Core :: DOM: Events, defect)

defect
Not set
minor

Tracking

()

VERIFIED DUPLICATE of bug 613634

People

(Reporter: michael, Unassigned)

Details

User-Agent:       Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:2.0) Gecko/20100101 Firefox/4.0
Build Identifier: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:2.0) Gecko/20100101 Firefox/4.0

From my understanding of javascript standards, the useCapture argument to addEventListener should be optional, that is it should default to false.

e.g.
window.addEventListener("load", window_load);

Should be the same as:
window.addEventListener("load", window_load, false);

This works in WebKit browsers, but not Firefox 4.0, but it also fails silently.

Reproducible: Always

Steps to Reproduce:
Call the addEventListener method leaving out the optional useCapture argument. 
Actual Results:  
The event will never be added and the script will not break at that point.


Expected Results:  
The software should have assigned the event with useCapture set to false, or less ideally thrown an exception.
Status: UNCONFIRMED → RESOLVED
Closed: 13 years ago
Component: General → DOM: Events
Product: Firefox → Core
QA Contact: general → events
Resolution: --- → DUPLICATE
Version: unspecified → Trunk
OS: Mac OS X → All
Hardware: x86 → All
Verified.  Note that according to current standards this argument is not optional, though there are proposals to change the standards to make it optional.
(Depends on what you mean by current standards, I suppose. Both DOM Core <http://dvcs.w3.org/hg/domcore/raw-file/tip/Overview.html#interface-eventtarget> and DOM 3 Events <http://dev.w3.org/2006/webapi/DOM-Level-3-Events/html/DOM3-Events.html#interface-EventTarget> make it optional.)
Status: RESOLVED → VERIFIED
Both DOM 3 Events and DOM Core are drafts, and they will change, as you know ;)
Ms2ger, neither of those is close to being a REC (or even LC), as you well know.
You need to log in before you can comment on or make changes to this bug.