1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 14:37:46 +00:00

LibWeb: Don't crash in IFC if very first chunk is collapsible whitespace

This commit is contained in:
Andreas Kling 2022-03-27 21:02:24 +02:00
parent b732edf61c
commit f9e8f02451

View file

@ -232,7 +232,7 @@ void InlineFormattingContext::generate_line_boxes(LayoutMode layout_mode)
auto& item = item_opt.value();
// Ignore collapsible whitespace chunks at the start of line, and if the last fragment already ends in whitespace.
if (item.is_collapsible_whitespace && line_boxes.last().is_empty_or_ends_in_whitespace())
if (item.is_collapsible_whitespace && (line_boxes.is_empty() || line_boxes.last().is_empty_or_ends_in_whitespace()))
continue;
switch (item.type) {