1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 11:08:11 +00:00

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! :^)
This commit is contained in:
Andreas Kling 2022-03-29 03:02:49 +02:00
parent a6eb031058
commit 03008d9c9c

View file

@ -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();
}