Bug 141435 - [CSS Grid Layout] Columns set in percentages collapse to auto width
Summary: [CSS Grid Layout] Columns set in percentages collapse to auto width
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Layout and Rendering (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Manuel Rego Casasnovas
URL:
Keywords:
Depends on:
Blocks: 60731
  Show dependency treegraph
 
Reported: 2015-02-10 09:12 PST by Manuel Rego Casasnovas
Modified: 2015-04-13 22:00 PDT (History)
11 users (show)

See Also:


Attachments
Patch (14.89 KB, patch)
2015-02-10 09:17 PST, Manuel Rego Casasnovas
no flags Details | Formatted Diff | Diff
Patch (14.80 KB, patch)
2015-02-10 09:19 PST, Manuel Rego Casasnovas
no flags Details | Formatted Diff | Diff
Patch (27.43 KB, patch)
2015-03-13 02:48 PDT, Manuel Rego Casasnovas
no flags Details | Formatted Diff | Diff
Patch for landing (27.02 KB, patch)
2015-04-13 13:53 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 2015-02-10 09:12:00 PST
A very simple example where you use percentages to set columns and the width of the grid container is auto is not working as expected:

<div style="display: -webkit-grid; -webkit-grid-template-columns: 50% 50%;">
  <div>item 1</div>
  <div>item 2</div>
</div>

It's being interpreted as "auto auto" which is wrong, it should use the 50% of the width of the grid. As despite of being "auto" it doesn't mean it's indefinite.

This was discussed in the CSS WG mailing list, more details in the following thread:
http://lists.w3.org/Archives/Public/www-style/2014Aug/0364.html

This has been already fixed in Blink: http://code.google.com/p/chromium/issues/detail?id=407089
Comment 1 Manuel Rego Casasnovas 2015-02-10 09:17:20 PST
Created attachment 246329 [details]
Patch
Comment 2 Manuel Rego Casasnovas 2015-02-10 09:19:14 PST
Created attachment 246330 [details]
Patch
Comment 3 Sergio Villar Senin 2015-02-11 01:11:40 PST
Comment on attachment 246330 [details]
Patch

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

> Source/WebCore/rendering/RenderBox.cpp:4453
> +        return true;

Perhaps we could merge these three in a single condition.
Comment 4 Manuel Rego Casasnovas 2015-03-13 02:48:36 PDT
Created attachment 248582 [details]
Patch
Comment 5 Manuel Rego Casasnovas 2015-03-13 02:50:10 PDT
New version of the patch merging several fixes from Blink:
* https://codereview.chromium.org/906323003
* https://codereview.chromium.org/914993003
* https://codereview.chromium.org/948833002
* https://codereview.chromium.org/946553003
Comment 6 Manuel Rego Casasnovas 2015-03-30 13:35:56 PDT
Adding more reviewers on CC from suggest-reviewers. Please, could someone take a look? Thanks!
Comment 7 Dave Hyatt 2015-04-13 13:35:49 PDT
Comment on attachment 248582 [details]
Patch

r=me
Comment 8 WebKit Commit Bot 2015-04-13 13:45:50 PDT
Comment on attachment 248582 [details]
Patch

Rejecting attachment 248582 [details] from commit-queue.

Failed to run "['/Volumes/Data/EWS/WebKit/Tools/Scripts/webkit-patch', '--status-host=webkit-queues.appspot.com', '--bot-id=webkit-cq-02', 'validate-changelog', '--check-oops', '--non-interactive', 248582, '--port=mac']" exit_code: 1 cwd: /Volumes/Data/EWS/WebKit

ChangeLog entry in LayoutTests/ChangeLog contains OOPS!.

Full output: http://webkit-queues.appspot.com/results/5540314462814208
Comment 9 Manuel Rego Casasnovas 2015-04-13 13:53:24 PDT
Created attachment 250673 [details]
Patch for landing
Comment 10 WebKit Commit Bot 2015-04-13 22:00:10 PDT
Comment on attachment 250673 [details]
Patch for landing

Clearing flags on attachment: 250673

Committed r182780: <http://trac.webkit.org/changeset/182780>
Comment 11 WebKit Commit Bot 2015-04-13 22:00:15 PDT
All reviewed patches have been landed.  Closing bug.