mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-30 12:49:19 +00:00
LibWeb: Use available space to resolve sizes in FFC
If available space is definite it should always match the size of the containing block. Therefore, there is no need to do containing block node lookup.
This commit is contained in:
parent
5aa1d7837f
commit
dd11d48a1d
Notes:
github-actions[bot]
2024-11-10 18:15:48 +00:00
Author: https://github.com/kalenikaliaksandr
Commit: dd11d48a1d
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/2258
7 changed files with 11 additions and 41 deletions
|
@ -20,12 +20,12 @@ namespace Web::Layout {
|
|||
|
||||
CSSPixels FlexFormattingContext::get_pixel_width(Box const& box, CSS::Size const& size) const
|
||||
{
|
||||
return calculate_inner_width(box, containing_block_width_as_available_size(box), size);
|
||||
return calculate_inner_width(box, m_available_space->width, size);
|
||||
}
|
||||
|
||||
CSSPixels FlexFormattingContext::get_pixel_height(Box const& box, CSS::Size const& size) const
|
||||
{
|
||||
return calculate_inner_height(box, containing_block_height_as_available_size(box), size);
|
||||
return calculate_inner_height(box, m_available_space->height, size);
|
||||
}
|
||||
|
||||
FlexFormattingContext::FlexFormattingContext(LayoutState& state, LayoutMode layout_mode, Box const& flex_container, FormattingContext* parent)
|
||||
|
@ -51,6 +51,8 @@ void FlexFormattingContext::run(AvailableSpace const& available_space)
|
|||
{
|
||||
// This implements https://www.w3.org/TR/css-flexbox-1/#layout-algorithm
|
||||
|
||||
m_available_space = available_space;
|
||||
|
||||
// 1. Generate anonymous flex items
|
||||
generate_anonymous_flex_items();
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue