Bug 141435

Summary: [CSS Grid Layout] Columns set in percentages collapse to auto width
Product: WebKit Reporter: Manuel Rego Casasnovas <rego>
Component: Layout and RenderingAssignee: Manuel Rego Casasnovas <rego>
Status: RESOLVED FIXED    
Severity: Normal CC: commit-queue, darin, dino, esprehn+autocc, glenn, hyatt, jfernandez, kondapallykalyan, rniwa, simon.fraser, svillar
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Bug Depends on:    
Bug Blocks: 60731    
Attachments:
Description Flags
Patch
none
Patch
none
Patch
none
Patch for landing none

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.