Summary: | auto margins on flexbox should allocate space in the cross direction | ||||||||
---|---|---|---|---|---|---|---|---|---|
Product: | WebKit | Reporter: | Tony Chang <tony> | ||||||
Component: | Layout and Rendering | Assignee: | Tony Chang <tony> | ||||||
Status: | RESOLVED FIXED | ||||||||
Severity: | Normal | CC: | eric, hyatt, ojan, webkit.review.bot | ||||||
Priority: | P2 | ||||||||
Version: | 528+ (Nightly build) | ||||||||
Hardware: | Unspecified | ||||||||
OS: | Unspecified | ||||||||
Bug Depends on: | |||||||||
Bug Blocks: | 62048 | ||||||||
Attachments: |
|
Description
Tony Chang
2012-05-18 15:46:43 PDT
Created attachment 143647 [details]
Patch
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? Created attachment 143658 [details]
Patch
(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. Comment on attachment 143658 [details] Patch Clearing flags on attachment: 143658 Committed r118279: <http://trac.webkit.org/changeset/118279> All reviewed patches have been landed. Closing bug. |