mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-02-19 22:25:36 +00:00
LibWeb: Start working on DOM event support
This patch adds the EventTarget class and makes Node inherit from it. You can register event listeners on an EventTarget, and when you call dispatch_event() on it, the event listeners will get invoked. An event listener is basically a wrapper around a JS::Function*. This is pretty far from how DOM events should eventually work, but it's a place to start and we'll build more on top of this. :^)
This commit is contained in:
@@ -378,6 +378,8 @@ RefPtr<Document> parse_html_document(const StringView& html, const URL& url)
|
||||
};
|
||||
fire_insertion_callbacks(document);
|
||||
|
||||
document->dispatch_event("DOMContentLoaded");
|
||||
|
||||
return document;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user