Make sure we handle contains: strict correctly with flexbox |
|||||
Issue descriptioncontains:strict should force flex-basis:auto to zero; we need to make that happen (or verify that it happens already)
,
Aug 3 2016
Did anyone end up looking into this?
,
Aug 3 2016
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
,
Aug 3 2016
So here's a testcase: http://plexode.com/eval3/#s=aekVQXANJVQMbAx1yAXgePQN5GwFKT02fRg5HTUZZHAGEnYepi51TRkWppacORUqxRFVKUE+dRFBNVk5PqXoOwU9VRsudtVkOVFVCU1Ucmh89TwEBlZeZA8rUn53TU0q72AMfNFBORgHMWVUdEHLaT/b429vfTCaTieUCiUimVCqViuWCyWkHW65Iy7Xq/AJTKBYY7JXzMZwBaDSajWdb5br/cLjITlALndLXbLueDyU71e75fYfAZeAA Ojan/others who know containment, the height should be zero, right?
,
Aug 3 2016
,
Aug 3 2016
Also -- I assume contain: strict implies that we should treat min-width: auto as 0?
,
Aug 3 2016
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.
,
Aug 4 2016
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.
,
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
,
Aug 8 2016
|
|||||
►
Sign in to add a comment |
|||||
Comment 1 by e...@chromium.org
, Jun 22 2016Status: Available (was: Untriaged)