From 827936cf7ba0e1d80a19f722dfd8d2f3e6b9631f Mon Sep 17 00:00:00 2001 From: Andi Gallo Date: Thu, 1 Jun 2023 05:13:52 +0000 Subject: [PATCH] LibWeb: Invalidate layout tree in textContent setter The textContent setter changes the structure of the DOM, therefore the layout tree becomes invalid. --- Userland/Libraries/LibWeb/DOM/Node.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Userland/Libraries/LibWeb/DOM/Node.cpp b/Userland/Libraries/LibWeb/DOM/Node.cpp index 3a6abeaf9b..15fa30d4aa 100644 --- a/Userland/Libraries/LibWeb/DOM/Node.cpp +++ b/Userland/Libraries/LibWeb/DOM/Node.cpp @@ -201,7 +201,8 @@ void Node::set_text_content(DeprecatedString const& content) // Otherwise, do nothing. - set_needs_style_update(true); + document().invalidate_style(); + document().invalidate_layout(); } // https://dom.spec.whatwg.org/#dom-node-nodevalue