mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-12-12 09:20:36 +00:00
LibWeb: Use item minimum contribution while sizing "fr" track in GFC
Fixes the issue that before "automatic minimum size" were used to size flexible tracks even though specification says is should be "minimum contribution"
This commit is contained in:
parent
e91bdedc93
commit
338fa8261e
Notes:
sideshowbarker
2024-07-17 22:09:47 +09:00
Author: https://github.com/kalenikaliaksandr Commit: https://github.com/SerenityOS/serenity/commit/338fa8261e Pull-request: https://github.com/SerenityOS/serenity/pull/20300
3 changed files with 20 additions and 1 deletions
4
Tests/LibWeb/Layout/expected/grid/row-1fr.txt
Normal file
4
Tests/LibWeb/Layout/expected/grid/row-1fr.txt
Normal file
|
@ -0,0 +1,4 @@
|
|||
Viewport <#document> at (0,0) content-size 800x600 children: not-inline
|
||||
BlockContainer <html> at (1,1) content-size 798x70 [BFC] children: not-inline
|
||||
Box <body> at (10,10) content-size 200x52 [GFC] children: not-inline
|
||||
BlockContainer <div.item> at (11,11) content-size 100x50 [BFC] children: not-inline
|
15
Tests/LibWeb/Layout/input/grid/row-1fr.html
Normal file
15
Tests/LibWeb/Layout/input/grid/row-1fr.html
Normal file
|
@ -0,0 +1,15 @@
|
|||
<!doctype html><style>
|
||||
* {
|
||||
border: 1px solid black;
|
||||
}
|
||||
body {
|
||||
display: grid;
|
||||
grid-template-rows: 1fr;
|
||||
width: 200px;
|
||||
}
|
||||
.item {
|
||||
width: 100px;
|
||||
height: 50px;
|
||||
background: orange;
|
||||
}
|
||||
</style><body><div class="item"></div>
|
|
@ -1049,7 +1049,7 @@ void GridFormattingContext::increase_sizes_to_accommodate_spanning_items_crossin
|
|||
|
||||
// 1. For intrinsic minimums: First increase the base size of tracks with an intrinsic min track sizing
|
||||
// function by distributing extra space as needed to accommodate these items’ minimum contributions.
|
||||
auto item_minimum_contribution = automatic_minimum_size(item, dimension);
|
||||
auto item_minimum_contribution = calculate_minimum_contribution(item, dimension);
|
||||
distribute_extra_space_across_spanned_tracks_base_size(dimension,
|
||||
item_minimum_contribution, SpaceDistributionPhase::AccommodateMinimumContribution, spanned_tracks, [&](GridTrack const& track) {
|
||||
return track.min_track_sizing_function.is_flexible_length();
|
||||
|
|
Loading…
Reference in a new issue