mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 22:57:44 +00:00
LibWeb: Add missing check for flexible grid tracks
Previously this didn't cause issues because the default flex-factor is 0, but once we only store a flex-factor for FlexibleLength-type GridSizes, this causes a crash.
This commit is contained in:
parent
127bfd64a8
commit
b66ff21379
1 changed files with 5 additions and 3 deletions
|
@ -1250,9 +1250,11 @@ void GridFormattingContext::expand_flexible_tracks(AvailableSpace const& availab
|
|||
// For each flexible track, if the product of the used flex fraction and the track’s flex factor is greater than
|
||||
// the track’s base size, set its base size to that product.
|
||||
for (auto& track : tracks_and_gaps) {
|
||||
auto scaled_fraction = CSSPixels::nearest_value_for(track.max_track_sizing_function.flex_factor()) * flex_fraction;
|
||||
if (scaled_fraction > track.base_size) {
|
||||
track.base_size = scaled_fraction;
|
||||
if (track.max_track_sizing_function.is_flexible_length()) {
|
||||
auto scaled_fraction = CSSPixels::nearest_value_for(track.max_track_sizing_function.flex_factor()) * flex_fraction;
|
||||
if (scaled_fraction > track.base_size) {
|
||||
track.base_size = scaled_fraction;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue