LibWeb: Resolve block height correctly after line break with clear: ..

If a block with inline children ends with a line break clearing any
floats, we not only need to take the introduced clearance into account
for the next line box, but the containing block needs to set the correct
height as well.

Since the spec calls for using the last line box' bottom as the resolved
height (if treated as auto), we now correctly apply the clearance to the
previous line box' bottom coordinate.

Fixes #4058.
This commit is contained in:
Jelle Raaijmakers 2025-04-01 11:01:15 +02:00
commit 6d911a6baa
Notes: github-actions[bot] 2025-04-01 14:03:58 +00:00
7 changed files with 85 additions and 16 deletions

View file

@ -42,13 +42,14 @@ public:
void remove_last_line_if_empty();
CSSPixels current_block_offset() const { return m_current_block_offset; }
void set_current_block_offset(CSSPixels block_offset) { m_current_block_offset = block_offset; }
void recalculate_available_space();
CSSPixels y_for_float_to_be_inserted_here(Box const&);
auto& inline_formatting_context() { return m_context; }
void did_introduce_clearance(CSSPixels);
private:
void begin_new_line(bool increment_y, bool is_first_break_in_sequence = true);