Bug 155199 - [css-grid] Allow to place positioned grid items on the padding
Summary: [css-grid] Allow to place positioned grid items on the padding
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
Keywords: BlinkMergeCandidate
Depends on: 155014
Blocks: 153488
  Show dependency treegraph
Reported: 2016-03-08 15:15 PST by Manuel Rego Casasnovas
Modified: 2016-03-09 06:26 PST (History)
8 users (show)

See Also:

Patch (21.05 KB, patch)
2016-03-08 15:23 PST, Manuel Rego Casasnovas
no flags Details | Formatted Diff | Diff
Archive of layout-test-results from ews116 for mac-yosemite (950.15 KB, application/zip)
2016-03-09 03:05 PST, Build Bot
no flags Details
Patch for landing. (21.03 KB, patch)
2016-03-09 04:15 PST, 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 2016-03-08 15:15:42 PST
Per discussion on www-style we should be able to place positioned items between the padding edge and the first/last line of the grid:

We've to port the following patch from Blink:

And we'll port the next one too, as it's very related:
Comment 1 Manuel Rego Casasnovas 2016-03-08 15:23:40 PST
Created attachment 273347 [details]
Comment 2 Sergio Villar Senin 2016-03-09 02:55:01 PST
Comment on attachment 273347 [details]

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

Keep going!

> Source/WebCore/rendering/RenderGrid.cpp:1486
> +    bool isForColumns = direction == ForColumns;

We've been lately using isRowAxis.

> Source/WebCore/rendering/RenderGrid.cpp:1495
> +    // For positioned items we cannot use GridSpan::translate(). Because we could end up with negative values, as the positioned items do not create implicit tracks per spec.

Grammar is not completely right here I think. You should remove the dot after translate() and lowercase "because".

> Source/WebCore/rendering/RenderGrid.cpp:1518
> +    LayoutUnit end = endIsAuto ? isForColumns ? logicalWidth() : logicalHeight() : isForColumns ?  m_columnPositions[finalPosition] : m_rowPositions[finalPosition];

This is rather difficult to read, mind adding some parentheses to clarify the scopes here?

Although I like the ternary operation very much, I think this perhaps deserves a more verbose syntax.
Comment 3 Build Bot 2016-03-09 03:05:40 PST
Comment on attachment 273347 [details]

Attachment 273347 [details] did not pass mac-debug-ews (mac):
Output: http://webkit-queues.webkit.org/results/946581

New failing tests:
Comment 4 Build Bot 2016-03-09 03:05:45 PST
Created attachment 273419 [details]
Archive of layout-test-results from ews116 for mac-yosemite

The attached test failures were seen while running run-webkit-tests on the mac-debug-ews.
Bot: ews116  Port: mac-yosemite  Platform: Mac OS X 10.10.5
Comment 5 Manuel Rego Casasnovas 2016-03-09 04:15:52 PST
Created attachment 273421 [details]
Patch for landing.
Comment 6 Manuel Rego Casasnovas 2016-03-09 04:17:49 PST
Thanks for the quick review!

Applied suggested changes.
Comment 7 WebKit Commit Bot 2016-03-09 06:26:29 PST
Comment on attachment 273421 [details]
Patch for landing.

Clearing flags on attachment: 273421

Committed r197857: <http://trac.webkit.org/changeset/197857>
Comment 8 WebKit Commit Bot 2016-03-09 06:26:33 PST
All reviewed patches have been landed.  Closing bug.