Bug 94855 - flex item sized incorrectly in a column flexbox with height set via top/bottom
Summary: flex item sized incorrectly in a column flexbox with height set via top/bottom
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: CSS (show other bugs)
Version: 528+ (Nightly build)
Hardware: Mac (Intel) OS X 10.7
: P2 Normal
Assignee: Tony Chang
URL:
Keywords: HasReduction
Depends on: 94982
Blocks: 62048
  Show dependency treegraph
 
Reported: 2012-08-23 14:29 PDT by Steve Orvell
Modified: 2012-09-12 16:48 PDT (History)
4 users (show)

See Also:


Attachments
Reduction showing actual and expected output. (1.18 KB, text/html)
2012-08-23 14:29 PDT, Steve Orvell
no flags Details
corrected reduction (1.21 KB, text/html)
2012-08-23 14:35 PDT, Steve Orvell
no flags Details
Patch (8.02 KB, patch)
2012-09-12 15:49 PDT, Tony Chang
no flags Details | Formatted Diff | Diff
Patch for landing (8.16 KB, patch)
2012-09-12 16:22 PDT, Tony Chang
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Steve Orvell 2012-08-23 14:29:02 PDT
Created attachment 160246 [details]
Reduction showing actual and expected output.

If a display: -webkit-flex element with flex-flow: column is itself sized by fitting to another container via: setting position absolute + top, bottom, right, left all to 0, then its flex items lose their flexibility and appear to have natural size. 

Note, this problem only occurs for column flex-flow, row is ok. Further, setting height: 100% is ok.
Comment 1 Steve Orvell 2012-08-23 14:35:08 PDT
Created attachment 160251 [details]
corrected reduction
Comment 2 Ojan Vafai 2012-08-23 14:45:28 PDT
Yup, looks like a bug. Not sure where exactly the bug is though.
Comment 3 Tony Chang 2012-08-23 14:52:16 PDT
(In reply to comment #2)
> Yup, looks like a bug. Not sure where exactly the bug is though.

I think it's because we do our own calculation of height by calling computeLogicalClientHeight directly in RenderFlexibleBox::mainAxisContentExtent. It doesn't look like computeLogicalClientHeight handles absolute sized boxes.  If you look at computeLogicalHeight, it does:
    if (isOutOfFlowPositioned())
        computePositionedLogicalHeight();

Ok, I think I now know enough to fix this bug :)
Comment 4 Tony Chang 2012-08-24 17:03:12 PDT
Sorry, it's going to take a while to fix this bug.  I need to fix bug 94982 first, and that's going to take a while.
Comment 5 Tony Chang 2012-09-12 15:49:04 PDT
Created attachment 163723 [details]
Patch
Comment 6 Ojan Vafai 2012-09-12 16:16:01 PDT
Comment on attachment 163723 [details]
Patch

Add a FIXME for mainAxisContentExtent to be used for all the places we call computeLogicalHeight(...)?
Comment 7 Tony Chang 2012-09-12 16:22:16 PDT
Created attachment 163729 [details]
Patch for landing
Comment 8 WebKit Review Bot 2012-09-12 16:48:22 PDT
Comment on attachment 163729 [details]
Patch for landing

Clearing flags on attachment: 163729

Committed r128383: <http://trac.webkit.org/changeset/128383>
Comment 9 WebKit Review Bot 2012-09-12 16:48:25 PDT
All reviewed patches have been landed.  Closing bug.