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

LibWeb: Stop collecting lookahead items on forced break

This avoids a crash since such items don't have a node nor CSS
properties. Fixes crashes on Wikipedia pages which contain preformatted
code.
This commit is contained in:
Andi Gallo 2023-08-22 06:38:17 +00:00 committed by Andreas Kling
parent cca779e7f6
commit 685ef4ec82
3 changed files with 22 additions and 0 deletions

View file

@ -140,6 +140,8 @@ CSSPixels InlineLevelIterator::next_non_whitespace_sequence_width()
break;
m_lookahead_items.enqueue(next_item_opt.release_value());
auto& next_item = m_lookahead_items.tail();
if (next_item.type == InlineLevelIterator::Item::Type::ForcedBreak)
break;
if (next_item.node->computed_values().white_space() != CSS::WhiteSpace::Nowrap) {
if (next_item.type != InlineLevelIterator::Item::Type::Text)
break;