diff --git a/Libraries/LibWeb/Layout/GridFormattingContext.cpp b/Libraries/LibWeb/Layout/GridFormattingContext.cpp index 3ab6dfff83a..06795ae075c 100644 --- a/Libraries/LibWeb/Layout/GridFormattingContext.cpp +++ b/Libraries/LibWeb/Layout/GridFormattingContext.cpp @@ -1849,9 +1849,6 @@ CSSPixelRect GridFormattingContext::get_grid_area_rect(GridItem const& grid_item auto resolved_span = grid_item.span(dimension) * 2; auto gap_adjusted_position = grid_item.gap_adjusted_position(dimension); - if (gap_adjusted_position + resolved_span > tracks_and_gaps.size()) { - resolved_span = tracks_and_gaps.size() - gap_adjusted_position; - } int start = gap_adjusted_position; int end = start + resolved_span; diff --git a/Tests/LibWeb/Layout/expected/grid/grid-row-overflow-crash.txt b/Tests/LibWeb/Layout/expected/grid/grid-row-overflow-crash.txt new file mode 100644 index 00000000000..4515ae7b7d5 --- /dev/null +++ b/Tests/LibWeb/Layout/expected/grid/grid-row-overflow-crash.txt @@ -0,0 +1,18 @@ +Viewport <#document> at (0,0) content-size 800x600 children: not-inline + BlockContainer at (0,0) content-size 800x600 [BFC] children: not-inline + BlockContainer
at (8,8) content-size 784x0 children: not-inline + Box