RESOLVED FIXED 112299
[CSS Grid Layout] resolveContentBasedTrackSizingFunctions should iterate over the grid items not the grid tracks
https://bugs.webkit.org/show_bug.cgi?id=112299
Summary [CSS Grid Layout] resolveContentBasedTrackSizingFunctions should iterate over...
Julien Chaffraix
Reported 2013-03-13 16:34:06 PDT
While implementing the first layout algorithm, we made the choice to do a grid tracks' iteration in resolveContentBasedTrackSizingFunctions, ignoring the fact that the specification does a grid items'. Iterating over grid items is more efficient for sparse grids. However it requires an additional pass over the grid tracks as we don't know which ones have been touched during the loop so it's difficult to say in the general case. However to properly implement grid spanning, we need to consider grid items and not grid tracks as a single grid item can now (differently) contribute to several grid tracks. This change will align our layout algorithm with the specification to make it easier to implement spanning.
Attachments
Proposed change 1: Added a filtering logic (similar to the spec), simplified the availableLogicalSpace update logic. (11.24 KB, patch)
2013-03-13 17:37 PDT, Julien Chaffraix
no flags
Julien Chaffraix
Comment 1 2013-03-13 17:33:49 PDT
Scratch my complexity analysis: it should be also better in the general case. We currently always walk the full grid in each direction (which O(N*M) on a N * M grid), we also have to walk the grid items as we need to account for all of them during layout. The algorithm in the specification keeps the mandatory grid items walking and add some extra grid track walking in the considered direction (O(N) or O(M)).
Julien Chaffraix
Comment 2 2013-03-13 17:37:22 PDT
Created attachment 193028 [details] Proposed change 1: Added a filtering logic (similar to the spec), simplified the availableLogicalSpace update logic.
WebKit Review Bot
Comment 3 2013-03-14 13:06:46 PDT
Comment on attachment 193028 [details] Proposed change 1: Added a filtering logic (similar to the spec), simplified the availableLogicalSpace update logic. Clearing flags on attachment: 193028 Committed r145840: <http://trac.webkit.org/changeset/145840>
WebKit Review Bot
Comment 4 2013-03-14 13:06:51 PDT
All reviewed patches have been landed. Closing bug.
Note You need to log in before you can comment on or make changes to this bug.