浏览代码

LibWeb: Don't collapse TextNode if it's editable

Fixes #16127
Baitinq 2 年之前
父节点
当前提交
73e87d694e
共有 1 个文件被更改,包括 3 次插入0 次删除
  1. 3 0
      Userland/Libraries/LibWeb/Layout/InlineLevelIterator.cpp

+ 3 - 0
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<TextNode&>(text_node).compute_text_for_rendering(do_collapse);