Closed Bug 1515250 Opened 2 years ago Closed 2 years ago

[wpt-sync] Sync PR 14593 - [css-grid] Fix auto-placement on implicit tracks


(Core :: CSS Parsing and Computation, enhancement, P4)




Tracking Status
firefox67 --- fixed


(Reporter:, Unassigned)




(Whiteboard: [wptsync downstream])

Sync web-platform-tests PR 14593 into mozilla-central (this bug is closed when the sync is complete).

Details from upstream follow.

Manuel Rego Casasnovas <> wrote:
>  [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).
>  The problem in the tests is that 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:
>  WPT-Export-Revision: e36e899016bbf5a40c98d0113fa1ace2e9c0faea
Component: web-platform-tests → CSS Parsing and Computation
Product: Testing → Core
Ran 1 tests and 12 subtests
OK     : 1
PASS   : 12
Pushed by
[wpt PR 14593] - [css-grid] Fix auto-placement on implicit tracks, a=testonly
Pushed by
[wpt PR 14593] - [css-grid] Fix auto-placement on implicit tracks, a=testonly
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla67
You need to log in before you can comment on or make changes to this bug.