From 03008d9c9cfe216dec4900d9255a3e65d916f994 Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Tue, 29 Mar 2022 03:02:49 +0200 Subject: [PATCH] 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! :^) --- Userland/Libraries/LibWeb/Layout/TextNode.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Userland/Libraries/LibWeb/Layout/TextNode.cpp b/Userland/Libraries/LibWeb/Layout/TextNode.cpp index 083f1500d4..aea5ab54de 100644 --- a/Userland/Libraries/LibWeb/Layout/TextNode.cpp +++ b/Userland/Libraries/LibWeb/Layout/TextNode.cpp @@ -111,7 +111,7 @@ Optional 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(); }