mirror of
https://github.com/RGBCube/serenity
synced 2025-05-20 13:55:08 +00:00
LibWeb: Remove unecessary dependence on Window from HTML classes
These classes only needed Window to get at its realm. Pass a realm directly to construct HTML classes.
This commit is contained in:
parent
a2ccb00e1d
commit
f0c5f77f99
122 changed files with 334 additions and 317 deletions
|
@ -22,13 +22,13 @@ HTMLImageElement::HTMLImageElement(DOM::Document& document, DOM::QualifiedName q
|
|||
: HTMLElement(document, move(qualified_name))
|
||||
, m_image_loader(*this)
|
||||
{
|
||||
set_prototype(&window().cached_web_prototype("HTMLImageElement"));
|
||||
set_prototype(&Bindings::cached_web_prototype(realm(), "HTMLImageElement"));
|
||||
|
||||
m_image_loader.on_load = [this] {
|
||||
set_needs_style_update(true);
|
||||
this->document().set_needs_layout();
|
||||
queue_an_element_task(HTML::Task::Source::DOMManipulation, [this] {
|
||||
dispatch_event(*DOM::Event::create(this->document().window(), EventNames::load));
|
||||
dispatch_event(*DOM::Event::create(this->realm(), EventNames::load));
|
||||
});
|
||||
};
|
||||
|
||||
|
@ -37,7 +37,7 @@ HTMLImageElement::HTMLImageElement(DOM::Document& document, DOM::QualifiedName q
|
|||
set_needs_style_update(true);
|
||||
this->document().set_needs_layout();
|
||||
queue_an_element_task(HTML::Task::Source::DOMManipulation, [this] {
|
||||
dispatch_event(*DOM::Event::create(this->document().window(), EventNames::error));
|
||||
dispatch_event(*DOM::Event::create(this->realm(), EventNames::error));
|
||||
});
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue