RESOLVED FIXED Bug 86913
auto margins on flexbox should allocate space in the cross direction
https://bugs.webkit.org/show_bug.cgi?id=86913
Summary auto margins on flexbox should allocate space in the cross direction
Tony Chang
Reported 2012-05-18 15:46:43 PDT
See the section here: http://dev.w3.org/csswg/css3-flexbox/#auto-margins We're currently treating auto margins as 0. See also 83086.
Attachments
Patch (28.49 KB, patch)
2012-05-23 14:06 PDT, Tony Chang
no flags
Patch (30.18 KB, patch)
2012-05-23 14:50 PDT, Tony Chang
no flags
Tony Chang
Comment 1 2012-05-23 14:06:52 PDT
Ojan Vafai
Comment 2 2012-05-23 14:20:28 PDT
Comment on attachment 143647 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=143647&action=review > Source/WebCore/rendering/RenderFlexibleBox.cpp:720 > + child->setMarginTop(availableAlignmentSpace / 2); > + child->setMarginBottom(availableAlignmentSpace / 2); > + return true; > + } > + if (start.isAuto()) { > + adjustAlignmentForChild(child, availableAlignmentSpace); > + child->setMarginTop(availableAlignmentSpace); > + return true; > + } > + if (end.isAuto()) { > + child->setMarginBottom(availableAlignmentSpace); If we're in a vertical flow, don't we want to be setting marginLeft/marginRight?
Tony Chang
Comment 3 2012-05-23 14:50:58 PDT
Tony Chang
Comment 4 2012-05-23 14:51:25 PDT
(In reply to comment #2) > (From update of attachment 143647 [details]) > View in context: https://bugs.webkit.org/attachment.cgi?id=143647&action=review > > > Source/WebCore/rendering/RenderFlexibleBox.cpp:720 > > + child->setMarginTop(availableAlignmentSpace / 2); > > + child->setMarginBottom(availableAlignmentSpace / 2); > > + return true; > > + } > > + if (start.isAuto()) { > > + adjustAlignmentForChild(child, availableAlignmentSpace); > > + child->setMarginTop(availableAlignmentSpace); > > + return true; > > + } > > + if (end.isAuto()) { > > + child->setMarginBottom(availableAlignmentSpace); > > If we're in a vertical flow, don't we want to be setting marginLeft/marginRight? Yes, you're right. Fixed and a test case added in auto-margins.html.
WebKit Review Bot
Comment 5 2012-05-23 17:19:01 PDT
Comment on attachment 143658 [details] Patch Clearing flags on attachment: 143658 Committed r118279: <http://trac.webkit.org/changeset/118279>
WebKit Review Bot
Comment 6 2012-05-23 17:19:05 PDT
All reviewed patches have been landed. Closing bug.
Note You need to log in before you can comment on or make changes to this bug.