From 68440ed02d624d5ed354c73fc16327000db878a6 Mon Sep 17 00:00:00 2001 From: Aliaksandr Kalenik Date: Wed, 17 Apr 2024 13:56:55 +0200 Subject: [PATCH] LibWeb: Destroy associated navigable when is removed from DOM --- Userland/Libraries/LibWeb/HTML/HTMLObjectElement.cpp | 5 +++++ Userland/Libraries/LibWeb/HTML/HTMLObjectElement.h | 1 + 2 files changed, 6 insertions(+) diff --git a/Userland/Libraries/LibWeb/HTML/HTMLObjectElement.cpp b/Userland/Libraries/LibWeb/HTML/HTMLObjectElement.cpp index 3c7c444c170..61658c9d396 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLObjectElement.cpp +++ b/Userland/Libraries/LibWeb/HTML/HTMLObjectElement.cpp @@ -68,6 +68,11 @@ void HTMLObjectElement::form_associated_element_attribute_changed(FlyString cons } } +void HTMLObjectElement::form_associated_element_was_removed(DOM::Node*) +{ + destroy_the_child_navigable(); +} + // https://html.spec.whatwg.org/multipage/iframe-embed-object.html#attr-object-data String HTMLObjectElement::data() const { diff --git a/Userland/Libraries/LibWeb/HTML/HTMLObjectElement.h b/Userland/Libraries/LibWeb/HTML/HTMLObjectElement.h index 26803bd644d..082e20fa8b3 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLObjectElement.h +++ b/Userland/Libraries/LibWeb/HTML/HTMLObjectElement.h @@ -36,6 +36,7 @@ public: virtual ~HTMLObjectElement() override; virtual void form_associated_element_attribute_changed(FlyString const& name, Optional const& value) override; + virtual void form_associated_element_was_removed(DOM::Node*) override; String data() const; void set_data(String const& data) { MUST(set_attribute(HTML::AttributeNames::data, data)); }