Make Node inherit from EventTarget

RESOLVED FIXED

Status

()

Core
DOM
RESOLVED FIXED
7 years ago
3 years ago

People

(Reporter: heycam, Unassigned)

Tracking

(Depends on: 1 bug)

Firefox Tracking Flags

(Not tracked)

Details

(Reporter)

Description

7 years ago
We should experiment with making Node (and other interfaces that implement EventTarget) extend from EventTarget rather than mixing it in.  As perhaps the most popular mixed in interface, it would be helpful for authors to be able to get at the single, canonical property that defines addEventListener, etc.
To make it clear: the goal here is to get specs updated to make EventTarget be the root of Node as well as other interfaces.

The following interfaces should also inherit EventTarget:

Window
XMLHttpRequest
Worker (also SharedWorker in spec, we don't implement this interface yet)
FileReader
IDBDatabase
IDBTransaction
IDBRequest
WebSocket
EventSource (in patch, not yet landed)

There's probably more that I'm forgetting.

Comment 2

7 years ago
Yes! This is exactly what I want.
WebIDL had(has?) something else for some time, and I was going to complain about 
it.

EventTarget should be the one XHR and Node and Window etc inherit.
(Internally nsINode, nsGlobalWindow, XHR, etc inherit nsPIDOMEventTarget)

Comment 3

7 years ago
(In reply to comment #1)
> There's probably more that I'm forgetting.

In other words nsINode, Window, whatever inherits nsDOMEventTargetHelper
and Worker's global.
(Reporter)

Comment 4

7 years ago
Olli, is it too late to change this in DOM 3 Events (realising of course that it is not written in Web IDL, though)?

Comment 5

7 years ago
I don't see how this has anything to do with DOM 3 Events.
(Reporter)

Comment 6

7 years ago
Er yeah, my mistake, it's an issue for DOM Core etc.
Depends on: 580070
I believe this is done now, yes?  Anything left to do here?

Updated

3 years ago
Status: NEW → RESOLVED
Last Resolved: 3 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.