I believe the current algorithm doesn't totally match the specification as we do the following placing: * Foreach grid items with a specified major axis, place it on the grid (placeSpecifiedMajorAxisItemsOnGrid(specifiedMajorAxisAutoGridItems)) * Foreach grid items with an auto major axis, place it on the grid (placeAutoMajorAxisItemsOnGrid(autoMajorAxisAutoGridItems)) The specification does a single loop over the unplaced grid items. See http://dev.w3.org/csswg/css3-grid-layout/#auto-placement-algo, point 4 of the algorithm. I am sure we can build a test case where our algorithm differs.
I misread the code, we actually follow the proper algorithm: * We first place items for which we can resolve both positions (it's implicitly mentioned in step 1 - "will not overlap the grid area of any explicitly or previously auto-placed item."). * Then placeSpecifiedMajorAxisItemsOnGrid(specifiedMajorAxisAutoGridItems) is the step 1 loop. * placeAutoMajorAxisItemsOnGrid(autoMajorAxisAutoGridItems) is step 4.