mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-09-03 08:08:43 +00:00
LibWeb: Add a line box fragment for <br> nodes
This is required for the block formatting context to know the height of the <br> element while computing the height of its parent. Specifically, this comes into play when the <br> element is the first or last child of its parent. In that case, it previously would not have any fragments, so BlockFormattingContext::compute_auto_height_for_block_level_element would infer its top and bottom positions to be 0.
This commit is contained in:
parent
a106f852d3
commit
7d8d45e757
Notes:
sideshowbarker
2024-07-18 20:54:11 +09:00
Author: https://github.com/trflynn89
Commit: 7d8d45e757
Pull-request: https://github.com/SerenityOS/serenity/pull/6078
1 changed files with 2 additions and 1 deletions
|
@ -42,7 +42,8 @@ BreakNode::~BreakNode()
|
|||
|
||||
void BreakNode::split_into_lines(InlineFormattingContext& context, LayoutMode)
|
||||
{
|
||||
context.containing_block().add_line_box();
|
||||
auto& line_box = context.containing_block().add_line_box();
|
||||
line_box.add_fragment(*this, 0, 0, 0, context.containing_block().line_height());
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue