Description[css-grid] Initial support for implicit grid before explicit grid
Change GridSpan to store int instead of size_t. This allows us to
resolve positions before the explicit grid with negative values.
This patch adds a new type of GridSpan called "Untranslated".
This type is only used in populateExplicitGridAndOrderIterator().
Where we store the smallest negative position in both axis.
Then the GridSpans are translated into positive values, using the offset
calculated before. This is done in placeItemsOnGrid() and from that
moment the rest of the code uses "Definite" GridSpans, which returns
only positive positions (size_t instead of int).
This allows us to don't have to modify the rest of the code, as it keeps
using GridSpans as before.
Let's use an example to explain how it works. Imagine that we've a 2
columns grid and 2 items placed like:
* Item A: grid-column: -5;
* Item B: grid-column: 1;
Initially we'll use "Unstranslated" GridSpans with the following values:
* Item A: GridSpan(-2, -1)
* Item B: GridSpan(0, 1)
Then we'll translate them using the smallest position as offset (-2)
so we've "Definite" GridSpans:
* Item A: GridSpan(0, 1)
* Item B: GridSpan(2, 3)
Updated results in current tests and added specific test for this.
BUG=444011
TEST=fast/css-grid-layout/implicit-tracks-before-explicit.html
Committed: https://crrev.com/7433487e4082c928a06ddff51fe5c963a28da3ef
Cr-Commit-Position: refs/heads/master@{#367511}
Patch Set 1 #Patch Set 2 : Try to fix Windows build #
Total comments: 24
Patch Set 3 : Apply suggested changes #
Total comments: 2
Messages
Total messages: 17 (5 generated)
|