Jelajahi Sumber

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 tahun lalu
induk
melakukan
03008d9c9c
1 mengubah file dengan 1 tambahan dan 1 penghapusan
  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();
         }