Neither grid-{column|row}-end nor negative values are properly handled in our resolution code right now. In order to fix it we should merge these 3 changes: --- r148833 Fix the grid-{end|after} position resolution Our resolution code was resolving both positions in the same way but that doesn't work: in grid-rows: 2 / 3, the 2 lines, even if they are different numbers, refers to the same grid position so using the same formula to resolve them cannot work. --- r148878 Refactor grid size estimation to use resolveGridPositionsFromStyle resolveGridPositionsFromStyle required to have the grid filled so that we resolve negative indexes against the grid's final edge. The specification (and the code) changed to use the 'explicit grid' which is independent of the grid items and depends only on the style. --- r150403 This change just fixes resolveGridPositionFromStyle to handle the negative grid position properly. While at it, factored the position adjustment logic into adjustGridPostionForSide.
Created attachment 209342 [details] Patch
The final patch is not a direct merge of the three patches from Blink. I removed some stuff (like tests with span and negative indexes) that will be included in future patches (like in the one for 119756).
Comment on attachment 209342 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=209342&action=review > Source/WebCore/ChangeLog:16 > + resolveGridPositionsFormStyle() so we can use it for the grid size Typo, resolveGridPositions_From_Style. > Source/WebCore/rendering/RenderGrid.cpp:768 > + ASSERT(position.integerPosition()); This is a well-placed assert. I was worried about negative values here.
Committed r154731: <http://trac.webkit.org/changeset/154731>