| Index: Source/core/rendering/RenderFlexibleBox.cpp
|
| diff --git a/Source/core/rendering/RenderFlexibleBox.cpp b/Source/core/rendering/RenderFlexibleBox.cpp
|
| index 2550757bf3132e57099f09e026870e4226758e1d..cc7e8ccbe50da7a671473e680681a295cc4b9dd9 100644
|
| --- a/Source/core/rendering/RenderFlexibleBox.cpp
|
| +++ b/Source/core/rendering/RenderFlexibleBox.cpp
|
| @@ -949,13 +949,13 @@ bool RenderFlexibleBox::resolveFlexibleLengths(FlexSign flexSign, const OrderedF
|
| return !totalViolation;
|
| }
|
|
|
| -static LayoutUnit initialJustifyContentOffset(LayoutUnit availableFreeSpace, EJustifyContent justifyContent, unsigned numberOfChildren)
|
| +static LayoutUnit initialJustifyContentOffset(LayoutUnit availableFreeSpace, ContentPosition justifyContent, ContentDistributionType justifyContentDistribution, unsigned numberOfChildren)
|
| {
|
| - if (justifyContent == JustifyFlexEnd)
|
| + if (justifyContent == ContentPositionFlexEnd)
|
| return availableFreeSpace;
|
| - if (justifyContent == JustifyCenter)
|
| + if (justifyContent == ContentPositionCenter)
|
| return availableFreeSpace / 2;
|
| - if (justifyContent == JustifySpaceAround) {
|
| + if (justifyContentDistribution == ContentDistributionSpaceAround) {
|
| if (availableFreeSpace > 0 && numberOfChildren)
|
| return availableFreeSpace / (2 * numberOfChildren);
|
| else
|
| @@ -964,12 +964,12 @@ static LayoutUnit initialJustifyContentOffset(LayoutUnit availableFreeSpace, EJu
|
| return 0;
|
| }
|
|
|
| -static LayoutUnit justifyContentSpaceBetweenChildren(LayoutUnit availableFreeSpace, EJustifyContent justifyContent, unsigned numberOfChildren)
|
| +static LayoutUnit justifyContentSpaceBetweenChildren(LayoutUnit availableFreeSpace, ContentDistributionType justifyContentDistribution, unsigned numberOfChildren)
|
| {
|
| if (availableFreeSpace > 0 && numberOfChildren > 1) {
|
| - if (justifyContent == JustifySpaceBetween)
|
| + if (justifyContentDistribution == ContentDistributionSpaceBetween)
|
| return availableFreeSpace / (numberOfChildren - 1);
|
| - if (justifyContent == JustifySpaceAround)
|
| + if (justifyContentDistribution == ContentDistributionSpaceAround)
|
| return availableFreeSpace / numberOfChildren;
|
| }
|
| return 0;
|
| @@ -1062,7 +1062,7 @@ void RenderFlexibleBox::layoutAndPlaceChildren(LayoutUnit& crossAxisOffset, cons
|
| size_t numberOfChildrenForJustifyContent = numberOfInFlowPositionedChildren(children);
|
| LayoutUnit autoMarginOffset = autoMarginOffsetInMainAxis(children, availableFreeSpace);
|
| LayoutUnit mainAxisOffset = flowAwareBorderStart() + flowAwarePaddingStart();
|
| - mainAxisOffset += initialJustifyContentOffset(availableFreeSpace, style()->justifyContent(), numberOfChildrenForJustifyContent);
|
| + mainAxisOffset += initialJustifyContentOffset(availableFreeSpace, style()->justifyContent(), style()->justifyContentDistribution(), numberOfChildrenForJustifyContent);
|
| if (style()->flexDirection() == FlowRowReverse)
|
| mainAxisOffset += isHorizontalFlow() ? verticalScrollbarWidth() : horizontalScrollbarHeight();
|
|
|
| @@ -1127,7 +1127,7 @@ void RenderFlexibleBox::layoutAndPlaceChildren(LayoutUnit& crossAxisOffset, cons
|
|
|
| ++seenInFlowPositionedChildren;
|
| if (seenInFlowPositionedChildren < numberOfChildrenForJustifyContent)
|
| - mainAxisOffset += justifyContentSpaceBetweenChildren(availableFreeSpace, style()->justifyContent(), numberOfChildrenForJustifyContent);
|
| + mainAxisOffset += justifyContentSpaceBetweenChildren(availableFreeSpace, style()->justifyContentDistribution(), numberOfChildrenForJustifyContent);
|
| }
|
|
|
| if (isColumnFlow())
|
| @@ -1153,7 +1153,7 @@ void RenderFlexibleBox::layoutColumnReverse(const OrderedFlexItemList& children,
|
| // just moving the children to a new position.
|
| size_t numberOfChildrenForJustifyContent = numberOfInFlowPositionedChildren(children);
|
| LayoutUnit mainAxisOffset = logicalHeight() - flowAwareBorderEnd() - flowAwarePaddingEnd();
|
| - mainAxisOffset -= initialJustifyContentOffset(availableFreeSpace, style()->justifyContent(), numberOfChildrenForJustifyContent);
|
| + mainAxisOffset -= initialJustifyContentOffset(availableFreeSpace, style()->justifyContent(), style()->justifyContentDistribution(), numberOfChildrenForJustifyContent);
|
| mainAxisOffset -= isHorizontalFlow() ? verticalScrollbarWidth() : horizontalScrollbarHeight();
|
|
|
| size_t seenInFlowPositionedChildren = 0;
|
| @@ -1172,7 +1172,7 @@ void RenderFlexibleBox::layoutColumnReverse(const OrderedFlexItemList& children,
|
|
|
| ++seenInFlowPositionedChildren;
|
| if (seenInFlowPositionedChildren < numberOfChildrenForJustifyContent)
|
| - mainAxisOffset -= justifyContentSpaceBetweenChildren(availableFreeSpace, style()->justifyContent(), numberOfChildrenForJustifyContent);
|
| + mainAxisOffset -= justifyContentSpaceBetweenChildren(availableFreeSpace, style()->justifyContentDistribution(), numberOfChildrenForJustifyContent);
|
| }
|
| }
|
|
|
|
|