Bug 115039 - [CSSRegions]Flex items auto-height regions have wrong height
Summary: [CSSRegions]Flex items auto-height regions have wrong height
Status: RESOLVED INVALID
Alias: None
Product: WebKit
Classification: Unclassified
Component: CSS (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords: AdobeTracked
Depends on: 118057
Blocks: 57312
  Show dependency treegraph
 
Reported: 2013-04-23 07:50 PDT by Mihnea Ovidenie
Modified: 2013-07-31 13:08 PDT (History)
3 users (show)

See Also:


Attachments
Test case (587 bytes, text/html)
2013-04-23 07:50 PDT, Mihnea Ovidenie
no flags Details
test file 2 (990 bytes, text/html)
2013-04-23 16:46 PDT, Alan Stearns
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Mihnea Ovidenie 2013-04-23 07:50:01 PDT
Created attachment 199234 [details]
Test case

If an auto-height region is a flex item, its height is not computed properly as it does not take the flowed content height into account (see attached sample).
Comment 1 Mihnea Ovidenie 2013-04-23 07:58:32 PDT
In the second pass of layout for auto-height regions, the flexbox container clears the overrideLogicalHeight for the autoHeight region before the overrideLogicalHeight (which stores the computed autoHeight value after the first phase) is transfered into the regions height.
Comment 2 Alan Stearns 2013-04-23 16:46:49 PDT
Created attachment 199334 [details]
test file 2

Here's another test file. In this case the region in the flex container is taking on the height of the container, but the second region isn't sizing correctly (there should be a black line around the second region's content - what you're seeing is overflow). If you take the border off the regions, the overflow in the second region disappears (perhaps this is a separate bug?)
Comment 3 Catalin badea 2013-07-30 01:28:55 PDT
The issue from the first test case has been fixed in #118057.

(In reply to comment #2)
> Created an attachment (id=199334) [details]
> test file 2
> 
> Here's another test file. In this case the region in the flex container is taking on the height of the container, but the second region isn't sizing correctly (there should be a black line around the second region's content - what you're seeing is overflow). If you take the border off the regions, the overflow in the second region disappears (perhaps this is a separate bug?)

The fact that the second region does not increases its size for fitting the content proved to be the correct behaviour according to the spec.
The rfcb height resolution with auto-height regions inside flexboxes roughly works as follows:
1. layout document using height=0 for auto-height regions. This includes a full flexbox layout.
2. Layout flow thread content and compute the height of auto-height regions ignoring any constraints set by the flex container.
3. layout document using the computed heights from step 2, this time honoring the constraints set by the flex container.

What this means is that, for test 2, the first region will compute a height equal to the flowthread's height and the second region will compute a height equal to zero (in step 2). In step 3 the flex container will apply
constraints on the first region shrinking it and causing overflow.

The overflow not being displayed unless the region with zero height has a border is another bug, indeed.
Comment 4 Mihai Balan 2013-07-31 13:08:42 PDT
Closing this one as per the above discussion and the conclusion that the current behavior is spec-compliant. For the zero-height region issue, bug 98265 is already logged.