Bug 155230 - [css-grid] Fix placement for unknown named grid lines
Summary: [css-grid] Fix placement for unknown named grid lines
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
Depends on:
Blocks: 153488
  Show dependency treegraph
Reported: 2016-03-09 04:49 PST by Manuel Rego Casasnovas
Modified: 2016-03-10 04:15 PST (History)
8 users (show)

See Also:

Patch (70.77 KB, patch)
2016-03-09 08:20 PST, Manuel Rego Casasnovas
no flags Details | Formatted Diff | Diff
Patch (70.94 KB, patch)
2016-03-10 03:22 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-09 04:49:14 PST
Placement for undefined named lines is not working as described in the spec:

Mainly we're not following this statement from the spec:
"If a name is given as a <custom-ident>, only lines with that name are counted. If not enough lines with that name exist, all lines in the implicit grid are assumed to have that name for the purpose of finding this position."

Bug has been already fixed in Blink:

We need to port:
Comment 1 Manuel Rego Casasnovas 2016-03-09 08:20:44 PST
Created attachment 273430 [details]
Comment 2 Sergio Villar Senin 2016-03-10 02:24:52 PST
Comment on attachment 273430 [details]

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

> Source/WebCore/rendering/style/GridResolvedPosition.cpp:129
> +        return end + numberOfLines - 1;

I think we can do this in a single line.

> Source/WebCore/rendering/style/GridResolvedPosition.cpp:151
> +        return start - numberOfLines + 1;


> Source/WebCore/rendering/style/GridResolvedPosition.cpp:167
> +    NamedGridLinesMap::const_iterator it = gridLinesNames.find(position.namedGridLine());

We can use auto for these two.
Comment 3 Manuel Rego Casasnovas 2016-03-10 03:22:49 PST
Created attachment 273556 [details]
Comment 4 Manuel Rego Casasnovas 2016-03-10 03:23:30 PST
Thanks for the review, uploaded new patch for landing applying suggested changes.
Comment 5 WebKit Commit Bot 2016-03-10 04:15:23 PST
Comment on attachment 273556 [details]

Clearing flags on attachment: 273556

Committed r197930: <http://trac.webkit.org/changeset/197930>
Comment 6 WebKit Commit Bot 2016-03-10 04:15:28 PST
All reviewed patches have been landed.  Closing bug.