Bug 157417

Summary: [css-grid] Fix static position for positioned grid items
Product: WebKit Reporter: Manuel Rego Casasnovas <rego>
Component: Layout and RenderingAssignee: Manuel Rego Casasnovas <rego>
Status: RESOLVED FIXED    
Severity: Normal CC: commit-queue, esprehn+autocc, glenn, jfernandez, kondapallykalyan, simon.fraser, svillar
Priority: P2 Keywords: BlinkMergeCandidate
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
URL: https://bugs.chromium.org/p/chromium/issues/detail?id=607137
Bug Depends on:    
Bug Blocks: 60731    
Attachments:
Description Flags
Patch
none
Patch none

Description Manuel Rego Casasnovas 2016-05-06 02:14:20 PDT
The spec was updated (almost 1 year ago) to define properly
the static position of the positioned grid items:
https://drafts.csswg.org/css-grid-1/issues-wd-20150108#issue-1

But we didn't apply this change in our implementation.

The specific wording from the spec (https://drafts.csswg.org/css-grid/#static-position):
"The static position [CSS21] of an absolutely-positioned child of a grid container
 is determined as if it were the sole grid item in a grid area whose edges
 coincide with the padding edges of the grid container.
 However, if the grid container parent is also the generator of
 the absolutely positioned element’s containing block, instead use the grid area
 determined in §11.1 With a Grid Container as Containing Block."


This was already fixed in Blink:
https://codereview.chromium.org/1929483002
Comment 1 Manuel Rego Casasnovas 2016-05-06 02:26:54 PDT
Created attachment 278246 [details]
Patch
Comment 2 Darin Adler 2016-05-07 12:43:04 PDT
Comment on attachment 278246 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=278246&action=review

> Source/WebCore/rendering/RenderGrid.cpp:1525
> +            RenderLayer* childLayer = child.layer();

Local variable should be a reference, not a pointer.

    auto& childLayer = *child.layer();
Comment 3 Manuel Rego Casasnovas 2016-05-09 02:33:12 PDT
Created attachment 278397 [details]
Patch
Comment 4 WebKit Commit Bot 2016-05-09 03:16:44 PDT
Comment on attachment 278397 [details]
Patch

Clearing flags on attachment: 278397

Committed r200572: <http://trac.webkit.org/changeset/200572>
Comment 5 WebKit Commit Bot 2016-05-09 03:16:47 PDT
All reviewed patches have been landed.  Closing bug.