Bug 79930

Summary: Implement flex-wrap: wrap
Product: WebKit Reporter: Tony Chang <tony>
Component: New BugsAssignee: Tony Chang <tony>
Status: RESOLVED FIXED    
Severity: Normal CC: hyatt, ojan, webkit.review.bot
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Bug Depends on:    
Bug Blocks: 70781    
Attachments:
Description Flags
Patch
none
Patch none

Description Tony Chang 2012-02-29 11:43:34 PST
Implement flex-wrap: wrap
Comment 1 Tony Chang 2012-02-29 11:57:27 PST
Created attachment 129487 [details]
Patch
Comment 2 Ojan Vafai 2012-02-29 14:40:52 PST
Comment on attachment 129487 [details]
Patch

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

Just the one issue for Hyatt to look at. The rest looks good modulo some nits.

> Source/WebCore/rendering/RenderFlexibleBox.cpp:592
> +bool RenderFlexibleBox::computeFlexOrder(FlexOrderIterator& iterator, OrderedFlexItemList& orderedChildren, LayoutUnit& preferredMainAxisExtent, float& totalPositiveFlexibility, float& totalNegativeFlexibility)

Not a huge fan of this method name. How about....computeNextFlexLine?

> Source/WebCore/rendering/RenderFlexibleBox.cpp:769
> +            setCrossAxisExtent(std::max(crossAxisExtent(), crossAxisOffset - flowAwareBorderBefore() - flowAwarePaddingBefore() + crossAxisBorderAndPaddingExtent() + crossAxisMarginExtentForChild(child) + childCrossAxisExtent + crossAxisScrollbarExtent()));

This is kind of gross. I'm not sure how to make it cleaner though. :(

> Source/WebCore/rendering/RenderFlexibleBox.cpp:795
> +    // Single line flexboxes fill the alignment space.

This isn't really an accurate comment. I think it just makes the code more confusing.

> Source/WebCore/rendering/RenderFlexibleBox.cpp:869
> +            } else if (isColumnFlow() && child->style()->logicalWidth().isAuto() && isMultiline()) {
> +                // FIXME: Handle min-width and max-width.
> +                LayoutUnit childWidth = lineCrossAxisExtent - crossAxisMarginExtentForChild(child);
> +                child->setOverrideWidth(std::max(0, childWidth));
> +                child->setChildNeedsLayout(true);
> +                child->layoutIfNeeded();

This part scares me. I think it's right, but it would be good to get Hyatt to confirm before committing.
Comment 3 Tony Chang 2012-02-29 14:46:26 PST
Created attachment 129523 [details]
Patch
Comment 4 Tony Chang 2012-02-29 14:52:47 PST
(In reply to comment #2)
> (From update of attachment 129487 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=129487&action=review
> 
> Just the one issue for Hyatt to look at. The rest looks good modulo some nits.
> 
> > Source/WebCore/rendering/RenderFlexibleBox.cpp:592
> > +bool RenderFlexibleBox::computeFlexOrder(FlexOrderIterator& iterator, OrderedFlexItemList& orderedChildren, LayoutUnit& preferredMainAxisExtent, float& totalPositiveFlexibility, float& totalNegativeFlexibility)
> 
> Not a huge fan of this method name. How about....computeNextFlexLine?

Done.

> > Source/WebCore/rendering/RenderFlexibleBox.cpp:795
> > +    // Single line flexboxes fill the alignment space.
> 
> This isn't really an accurate comment. I think it just makes the code more confusing.

Removed.
Comment 5 Dave Hyatt 2012-03-05 11:45:24 PST
Comment on attachment 129523 [details]
Patch

r=me
Comment 6 WebKit Review Bot 2012-03-05 13:59:26 PST
Comment on attachment 129523 [details]
Patch

Clearing flags on attachment: 129523

Committed r109799: <http://trac.webkit.org/changeset/109799>
Comment 7 WebKit Review Bot 2012-03-05 13:59:30 PST
All reviewed patches have been landed.  Closing bug.