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

LibWeb: Make text newlines in "pre" mode emit a ForcedBreak item

Instead of emitting a Text item with the "should_force_break" flag set
to true, newlines in newline-preserving text content now timply turn
into ForcedBreak items. This makes the <pre> element work again.
This commit is contained in:
Andreas Kling 2022-03-26 18:59:54 +01:00
parent d32630e17b
commit aefe1727fc
6 changed files with 14 additions and 11 deletions

View file

@ -593,7 +593,7 @@ void BlockFormattingContext::layout_floating_box(Box const& box, BlockContainer
// If we have a LineBuilder, we're in the middle of inline layout, otherwise this is block layout.
if (line_builder) {
float y_offset = box_state.margin_box_top() + box_state.inset_top;
line_builder->break_if_needed(layout_mode, box_state.border_box_width(), false);
line_builder->break_if_needed(layout_mode, box_state.border_box_width());
box_state.offset.set_y(line_builder->current_y() + y_offset);
line_builder->adjust_last_line_after_inserting_floating_box({}, box.computed_values().float_(), box_state.border_box_width());
} else {