Bug 166061

Summary: RenderFlexibleBox::applyStretchAlignmentToChild uses wrong available width for constrainLogicalWidthInRegionByMinMax
Product: WebKit Reporter: Christian Biesinger <cbiesinger>
Component: Layout and RenderingAssignee: Nobody <webkit-unassigned>
Status: RESOLVED FIXED    
Severity: Normal CC: hyatt, jonlee, kybishop, simon.fraser, webkit-bug-importer, zalan
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   

Description Christian Biesinger 2016-12-20 07:07:05 PST
From Chrome bug https://bugs.chromium.org/p/chromium/issues/detail?id=675333

The code here:
https://trac.webkit.org/browser/trunk/Source/WebCore/rendering/RenderFlexibleBox.cpp#L1499

            childWidth = child.constrainLogicalWidthInRegionByMinMax(childWidth, childWidth, *this);

Should not pass childWidth() as the second argument -- that will lead to an incorrect percentage calculation for multiline column flexboxes or children with margins in a column flexbox. See the mentioned Chrome bug for a testcase. Fix should be to replace the second childWidth with contentLogicalWidth().
Comment 1 Radar WebKit Bug Importer 2016-12-21 17:29:11 PST
<rdar://problem/29780895>
Comment 2 Kyle Bishop 2017-02-06 22:42:43 PST
This is a confirmed bug in Chrome with a known and easy fix. Bumping this to request an easy patch because this bug affects a number of CSS/JS layout frameworks, and causes more harm the longer the bug lingers.

Thanks!
Comment 3 Dave Hyatt 2017-02-28 10:48:09 PST
This was fixed (and atest case added) by my Blink merge to flex box.