Bug 81722

Summary: compute the sign of flexibility for new flexbox
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   
Attachments:
Description Flags
Patch
none
Patch
none
Patch for landing none

Description Tony Chang 2012-03-20 16:55:17 PDT
compute the sign of flexibility for new flexbox
Comment 1 Tony Chang 2012-03-20 17:03:19 PDT
Created attachment 132931 [details]
Patch
Comment 2 Tony Chang 2012-03-20 17:03:42 PDT
The ChangeLog links to the relevant part of the spec.
Comment 3 Build Bot 2012-03-20 19:42:56 PDT
Comment on attachment 132931 [details]
Patch

Attachment 132931 [details] did not pass mac-ews (mac):
Output: http://queues.webkit.org/results/12035169
Comment 4 Tony Chang 2012-03-21 10:19:37 PDT
Created attachment 133067 [details]
Patch
Comment 5 Tony Chang 2012-03-21 10:20:39 PDT
As discussed offline, rather than adding a new loop, we compute the min/max applied size when we're computing the not min/max applied size. This should be a bit more efficient.
Comment 6 Ojan Vafai 2012-03-21 11:26:34 PDT
Comment on attachment 133067 [details]
Patch

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

> Source/WebCore/rendering/RenderFlexibleBox.cpp:744
> +        Length maxLength = isHorizontalFlow() ? child->style()->maxWidth() : child->style()->maxHeight();
> +        if (maxLength.isSpecified() && childMinMaxAppliedMainAxisExtent > valueForLength(maxLength, flexboxAvailableContentExtent))
> +            childMinMaxAppliedMainAxisExtent = valueForLength(maxLength, flexboxAvailableContentExtent);
> +        Length minLength = isHorizontalFlow() ? child->style()->minWidth() : child->style()->minHeight();
> +        if (minLength.isSpecified() && childMinMaxAppliedMainAxisExtent < valueForLength(minLength, flexboxAvailableContentExtent))
> +            childMinMaxAppliedMainAxisExtent = valueForLength(minLength, flexboxAvailableContentExtent);

As discussed in person, I'm pretty sure this does the wrong thing for percentages. I think we may want to use RenderBox::computeLogicalHeightUsing and RenderBox::computeLogicalWidthInRegionUsing, but I'm not sure.

In either case, I'm fine with committing this now with a FIXME. Would be good to get Hyatt's thoughts on the right way to do this.
Comment 7 Tony Chang 2012-03-21 11:36:00 PDT
Created attachment 133084 [details]
Patch for landing
Comment 8 WebKit Review Bot 2012-03-21 13:00:39 PDT
Comment on attachment 133084 [details]
Patch for landing

Clearing flags on attachment: 133084

Committed r111596: <http://trac.webkit.org/changeset/111596>
Comment 9 WebKit Review Bot 2012-03-21 13:00:43 PDT
All reviewed patches have been landed.  Closing bug.