mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-06 16:19:23 +00:00
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:
parent
e5db913b0d
commit
6d911a6baa
Notes:
github-actions[bot]
2025-04-01 14:03:58 +00:00
Author: https://github.com/gmta
Commit: 6d911a6baa
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/4168
7 changed files with 85 additions and 16 deletions
|
@ -282,8 +282,7 @@ void InlineFormattingContext::generate_line_boxes()
|
|||
if (item.node) {
|
||||
auto introduce_clearance = parent().clear_floating_boxes(*item.node, *this);
|
||||
if (introduce_clearance == BlockFormattingContext::DidIntroduceClearance::Yes) {
|
||||
if (vertical_float_clearance() > line_builder.current_block_offset())
|
||||
line_builder.set_current_block_offset(vertical_float_clearance());
|
||||
line_builder.did_introduce_clearance(vertical_float_clearance());
|
||||
parent().reset_margin_state();
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue