Bug 87546 - Implied minimum size of flex items is min-content
Summary: Implied minimum size of flex items is min-content
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: Ojan Vafai
URL:
Keywords:
Depends on: 88437
Blocks: 62048
  Show dependency treegraph
 
Reported: 2012-05-25 16:11 PDT by Tony Chang
Modified: 2012-07-12 14:38 PDT (History)
3 users (show)

See Also:


Attachments
Patch (21.33 KB, patch)
2012-07-12 13:25 PDT, Ojan Vafai
tony: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Tony Chang 2012-05-25 16:11:21 PDT
In new flexbox, the min-{width,height} in the flex direction should default to min-content.  This avoids overflowing flex items if we can shrink another item.  It also means we will overflow the flexbox rather than flex items.

http://dev.w3.org/csswg/css3-flexbox/#min-size-auto
Comment 1 Ojan Vafai 2012-07-12 13:25:06 PDT
Created attachment 152045 [details]
Patch
Comment 2 Tony Chang 2012-07-12 13:52:18 PDT
Comment on attachment 152045 [details]
Patch

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

> Source/WebCore/rendering/RenderFlexibleBox.cpp:754
> +        Length min = isHorizontalFlow() ? child->style()->minWidth() : child->style()->minHeight();

Nit: childMin or maybe even childMainAxisMin

> Source/WebCore/rendering/RenderFlexibleBox.cpp:805
> +        if (childSize < minContent)
> +            return minContent;

Nit: You could either return std::max(childSize, minContent) or assign that value to childSize.

> LayoutTests/css3/flexbox/flex-item-min-size.html:41
> +    <div>Tests that flex items have default min-size to min-content in the main axis direction.</div>

It would be nice to test this for other writing modes.
Comment 3 Ojan Vafai 2012-07-12 14:38:40 PDT
Committed r122508: <http://trac.webkit.org/changeset/122508>