New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 621054 link

Starred by 3 users

Issue metadata

Status: Fixed
Owner:
Closed: Aug 2016
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 3
Type: Bug



Sign in to add a comment

Make sure we handle contains: strict correctly with flexbox

Project Member Reported by cbiesin...@chromium.org, Jun 17 2016

Issue description

contains:strict should force flex-basis:auto to zero; we need to make that happen (or verify that it happens already)
 

Comment 1 by e...@chromium.org, Jun 22 2016

Cc: -ojan@chromium.org cbiesin...@chromium.org e...@chromium.org
Status: Available (was: Untriaged)

Comment 2 by ojan@chromium.org, Aug 3 2016

Did anyone end up looking into this?
Owner: cbiesin...@chromium.org
Status: Assigned (was: Available)
Not yet, but let me work on this.

I think there are two things for me to verify:
- flex-basis: auto; height: auto; contains: strict; forces a zero height (same for width)
- But also, objectIsRelayoutBoundary must not return true for a flex item (unless flex:none) or otherwise we may size a flex item incorrectly

https://cs.chromium.org/chromium/src/third_party/WebKit/Source/core/layout/LayoutObject.cpp?q=objectIsRelayoutBoundary&sq=package:chromium&l=709&dr=CSs
Also -- I assume contain: strict implies that we should treat min-width: auto as 0?

Comment 7 by ojan@chromium.org, Aug 3 2016

Cc: tabatkins@chromium.org
tab is the authority here, but all of your conclusions look correct to me as per "When laying out the containing element, it must be treated as having no contents." from https://drafts.csswg.org/css-containment/#containment-size.
Yeah, if you walk through the layout algorithm (and take into account the issue I just filed <https://github.com/w3c/csswg-drafts/issues/382>), then in all cases the element ends up with a zero flex basis.
Project Member

Comment 9 by bugdroid1@chromium.org, Aug 8 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/9d0095399ecfcb085e929a7d89e8db3db7a9bbf3

commit 9d0095399ecfcb085e929a7d89e8db3db7a9bbf3
Author: cbiesinger <cbiesinger@chromium.org>
Date: Mon Aug 08 16:08:13 2016

[css-flexbox] Correctly implement contain: size on a flex item

This patch has a few changes:
- childIntrinsicLogicalHeight should not use the intrinsic content height
  for a contain: strict flex item -- if we don't have a definite size,
  we should treat its height as zero. And needToStretchChildLogicalHeight
  only returns true for an auto-height flex item.
- computeInnerFlexBaseSizeForChild does not need to trigger a layout for
  an indefinite flex basis -- those are just zero for contain: size elements.
- min-height: auto computes to 0 for contain: size
- flex items should not be layout roots even if they could otherwise be a root
  as they may need to be stretched by their parent, even if they are contain:
  strict. I have not managed to construct a testcase that fails but I don't
  see how that could be correct.

Please verify that my understanding of the containment spec is correct!

BUG= 621054 
R=eae@chromium.org,tabatkins@chromium.org,ojan@chromium.org,dgrogan@chromium.org

Review-Url: https://codereview.chromium.org/2216903004
Cr-Commit-Position: refs/heads/master@{#410370}

[add] https://crrev.com/9d0095399ecfcb085e929a7d89e8db3db7a9bbf3/third_party/WebKit/LayoutTests/css3/flexbox/flex-item-contains-strict.html
[modify] https://crrev.com/9d0095399ecfcb085e929a7d89e8db3db7a9bbf3/third_party/WebKit/Source/core/layout/LayoutFlexibleBox.cpp
[modify] https://crrev.com/9d0095399ecfcb085e929a7d89e8db3db7a9bbf3/third_party/WebKit/Source/core/layout/LayoutObject.cpp

Status: Fixed (was: Assigned)

Sign in to add a comment