From b0d75ef09645237bff60d5b17a34739327a2ce25 Mon Sep 17 00:00:00 2001 From: Aliaksandr Kalenik Date: Sun, 8 Oct 2023 16:05:58 +0200 Subject: [PATCH] LibWeb: Create navigables only for iframe in a document tree Navigable should be created for an iframe only, if after insertion, its root is the document. Fixes https://github.com/SerenityOS/serenity/issues/21374 --- Userland/Libraries/LibWeb/HTML/HTMLIFrameElement.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Userland/Libraries/LibWeb/HTML/HTMLIFrameElement.cpp b/Userland/Libraries/LibWeb/HTML/HTMLIFrameElement.cpp index 516b350ca9..5d5eb7e18a 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLIFrameElement.cpp +++ b/Userland/Libraries/LibWeb/HTML/HTMLIFrameElement.cpp @@ -46,7 +46,7 @@ void HTMLIFrameElement::inserted() HTMLElement::inserted(); // When an iframe element element is inserted into a document whose browsing context is non-null, the user agent must run these steps: - if (document().browsing_context()) { + if (in_a_document_tree() && document().browsing_context()) { // 1. Create a new child navigable for element. MUST(create_new_child_navigable());