Bug 105512

Summary: Avoid a second layout of flex items in computeMainAxisPreferredSizes
Product: WebKit Reporter: Carlos Garcia Campos <cgarcia>
Component: Layout and RenderingAssignee: Nobody <webkit-unassigned>
Status: NEW ---    
Severity: Normal CC: eric, ojan.autocc, tony, webkit.review.bot
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Bug Depends on:    
Bug Blocks: 62048    
Attachments:
Description Flags
Patch none

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]
Patch
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]
Patch

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

New failing tests:
css3/flexbox/flexitem.html
Comment 5 Carlos Garcia Campos 2012-12-21 06:14:52 PST
Comment on attachment 180302 [details]
Patch

Clearing flags since the patch is not correct