Bug 76867 - nesting horizontal flexboxes is broken
Summary: nesting horizontal flexboxes is broken
Alias: None
Product: WebKit
Classification: Unclassified
Component: Layout and Rendering (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Ojan Vafai
URL: http://plexode.com/eval3/#ht=%3Cdiv%2...
Depends on:
Blocks: 62048
  Show dependency treegraph
Reported: 2012-01-23 15:10 PST by Tony Chang
Modified: 2012-02-13 15:38 PST (History)
3 users (show)

See Also:

Patch (18.84 KB, patch)
2012-02-09 16:11 PST, Ojan Vafai
hyatt: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
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>