Bug 81722 - compute the sign of flexibility for new flexbox
Summary: compute the sign of flexibility for new flexbox
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Tony Chang
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-03-20 16:55 PDT by Tony Chang
Modified: 2012-03-21 13:00 PDT (History)
3 users (show)

See Also:


Attachments
Patch (7.29 KB, patch)
2012-03-20 17:03 PDT, Tony Chang
no flags Details | Formatted Diff | Diff
Patch (9.15 KB, patch)
2012-03-21 10:19 PDT, Tony Chang
no flags Details | Formatted Diff | Diff
Patch for landing (9.33 KB, patch)
2012-03-21 11:36 PDT, Tony Chang
no flags 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-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.