summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibWeb/HTML/HTMLStyleElement.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'Userland/Libraries/LibWeb/HTML/HTMLStyleElement.cpp')
-rw-r--r--Userland/Libraries/LibWeb/HTML/HTMLStyleElement.cpp6
1 files changed, 2 insertions, 4 deletions
diff --git a/Userland/Libraries/LibWeb/HTML/HTMLStyleElement.cpp b/Userland/Libraries/LibWeb/HTML/HTMLStyleElement.cpp
index 05f8632987..9dece219dc 100644
--- a/Userland/Libraries/LibWeb/HTML/HTMLStyleElement.cpp
+++ b/Userland/Libraries/LibWeb/HTML/HTMLStyleElement.cpp
@@ -34,7 +34,7 @@ namespace Web::HTML {
HTMLStyleElement::HTMLStyleElement(DOM::Document& document, QualifiedName qualified_name)
: HTMLElement(document, move(qualified_name))
- , m_css_loader(document)
+ , m_css_loader(*this)
{
m_css_loader.on_load = [&] {
document.update_style();
@@ -54,10 +54,8 @@ void HTMLStyleElement::children_changed()
});
m_css_loader.load_from_text(builder.to_string());
- if (auto sheet = m_css_loader.style_sheet()) {
- sheet->set_owner_node(this);
+ if (auto sheet = m_css_loader.style_sheet())
document().style_sheets().add_sheet(sheet.release_nonnull());
- }
HTMLElement::children_changed();
}