Bug 111886
| Summary: | [CSS Grid Layout] Fix the auto-placement algorithm to fully match the specification | ||
|---|---|---|---|
| Product: | WebKit | Reporter: | Julien Chaffraix <jchaffraix> |
| Component: | Layout and Rendering | Assignee: | Nobody <webkit-unassigned> |
| Status: | RESOLVED INVALID | ||
| Severity: | Normal | CC: | ojan, tony, xan.lopez |
| Priority: | P2 | ||
| Version: | 528+ (Nightly build) | ||
| Hardware: | All | ||
| OS: | All | ||
| Bug Depends on: | |||
| Bug Blocks: | 103316 | ||
Julien Chaffraix
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.
| Attachments | ||
|---|---|---|
| Add attachment proposed patch, testcase, etc. |
Julien Chaffraix
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.