mirror of
https://github.com/HeyPuter/firefox.git
synced 2026-11-25 11:37:43 -10:00
Automatic update from web-platform-tests [css-grid] Fix auto-placement on implicit tracks This fixes a regression introduced in r577855 due to the new implementation of ListGridIterator::NextEmptyGridArea() which was not taking into account some special situations in the previous code. When we call NextEmptyGridArea() it was returning null when it couldn't find any empty grid area, while the code in LayoutGrid was expecting an area anyway even if it's outside the bounds of the current grid tracks. This patch changes that code so it always returns an area, and also removes some unneeded code in LayoutGrid (of course it still keeps the code that checks that we can add new tracks in the direction of the new area, otherwise it discards it). Let's explain what the new test is checking to understand the problem. In the new tests cases the number of tracks of the grid is determined by the largest span among all the auto-placed items. In the tests we have an item that spans 2 tracks, so the grid is considered to have 2 tracks as minimum. Then the first cell is occupied by an item, so when we look for an empty area for the item spanning 2 tracks we were not finding it. Then we were creating an new area outside of the grid limits and leaving the second track empty (which is wrong). Instead of that we're now returning an area taking the 2nd and 3rd tracks, even when the 3rd track doesn't exist yet as it's going to be created on demand. BUG=910953,688640 TEST=external/wpt/css/css-grid/placement/grid-auto-placement-implicit-tracks-001.html Change-Id: If4eeb46a9d2a909b0772e75be90ff6dabd49c387 Reviewed-on: https://chromium-review.googlesource.com/c/1383055 Reviewed-by: Javier Fernandez <[email protected]> Reviewed-by: Sergio Villar <[email protected]> Commit-Queue: Manuel Rego <[email protected]> Cr-Commit-Position: refs/heads/master@{#617806} -- wpt-commits: 0e9a18f255bd6d41ba2dddab5a6f8793c70ef5ad wpt-pr: 14593