From f351f75a34619ad969f660312a2e5486f742f685 Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Sun, 22 Sep 2024 13:25:21 +0200 Subject: [PATCH] LibWeb: Don't try to invalidate style for character data nodes Character data nodes like text and HTML comments don't have style, so let's just exit invalidation immediately for those. --- Userland/Libraries/LibWeb/DOM/Node.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Userland/Libraries/LibWeb/DOM/Node.cpp b/Userland/Libraries/LibWeb/DOM/Node.cpp index a8fd88b8eba..cb13cdad016 100644 --- a/Userland/Libraries/LibWeb/DOM/Node.cpp +++ b/Userland/Libraries/LibWeb/DOM/Node.cpp @@ -389,6 +389,9 @@ JS::GCPtr Node::navigable() const void Node::invalidate_style(StyleInvalidationReason reason) { + if (is_character_data()) + return; + if (!needs_style_update() && !document().needs_full_style_update()) { dbgln_if(STYLE_INVALIDATION_DEBUG, "Invalidate style ({}): {}", to_string(reason), debug_description()); }