Summary: | Avoid a second layout of flex items in computeMainAxisPreferredSizes | ||||||
---|---|---|---|---|---|---|---|
Product: | WebKit | Reporter: | Carlos Garcia Campos <cgarcia> | ||||
Component: | Layout and Rendering | Assignee: | 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
Carlos Garcia Campos
2012-12-20 01:47:34 PST
Created attachment 180302 [details]
Patch
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. 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. 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 on attachment 180302 [details]
Patch
Clearing flags since the patch is not correct
|