summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibWeb/HTML
diff options
context:
space:
mode:
authorIdan Horowitz <idan.horowitz@gmail.com>2022-03-24 22:09:47 +0200
committerAndreas Kling <kling@serenityos.org>2022-03-24 21:37:49 +0100
commit215432c3e8bb0e70c0b231e7566c118eb99b6404 (patch)
tree7996f9b166973044db280673c0b7fab5559885b6 /Userland/Libraries/LibWeb/HTML
parentf82d4d001d6feb8fa09bbf5882f424bfa1a2a208 (diff)
downloadserenity-215432c3e8bb0e70c0b231e7566c118eb99b6404.zip
LibWeb: Discard ObjectElement's nested browsing context on image load
Diffstat (limited to 'Userland/Libraries/LibWeb/HTML')
-rw-r--r--Userland/Libraries/LibWeb/HTML/HTMLObjectElement.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/Userland/Libraries/LibWeb/HTML/HTMLObjectElement.cpp b/Userland/Libraries/LibWeb/HTML/HTMLObjectElement.cpp
index c922f82b3a..5c5aa9f219 100644
--- a/Userland/Libraries/LibWeb/HTML/HTMLObjectElement.cpp
+++ b/Userland/Libraries/LibWeb/HTML/HTMLObjectElement.cpp
@@ -215,7 +215,11 @@ void HTMLObjectElement::run_object_representation_handler_steps(Optional<String>
// * If the resource type starts with "image/", and support for images has not been disabled
// FIXME: Handle disabling image support.
else if (resource_type.has_value() && resource_type->starts_with("image/"sv)) {
- // FIXME: If the object element's nested browsing context is non-null, then it must be discarded and then set to null.
+ // If the object element's nested browsing context is non-null, then it must be discarded and then set to null.
+ if (m_nested_browsing_context) {
+ discard_nested_browsing_context();
+ m_nested_browsing_context = nullptr;
+ }
// Apply the image sniffing rules to determine the type of the image.
// The object element represents the specified image.