mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-01-06 00:25:12 +00:00
LibWeb: Add a DOM Event class (instead of events being simple strings)
This patch adds the Event base class, along with a MouseEvent subclass. We now dispatch MouseEvent objects for mousedown, mouseup and mousemove and these objects have the .offsetX and .offsetY properties. Both of those properties are hard-coded at the moment. This will be fixed in the next patch. :^)
This commit is contained in:
@@ -32,6 +32,7 @@
|
||||
#include <LibWeb/DOM/DocumentType.h>
|
||||
#include <LibWeb/DOM/Element.h>
|
||||
#include <LibWeb/DOM/ElementFactory.h>
|
||||
#include <LibWeb/DOM/Event.h>
|
||||
#include <LibWeb/DOM/Text.h>
|
||||
#include <LibWeb/Parser/HTMLParser.h>
|
||||
#include <ctype.h>
|
||||
@@ -378,7 +379,7 @@ RefPtr<Document> parse_html_document(const StringView& html, const URL& url)
|
||||
};
|
||||
fire_insertion_callbacks(document);
|
||||
|
||||
document->dispatch_event("DOMContentLoaded");
|
||||
document->dispatch_event(Event::create("DOMContentLoaded"));
|
||||
|
||||
return document;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user