Bug 103332

Summary: [CSS Grid Layout] Support 'auto' sized grid items
Product: WebKit Reporter: Julien Chaffraix <jchaffraix>
Component: Layout and RenderingAssignee: Julien Chaffraix <jchaffraix>
Status: RESOLVED FIXED    
Severity: Normal CC: eric, ojan.autocc, ojan, tony, webkit.review.bot, xan.lopez
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: All   
OS: All   
Bug Depends on: 103311    
Bug Blocks: 103573    
Attachments:
Description Flags
Proposed implementation: translate auto to minmax in RenderStyle. none

Description Julien Chaffraix 2012-11-26 17:35:03 PST
Per the specification, auto is equivalent to ‘minmax(min-content, max-content)’.

Talking with Ojan, this definition is different from the shrink-to-fit behavior (http://www.w3.org/TR/css3-box/#shrink-to-fit): min(max(preferred minimum width, available width), preferred width). It's possible to have the 2 equations applying on the same item (if 'self-align: start' and the grid track is 'auto') so we should check if there is no contradiction here.
Comment 1 Julien Chaffraix 2013-01-29 17:46:55 PST
We have moved up to a point where we can implement 'auto'. The main minmax bug is kept open so that we can track some issues blocked by the spec (e.g the question of orthogonal flow on grid items).
Comment 2 Julien Chaffraix 2013-01-30 10:26:20 PST
Created attachment 185517 [details]
Proposed implementation: translate auto to minmax in RenderStyle.
Comment 3 Tony Chang 2013-01-30 11:25:39 PST
Comment on attachment 185517 [details]
Proposed implementation: translate auto to minmax in RenderStyle.

This seems OK to me, but Ojan suggested putting the handling of auto in RenderGrid.cpp as a helper function.  He might have a stronger opinion than I do.
Comment 4 Julien Chaffraix 2013-01-30 13:36:40 PST
Comment on attachment 185517 [details]
Proposed implementation: translate auto to minmax in RenderStyle.

Ojan said that it was a slight violation of keeping RenderStyle dumb but he is fine with it due to the limited impact.
Comment 5 WebKit Review Bot 2013-01-30 14:43:32 PST
Comment on attachment 185517 [details]
Proposed implementation: translate auto to minmax in RenderStyle.

Clearing flags on attachment: 185517

Committed r141317: <http://trac.webkit.org/changeset/141317>
Comment 6 WebKit Review Bot 2013-01-30 14:43:35 PST
All reviewed patches have been landed.  Closing bug.