From 73e87d694e8284510ffb90eb4932aa77250ee914 Mon Sep 17 00:00:00 2001 From: Baitinq Date: Sat, 26 Nov 2022 00:14:36 +0100 Subject: [PATCH] LibWeb: Don't collapse TextNode if it's editable Fixes #16127 --- Userland/Libraries/LibWeb/Layout/InlineLevelIterator.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Userland/Libraries/LibWeb/Layout/InlineLevelIterator.cpp b/Userland/Libraries/LibWeb/Layout/InlineLevelIterator.cpp index c879393b2d..45ae6a53fb 100644 --- a/Userland/Libraries/LibWeb/Layout/InlineLevelIterator.cpp +++ b/Userland/Libraries/LibWeb/Layout/InlineLevelIterator.cpp @@ -255,6 +255,9 @@ void InlineLevelIterator::enter_text_node(Layout::TextNode const& text_node) do_respect_linebreaks = true; } + if (text_node.dom_node().is_editable() && !text_node.dom_node().is_uninteresting_whitespace_node()) + do_collapse = false; + // FIXME: The const_cast here is gross. const_cast(text_node).compute_text_for_rendering(do_collapse);