mirror of
https://github.com/RGBCube/serenity
synced 2026-01-12 22:41:00 +00:00
LibWeb: Separate "event listener" from "EventListener"
I can't imagine how this happened, but it seems we've managed to
conflate the "event listener" and "EventListener" concepts from the DOM
specification in some parts of the code.
We previously had two things:
- DOM::EventListener
- DOM::EventTarget::EventListenerRegistration
DOM::EventListener was roughly the "EventListener" IDL type,
and DOM::EventTarget::EventListenerRegistration was roughly the "event
listener" concept. However, they were used interchangeably (and
incorrectly!) in many places.
After this patch, we now have:
- DOM::IDLEventListener
- DOM::DOMEventListener
DOM::IDLEventListener is the "EventListener" IDL type,
and DOM::DOMEventListener is the "event listener" concept.
This patch also updates the addEventListener() and removeEventListener()
functions to follow the spec more closely, along with the "inner invoke"
function in our EventDispatcher.
This commit is contained in:
parent
0e2cd5540a
commit
e76e8e22b5
21 changed files with 223 additions and 129 deletions
|
|
@ -11,7 +11,7 @@
|
|||
#include <LibJS/Heap/Handle.h>
|
||||
#include <LibJS/Runtime/FunctionObject.h>
|
||||
#include <LibWeb/Bindings/CallbackType.h>
|
||||
#include <LibWeb/DOM/EventListener.h>
|
||||
#include <LibWeb/DOM/DOMEventListener.h>
|
||||
|
||||
namespace Web::HTML {
|
||||
|
||||
|
|
@ -34,7 +34,7 @@ struct EventHandler {
|
|||
Variant<String, Bindings::CallbackType> value;
|
||||
|
||||
// https://html.spec.whatwg.org/multipage/webappapis.html#event-handler-listener
|
||||
RefPtr<DOM::EventListener> listener;
|
||||
RefPtr<DOM::DOMEventListener> listener;
|
||||
};
|
||||
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue