Flexitem margins should be based on content width, not width
authortony@chromium.org <tony@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 13 Sep 2012 18:39:27 +0000 (18:39 +0000)
committertony@chromium.org <tony@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 13 Sep 2012 18:39:27 +0000 (18:39 +0000)
commitb5fd1d54389bf10421c30bd60cdb82608162cef5
tree3ce356b204d8829fe5a6484c20176ba731e90273
parent2ab5095329cbbadcbcb4f847eaffcfb4bc411029
Flexitem margins should be based on content width, not width
https://bugs.webkit.org/show_bug.cgi?id=96674

Reviewed by Ojan Vafai.

Source/WebCore:

Margins should be based on content width. Also remove some calls to
mainAxisContentExtent() when we can use contentLogicalWidth instead.

Tests: css3/flexbox/percent-margins.html has a new testcase.

* rendering/RenderFlexibleBox.cpp:
(WebCore::RenderFlexibleBox::computeMainAxisExtentForChild): Use contentLogicalWidth instead of
passing in the maximum value (only used in the width case).
(WebCore::RenderFlexibleBox::preferredMainAxisContentExtentForChild): Don't pass in mainAxisContentExtent.
(WebCore::RenderFlexibleBox::computeChildMarginValue): Use contentLogicalWidth and simplify the code.
(WebCore::RenderFlexibleBox::computeMainAxisPreferredSizes): Remove unnecessary mainAxisContentExtent() call.
(WebCore::RenderFlexibleBox::adjustChildSizeForMinAndMax): Remove unnecessary flexboxAvailableContentExtent.
(WebCore::RenderFlexibleBox::computeNextFlexLine): Remove unnecessary mainAxisContentExtent() call.
(WebCore::RenderFlexibleBox::resolveFlexibleLengths): Remove unnecessary mainAxisContentExtent() call.
* rendering/RenderFlexibleBox.h: Remove unnecessary params.

LayoutTests:

Add a test case where contentWidth != width.

* css3/flexbox/percent-margins-expected.txt:
* css3/flexbox/percent-margins.html:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@128486 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/css3/flexbox/percent-margins-expected.txt
LayoutTests/css3/flexbox/percent-margins.html
Source/WebCore/ChangeLog
Source/WebCore/rendering/RenderFlexibleBox.cpp
Source/WebCore/rendering/RenderFlexibleBox.h