Bug 172108 - [css-grid] Fix static position of positioned grid items
Summary: [css-grid] Fix static position of positioned grid items
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Layout and Rendering (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Manuel Rego Casasnovas
URL:
Keywords: BlinkMergeCandidate
Depends on:
Blocks: 60731 172117
  Show dependency treegraph
 
Reported: 2017-05-15 01:46 PDT by Manuel Rego Casasnovas
Modified: 2017-05-16 00:50 PDT (History)
6 users (show)

See Also:


Attachments
Patch (5.78 KB, patch)
2017-05-15 01:52 PDT, Manuel Rego Casasnovas
no flags Details | Formatted Diff | Diff
Patch (5.75 KB, patch)
2017-05-15 03:07 PDT, Manuel Rego Casasnovas
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
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.