mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-22 23:50:19 +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
Notes:
sideshowbarker
2024-07-17 01:11:48 +09:00
Author: https://github.com/AtkinsSJ Commit: https://github.com/SerenityOS/serenity/commit/b66ff21379 Pull-request: https://github.com/SerenityOS/serenity/pull/21258
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…
Reference in a new issue