mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-12-08 06:09:58 +00:00
LibWeb: Only consider main size for item height in intrinsic sizing
We did not actually check whether we are in intrinsic sizing mode, and should actually use the available space in all other cases. This will allow for proper determination of the hypothetical cross size in the next commit.
This commit is contained in:
parent
f9b4fa9702
commit
4ff17fc8d7
Notes:
github-actions[bot]
2025-11-05 11:02:48 +00:00
Author: https://github.com/gmta
Commit: 4ff17fc8d7
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/6695
Reviewed-by: https://github.com/awesomekling ✅
1 changed files with 4 additions and 3 deletions
|
|
@ -1,6 +1,7 @@
|
|||
/*
|
||||
* Copyright (c) 2021-2025, Andreas Kling <andreas@ladybird.org>
|
||||
* Copyright (c) 2021, Tobias Christiansen <tobyase@serenityos.org>
|
||||
* Copyright (c) 2025, Jelle Raaijmakers <jelle@ladybird.org>
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*/
|
||||
|
|
@ -22,9 +23,9 @@ CSSPixels FlexFormattingContext::get_pixel_width(FlexItem const& item, CSS::Size
|
|||
|
||||
CSSPixels FlexFormattingContext::get_pixel_height(FlexItem const& item, CSS::Size const& size) const
|
||||
{
|
||||
if (is_row_layout()) {
|
||||
// NOTE: In a row layout, after we've determined the main size, we use that as the available width
|
||||
// for any intrinsic sizing layout needed to resolve the height.
|
||||
if (is_row_layout() && size.is_intrinsic_sizing_constraint()) {
|
||||
// NOTE: In a row layout, after we've determined the main size, we use that as the available width for any
|
||||
// intrinsic sizing layout needed to resolve the height.
|
||||
auto available_width = item.main_size.has_value() ? AvailableSize::make_definite(item.main_size.value()) : AvailableSize::make_indefinite();
|
||||
auto available_height = AvailableSize::make_indefinite();
|
||||
auto available_space = AvailableSpace { available_width, available_height };
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue