WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
NEW
105512
Avoid a second layout of flex items in computeMainAxisPreferredSizes
https://bugs.webkit.org/show_bug.cgi?id=105512
Summary
Avoid a second layout of flex items in computeMainAxisPreferredSizes
Carlos Garcia Campos
Reported
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.
Attachments
Patch
(1.94 KB, patch)
2012-12-20 01:49 PST
,
Carlos Garcia Campos
no flags
Details
Formatted Diff
Diff
View All
Add attachment
proposed patch, testcase, etc.
Carlos Garcia Campos
Comment 1
2012-12-20 01:49:40 PST
Created
attachment 180302
[details]
Patch
Tony Chang
Comment 2
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.
Tony Chang
Comment 3
2012-12-20 11:58:47 PST
Here's an example:
http://plexode.com/eval3/#ht=%3Cdiv%20id%3D%22container%22%20style%3D%22height%3A%20200px%22%3E%0A%3Cdiv%20style%3D%22display%3A-webkit-flex%3B%20-webkit-flex-flow%3A%20column%3B%20height%3A%20100%25%22%3E%0A%20%20%3Cdiv%20id%3D%22a%22%20style%3D%22-webkit-flex%3A%201%20auto%3B%20background-color%3A%20pink%3B%22%3Ea%3C%2Fdiv%3E%0A%20%20%3Cdiv%20id%3Db%20style%3D%22-webkit-flex%3A%201%2050px%3B%20background-color%3A%20lime%3B%22%3Eb%3C%2Fdiv%3E%0A%3C%2Fdiv%3E%0A%3C%2Fdiv%3E&ohj=0&jt=container.style.height%20%3D%20%22100px%22%0AgetComputedStyle(a).height%20%2B%20%22%2C%22%20%2B%20getComputedStyle(b).height&ojh=0&ojj=0
Press the "eval JS now" button. It reduces the height of the container, but we don't relayout the flex children, so they stay the same size.
Build Bot
Comment 4
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
Carlos Garcia Campos
Comment 5
2012-12-21 06:14:52 PST
Comment on
attachment 180302
[details]
Patch Clearing flags since the patch is not correct
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug