Bug 105512 - Avoid a second layout of flex items in computeMainAxisPreferredSizes
Summary: Avoid a second layout of flex items in computeMainAxisPreferredSizes
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: Layout and Rendering (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
Depends on:
Blocks: 62048
  Show dependency treegraph
Reported: 2012-12-20 01:47 PST by Carlos Garcia Campos
Modified: 2017-07-18 08:29 PDT (History)
4 users (show)

See Also:

Patch (1.94 KB, patch)
2012-12-20 01:49 PST, Carlos Garcia Campos
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Carlos Garcia Campos 2012-12-20 01:47:34 PST
In case of orthogonal flow when the flex basis or min main axis are auto for child, we are laying out the child in computeMainAxisPreferredSizes. If called a second time, we don't need to re-layout the child unless its main axis size is a percentage.
Comment 1 Carlos Garcia Campos 2012-12-20 01:49:40 PST
Created attachment 180302 [details]
Comment 2 Tony Chang 2012-12-20 10:09:36 PST
It seems like if the flex size is different from the preferred size, during a relayout, you'll use the previous flex size instead of recomputing the preferred size.  I'm not sure we have a test case that does this, but we should try to add one.

Another idea would be to cache the child's preferred size and if we don't need to relayout the child, we could use the cached preferred size.  Not sure how much of a win that really is.
Comment 4 Build Bot 2012-12-20 21:29:42 PST
Comment on attachment 180302 [details]

Attachment 180302 [details] did not pass mac-ews (mac):
Output: http://queues.webkit.org/results/15460195

New failing tests:
Comment 5 Carlos Garcia Campos 2012-12-21 06:14:52 PST
Comment on attachment 180302 [details]

Clearing flags since the patch is not correct