mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-05-01 16:58:52 +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:
parent
97674da502
commit
f39e5352f0
Notes:
sideshowbarker
2024-07-19 08:15:29 +09:00
Author: https://github.com/awesomekling
Commit: f39e5352f0
17 changed files with 310 additions and 11 deletions
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue