浏览代码

LibWeb: Ensure that TextNode::ChunkIterator emits preserved newlines

When doing max-content layout, we were not committing newlines even
though we were supposed to due to white-space:pre*.

This broke the WPT harness due to a VERIFY() in ChunkIterator where we
were assuming the commit would always succeed.

Thanks to Orphis for reporting this! :^)
Andreas Kling 3 年之前
父节点
当前提交
03008d9c9c
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      Userland/Libraries/LibWeb/Layout/TextNode.cpp

+ 1 - 1
Userland/Libraries/LibWeb/Layout/TextNode.cpp

@@ -111,7 +111,7 @@ Optional<TextNode::Chunk> TextNode::ChunkIterator::next()
 
             // Otherwise, commit the newline!
             ++m_iterator;
-            auto result = try_commit_chunk(start_of_chunk, m_iterator, true);
+            auto result = try_commit_chunk(start_of_chunk, m_iterator, true, true);
             VERIFY(result.has_value());
             return result.release_value();
         }