mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-04-27 10:07:15 +02: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:
committed by
Linus Groh
parent
a2ccb00e1d
commit
f0c5f77f99
Notes:
sideshowbarker
2024-07-17 06:28:27 +09:00
Author: https://github.com/ADKaster Commit: https://github.com/SerenityOS/serenity/commit/f0c5f77f99 Pull-request: https://github.com/SerenityOS/serenity/pull/15349 Reviewed-by: https://github.com/linusg ✅
@@ -13,7 +13,7 @@ namespace Web::HTML {
|
||||
HTMLTemplateElement::HTMLTemplateElement(DOM::Document& document, DOM::QualifiedName qualified_name)
|
||||
: HTMLElement(document, move(qualified_name))
|
||||
{
|
||||
set_prototype(&window().cached_web_prototype("HTMLTemplateElement"));
|
||||
set_prototype(&Bindings::cached_web_prototype(realm(), "HTMLTemplateElement"));
|
||||
|
||||
m_content = heap().allocate<DOM::DocumentFragment>(realm(), appropriate_template_contents_owner_document(document));
|
||||
m_content->set_host(this);
|
||||
@@ -31,7 +31,7 @@ DOM::Document& HTMLTemplateElement::appropriate_template_contents_owner_document
|
||||
{
|
||||
if (!document.created_for_appropriate_template_contents()) {
|
||||
if (!document.associated_inert_template_document()) {
|
||||
auto new_document = DOM::Document::create(Bindings::main_thread_internal_window_object());
|
||||
auto new_document = DOM::Document::create(realm());
|
||||
new_document->set_created_for_appropriate_template_contents(true);
|
||||
new_document->set_document_type(document.document_type());
|
||||
|
||||
|
||||
Reference in New Issue
Block a user