From 413eb195799a86455d4c58380c90c15193635426 Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Tue, 23 Jan 2024 22:33:12 +0100 Subject: [PATCH] LibWeb: Skip UTF-8 validation in Node::descendant_text_content() Since we're just concatenating a bunch of strings that are already UTF-8, we don't need to check that the result is also UTF-8. --- Userland/Libraries/LibWeb/DOM/Node.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Userland/Libraries/LibWeb/DOM/Node.cpp b/Userland/Libraries/LibWeb/DOM/Node.cpp index 102266246b..ef4f941e0c 100644 --- a/Userland/Libraries/LibWeb/DOM/Node.cpp +++ b/Userland/Libraries/LibWeb/DOM/Node.cpp @@ -151,7 +151,7 @@ String Node::descendant_text_content() const builder.append(text_node.data()); return IterationDecision::Continue; }); - return MUST(builder.to_string()); + return builder.to_string_without_validation(); } // https://dom.spec.whatwg.org/#dom-node-textcontent