diff --git a/Userland/Libraries/LibWeb/HTML/HTMLMeterElement.cpp b/Userland/Libraries/LibWeb/HTML/HTMLMeterElement.cpp index 3acf20e87a7..873b29e9963 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLMeterElement.cpp +++ b/Userland/Libraries/LibWeb/HTML/HTMLMeterElement.cpp @@ -5,7 +5,6 @@ * SPDX-License-Identifier: BSD-2-Clause */ -#include #include #include #include @@ -188,6 +187,11 @@ void HTMLMeterElement::inserted() create_shadow_tree_if_needed(); } +void HTMLMeterElement::removed_from(DOM::Node*) +{ + set_shadow_root(nullptr); +} + void HTMLMeterElement::create_shadow_tree_if_needed() { if (shadow_root_internal()) diff --git a/Userland/Libraries/LibWeb/HTML/HTMLMeterElement.h b/Userland/Libraries/LibWeb/HTML/HTMLMeterElement.h index c95188c93f0..391da7867ef 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLMeterElement.h +++ b/Userland/Libraries/LibWeb/HTML/HTMLMeterElement.h @@ -41,6 +41,7 @@ public: private: CSS::Selector::PseudoElement m_pseudo_element; }; + class HTMLMeterElement final : public HTMLElement { WEB_PLATFORM_OBJECT(HTMLMeterElement, HTMLElement); JS_DECLARE_ALLOCATOR(HTMLMeterElement); @@ -63,6 +64,7 @@ public: // ^HTMLElement virtual void inserted() override; + virtual void removed_from(DOM::Node*) override; // https://html.spec.whatwg.org/multipage/forms.html#category-label virtual bool is_labelable() const override { return true; }