Bug 76867

Summary: nesting horizontal flexboxes is broken
Product: WebKit Reporter: Tony Chang <tony>
Component: Layout and RenderingAssignee: Ojan Vafai <ojan>
Status: RESOLVED FIXED    
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    
Attachments:
Description Flags
Patch hyatt: review+

Tony Chang
Reported 2012-01-23 15:10:45 PST
Test case in the URL. The text in the inner flexbox is overflowing, but it shouldn't.
Attachments
Patch (18.84 KB, patch)
2012-02-09 16:11 PST, Ojan Vafai
hyatt: review+
Tony Chang
Comment 1 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.
Ojan Vafai
Comment 2 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.
Ojan Vafai
Comment 3 2012-02-09 16:11:51 PST
Dave Hyatt
Comment 4 2012-02-13 13:16:13 PST
Comment on attachment 126398 [details] Patch 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.
Ojan Vafai
Comment 5 2012-02-13 15:38:05 PST
Note You need to log in before you can comment on or make changes to this bug.