Bug 94807 - Flexbox doesn't need to compute logical height for stretched items in row flow
Summary: Flexbox doesn't need to compute logical height for stretched items in row flow
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: Shezan Baig
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-08-23 06:53 PDT by Shezan Baig
Modified: 2012-08-23 12:46 PDT (History)
4 users (show)

See Also:


Attachments
Patch (6.03 KB, patch)
2012-08-23 08:46 PDT, Shezan Baig
no flags Details | Formatted Diff | Diff
Patch (6.12 KB, patch)
2012-08-23 11:48 PDT, Shezan Baig
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Shezan Baig 2012-08-23 06:53:30 PDT
Since we only stretch when child->style()->logicalHeight().isAuto(), there is no need to compute the logical height.  We just need to constain by min-max values.  See bug 94604, comment 2 for details
Comment 1 Shezan Baig 2012-08-23 08:46:13 PDT
Created attachment 160173 [details]
Patch

Initial patch for review
Comment 2 Tony Chang 2012-08-23 10:28:58 PDT
Comment on attachment 160173 [details]
Patch

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

> Source/WebCore/rendering/RenderBox.cpp:443
>      if (maxH == -1)
> -        maxH = result;
> -    result = min(maxH, result);
> -    result = max(minH, result);
> -    return result;
> +        maxH = logicalHeight;
> +    logicalHeight = min(maxH, logicalHeight);

Nit: This could just be:
if (maxH != -1)
    logicalHeight = min(maxH, logicalHeight);
Comment 3 Shezan Baig 2012-08-23 11:48:55 PDT
Created attachment 160205 [details]
Patch

I simplified it further -- the entire maxH block can be skipped if style()->logicalMaxHeight().isUndefined()
Comment 4 WebKit Review Bot 2012-08-23 12:46:29 PDT
Comment on attachment 160205 [details]
Patch

Clearing flags on attachment: 160205

Committed r126468: <http://trac.webkit.org/changeset/126468>
Comment 5 WebKit Review Bot 2012-08-23 12:46:32 PDT
All reviewed patches have been landed.  Closing bug.