Bug 172108

Summary: [css-grid] Fix static position of positioned grid items
Product: WebKit Reporter: Manuel Rego Casasnovas <rego>
Component: Layout and RenderingAssignee: Manuel Rego Casasnovas <rego>
Status: RESOLVED FIXED    
Severity: Normal CC: bfulgham, commit-queue, jfernandez, simon.fraser, svillar, zalan
Priority: P2 Keywords: BlinkMergeCandidate
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Bug Depends on:    
Bug Blocks: 60731, 172117    
Attachments:
Description Flags
Patch
none
Patch none

Description Manuel Rego Casasnovas 2017-05-15 01:46:14 PDT
Text on the spec (https://drafts.csswg.org/css-grid/#static-position):
  "The static position 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."

This has been already fixed in Blink:
https://codereview.chromium.org/2665983004
Comment 1 Manuel Rego Casasnovas 2017-05-15 01:52:08 PDT
Created attachment 310118 [details]
Patch
Comment 2 Javier Fernandez 2017-05-15 02:36:14 PDT
Comment on attachment 310118 [details]
Patch

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

> Source/WebCore/rendering/RenderGrid.cpp:938
> +    childLayer->setStaticBlockPosition(LayoutUnit(borderBefore()));

boderStart() and boderBefore() already return a LayoutUnit, why do we need to create a new one ?
Comment 3 Manuel Rego Casasnovas 2017-05-15 03:07:47 PDT
Created attachment 310126 [details]
Patch

New version applying suggested changes
Comment 4 Manuel Rego Casasnovas 2017-05-15 03:08:16 PDT
Comment on attachment 310118 [details]
Patch

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

>> Source/WebCore/rendering/RenderGrid.cpp:938
>> +    childLayer->setStaticBlockPosition(LayoutUnit(borderBefore()));
> 
> boderStart() and boderBefore() already return a LayoutUnit, why do we need to create a new one ?

Indeed we don't need that. Fixed in the new version of the patch. Thanks!
Comment 5 WebKit Commit Bot 2017-05-16 00:50:35 PDT
Comment on attachment 310126 [details]
Patch

Clearing flags on attachment: 310126

Committed r216916: <http://trac.webkit.org/changeset/216916>
Comment 6 WebKit Commit Bot 2017-05-16 00:50:37 PDT
All reviewed patches have been landed.  Closing bug.