Bug 76867

Summary: nesting horizontal flexboxes is broken
Product: WebKit Reporter: Tony Chang <tony>
Component: Layout and RenderingAssignee: Ojan Vafai <ojan>
Severity: Normal CC: hyatt, ojan, tony
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
URL: http://plexode.com/eval3/#ht=%3Cdiv%20style%3D%22display%3A%20-webkit-flexbox%3Bborder%3A%201px%20solid%20red%3B%22%3E%0A%0A%3Cdiv%20style%3D%22display%3A%20-webkit-flexbox%3B%22%3E%0A%20%20%3Cdiv%3E111%3C%2Fdiv%3E%0A%20%20%3Cdiv%3E22222222%3C%2Fdiv%3E%0A%20%20%3Cdiv%3E333%3C%2Fdiv%3E%0A%3C%2Fdiv%3E%0A%0A%3Cdiv%20style%3D%22width%3A%20-webkit-flex(1)%3B%20background-color%3A%20pink%22%3E%3C%2Fdiv%3E%0A%0A%3C%2Fdiv%3E&ohh=1&ohj=1&jt=&ojh=1&ojj=1&ms=100&oth=0&otj=0&cex=1
Bug Depends on:    
Bug Blocks: 62048    
Description Flags
Patch hyatt: review+

Description Tony Chang 2012-01-23 15:10:45 PST
Test case in the URL.  The text in the inner flexbox is overflowing, but it shouldn't.
Comment 1 Tony Chang 2012-01-27 15:25:59 PST
This is because we need to implement computePreferredLogicalWidths().  Without it, we fall back on RenderBlock::computePreferredLogicalWidths which doesn't know about horizontal layout.
Comment 2 Ojan Vafai 2012-01-27 16:03:22 PST
We also break when floating the flexbox itself:
<div style="border:1px solid blue;display:-webkit-flexbox;float:left"><div>foo</div><div>barbaz</div></div>

Would be good for the fix to this to have a testcase for float as well.
Comment 3 Ojan Vafai 2012-02-09 16:11:51 PST
Created attachment 126398 [details]
Comment 4 Dave Hyatt 2012-02-13 13:16:13 PST
Comment on attachment 126398 [details]

View in context: https://bugs.webkit.org/attachment.cgi?id=126398&action=review

r=me, with the rename suggestion for the static method below.

> Source/WebCore/rendering/RenderFlexibleBox.cpp:159
> +static LayoutUnit marginWidthForChild(RenderBox* child, RenderStyle* parentStyle)

Should be marginLogicalWidthForChild.
Comment 5 Ojan Vafai 2012-02-13 15:38:05 PST
Committed r107624: <http://trac.webkit.org/changeset/107624>