Bug 119801

Summary: [CSS Grid Layout] Fix grid position resolution
Product: WebKit Reporter: Sergio Villar Senin <svillar>
Component: CSSAssignee: Sergio Villar Senin <svillar>
Status: RESOLVED FIXED    
Severity: Normal CC: commit-queue, esprehn+autocc, glenn, hyatt, jchaffraix, kling, kondapallykalyan, mrobinson, svillar, tony
Priority: P2 Keywords: BlinkMergeCandidate
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Bug Depends on: 119552    
Bug Blocks: 60731, 119756    
Attachments:
Description Flags
Patch kling: review+

Sergio Villar Senin
Reported 2013-08-14 09:01:22 PDT
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.
Attachments
Patch (15.14 KB, patch)
2013-08-22 04:12 PDT, Sergio Villar Senin
kling: review+
Sergio Villar Senin
Comment 1 2013-08-22 04:12:56 PDT
Sergio Villar Senin
Comment 2 2013-08-22 04:15:08 PDT
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).
Andreas Kling
Comment 3 2013-08-27 07:53:54 PDT
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.
Sergio Villar Senin
Comment 4 2013-08-28 03:25:51 PDT
Note You need to log in before you can comment on or make changes to this bug.