mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-16 15:30:09 +00:00
LibWeb: Avoid computing automatic minimum size for some flex items
There's a specific (and thankfully very common!) scenario where we can actually skip calculating the automatic minimum size for flex items. In single-line (no wrapping) flex containers, if the sum of all item flex base sizes is <= the flex container's main size, we know that none of the items will be shrunk by the layout algorithm. And so for any flex item with definite main size AND automatic minimum main size, we can treat the automatic minimum size as 0.
This commit is contained in:
parent
6f5b107fcc
commit
7b2a427430
Notes:
github-actions[bot]
2025-04-22 13:47:03 +00:00
Author: https://github.com/awesomekling
Commit: 7b2a427430
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/4427
4 changed files with 366 additions and 10 deletions
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (c) 2021-2024, Andreas Kling <andreas@ladybird.org>
|
||||
* Copyright (c) 2021-2025, Andreas Kling <andreas@ladybird.org>
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*/
|
||||
|
@ -173,7 +173,7 @@ private:
|
|||
|
||||
void determine_available_space_for_items(AvailableSpace const&);
|
||||
|
||||
void determine_flex_base_size_and_hypothetical_main_size(FlexItem&);
|
||||
void determine_flex_base_size(FlexItem&);
|
||||
|
||||
void collect_flex_items_into_flex_lines();
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue