| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2011 Google Inc. All rights reserved. | 2 * Copyright (C) 2011 Google Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
| 6 * met: | 6 * met: |
| 7 * | 7 * |
| 8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
| (...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 112 minLogicalWidth = std::max(minLogicalWidth, minPreferredLogicalW
idth); | 112 minLogicalWidth = std::max(minLogicalWidth, minPreferredLogicalW
idth); |
| 113 } else | 113 } else |
| 114 minLogicalWidth += minPreferredLogicalWidth; | 114 minLogicalWidth += minPreferredLogicalWidth; |
| 115 } else { | 115 } else { |
| 116 minLogicalWidth = std::max(minPreferredLogicalWidth, minLogicalWidth
); | 116 minLogicalWidth = std::max(minPreferredLogicalWidth, minLogicalWidth
); |
| 117 maxLogicalWidth = std::max(maxPreferredLogicalWidth, maxLogicalWidth
); | 117 maxLogicalWidth = std::max(maxPreferredLogicalWidth, maxLogicalWidth
); |
| 118 } | 118 } |
| 119 } | 119 } |
| 120 | 120 |
| 121 maxLogicalWidth = std::max(minLogicalWidth, maxLogicalWidth); | 121 maxLogicalWidth = std::max(minLogicalWidth, maxLogicalWidth); |
| 122 | |
| 123 LayoutUnit scrollbarWidth = instrinsicScrollbarLogicalWidth(); | |
| 124 maxLogicalWidth += scrollbarWidth; | |
| 125 minLogicalWidth += scrollbarWidth; | |
| 126 } | 122 } |
| 127 | 123 |
| 128 static int synthesizedBaselineFromContentBox(const RenderBox* box, LineDirection
Mode direction) | 124 static int synthesizedBaselineFromContentBox(const RenderBox* box, LineDirection
Mode direction) |
| 129 { | 125 { |
| 130 return direction == HorizontalLine ? box->borderTop() + box->paddingTop() +
box->contentHeight() : box->borderRight() + box->paddingRight() + box->contentWi
dth(); | 126 return direction == HorizontalLine ? box->borderTop() + box->paddingTop() +
box->contentHeight() : box->borderRight() + box->paddingRight() + box->contentWi
dth(); |
| 131 } | 127 } |
| 132 | 128 |
| 133 int RenderFlexibleBox::baselinePosition(FontBaseline, bool, LineDirectionMode di
rection, LinePositionMode mode) const | 129 int RenderFlexibleBox::baselinePosition(FontBaseline, bool, LineDirectionMode di
rection, LinePositionMode mode) const |
| 134 { | 130 { |
| 135 ASSERT(mode == PositionOnContainingLine); | 131 ASSERT(mode == PositionOnContainingLine); |
| (...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 223 { | 219 { |
| 224 ASSERT(needsLayout()); | 220 ASSERT(needsLayout()); |
| 225 | 221 |
| 226 if (!relayoutChildren && simplifiedLayout()) | 222 if (!relayoutChildren && simplifiedLayout()) |
| 227 return; | 223 return; |
| 228 | 224 |
| 229 if (updateLogicalWidthAndColumnWidth()) | 225 if (updateLogicalWidthAndColumnWidth()) |
| 230 relayoutChildren = true; | 226 relayoutChildren = true; |
| 231 | 227 |
| 232 LayoutUnit previousHeight = logicalHeight(); | 228 LayoutUnit previousHeight = logicalHeight(); |
| 233 setLogicalHeight(borderAndPaddingLogicalHeight() + scrollbarLogicalHeight())
; | 229 setLogicalHeight(borderAndPaddingLogicalHeight()); |
| 234 | 230 |
| 235 { | 231 { |
| 236 LayoutState state(*this, locationOffset()); | 232 LayoutState state(*this, locationOffset()); |
| 237 | 233 |
| 238 m_numberOfInFlowChildrenOnFirstLine = -1; | 234 m_numberOfInFlowChildrenOnFirstLine = -1; |
| 239 | 235 |
| 240 RenderBlock::startDelayUpdateScrollInfo(); | 236 RenderBlock::startDelayUpdateScrollInfo(); |
| 241 | 237 |
| 242 prepareOrderIteratorAndMargins(); | 238 prepareOrderIteratorAndMargins(); |
| 243 | 239 |
| (...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 388 | 384 |
| 389 LayoutUnit RenderFlexibleBox::crossAxisContentExtent() const | 385 LayoutUnit RenderFlexibleBox::crossAxisContentExtent() const |
| 390 { | 386 { |
| 391 return isHorizontalFlow() ? contentHeight() : contentWidth(); | 387 return isHorizontalFlow() ? contentHeight() : contentWidth(); |
| 392 } | 388 } |
| 393 | 389 |
| 394 LayoutUnit RenderFlexibleBox::mainAxisContentExtent(LayoutUnit contentLogicalHei
ght) | 390 LayoutUnit RenderFlexibleBox::mainAxisContentExtent(LayoutUnit contentLogicalHei
ght) |
| 395 { | 391 { |
| 396 if (isColumnFlow()) { | 392 if (isColumnFlow()) { |
| 397 LogicalExtentComputedValues computedValues; | 393 LogicalExtentComputedValues computedValues; |
| 398 LayoutUnit borderPaddingAndScrollbar = borderAndPaddingLogicalHeight() +
scrollbarLogicalHeight(); | 394 LayoutUnit borderPaddingAndScrollbar = borderAndPaddingLogicalHeight(); |
| 399 LayoutUnit borderBoxLogicalHeight = contentLogicalHeight + borderPadding
AndScrollbar; | 395 LayoutUnit borderBoxLogicalHeight = contentLogicalHeight + borderPadding
AndScrollbar; |
| 400 computeLogicalHeight(borderBoxLogicalHeight, logicalTop(), computedValue
s); | 396 computeLogicalHeight(borderBoxLogicalHeight, logicalTop(), computedValue
s); |
| 401 if (computedValues.m_extent == LayoutUnit::max()) | 397 if (computedValues.m_extent == LayoutUnit::max()) |
| 402 return computedValues.m_extent; | 398 return computedValues.m_extent; |
| 403 return std::max(LayoutUnit(0), computedValues.m_extent - borderPaddingAn
dScrollbar); | 399 return std::max(LayoutUnit(0), computedValues.m_extent - borderPaddingAn
dScrollbar); |
| 404 } | 400 } |
| 405 return contentLogicalWidth(); | 401 return contentLogicalWidth(); |
| 406 } | 402 } |
| 407 | 403 |
| 408 LayoutUnit RenderFlexibleBox::computeMainAxisExtentForChild(RenderBox* child, Si
zeType sizeType, const Length& size) | 404 LayoutUnit RenderFlexibleBox::computeMainAxisExtentForChild(RenderBox* child, Si
zeType sizeType, const Length& size) |
| 409 { | 405 { |
| 410 // FIXME: This is wrong for orthogonal flows. It should use the flexbox's wr
iting-mode, not the child's in order | 406 // FIXME: This is wrong for orthogonal flows. It should use the flexbox's wr
iting-mode, not the child's in order |
| 411 // to figure out the logical height/width. | 407 // to figure out the logical height/width. |
| 412 if (isColumnFlow()) { | 408 if (isColumnFlow()) { |
| 413 // We don't have to check for "auto" here - computeContentLogicalHeight
will just return -1 for that case anyway. | 409 // We don't have to check for "auto" here - computeContentLogicalHeight
will just return -1 for that case anyway. |
| 414 if (size.isIntrinsic()) | 410 if (size.isIntrinsic()) |
| 415 child->layoutIfNeeded(); | 411 child->layoutIfNeeded(); |
| 416 return child->computeContentLogicalHeight(size, child->logicalHeight() -
child->borderAndPaddingLogicalHeight()) + child->scrollbarLogicalHeight(); | 412 return child->computeContentLogicalHeight(size, child->logicalHeight() -
child->borderAndPaddingLogicalHeight()); |
| 417 } | 413 } |
| 418 return child->computeLogicalWidthUsing(sizeType, size, contentLogicalWidth()
, this) - child->borderAndPaddingLogicalWidth(); | 414 return child->computeLogicalWidthUsing(sizeType, size, contentLogicalWidth()
, this) - child->borderAndPaddingLogicalWidth(); |
| 419 } | 415 } |
| 420 | 416 |
| 421 LayoutUnit RenderFlexibleBox::flowAwareBorderStart() const | 417 LayoutUnit RenderFlexibleBox::flowAwareBorderStart() const |
| 422 { | 418 { |
| 423 if (isHorizontalFlow()) | 419 if (isHorizontalFlow()) |
| 424 return isLeftToRightFlow() ? borderLeft() : borderRight(); | 420 return isLeftToRightFlow() ? borderLeft() : borderRight(); |
| 425 return isLeftToRightFlow() ? borderTop() : borderBottom(); | 421 return isLeftToRightFlow() ? borderTop() : borderBottom(); |
| 426 } | 422 } |
| (...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 488 { | 484 { |
| 489 // FIXME(sky): Remove | 485 // FIXME(sky): Remove |
| 490 return marginTop(); | 486 return marginTop(); |
| 491 } | 487 } |
| 492 | 488 |
| 493 LayoutUnit RenderFlexibleBox::crossAxisMarginExtentForChild(RenderBox* child) co
nst | 489 LayoutUnit RenderFlexibleBox::crossAxisMarginExtentForChild(RenderBox* child) co
nst |
| 494 { | 490 { |
| 495 return isHorizontalFlow() ? child->marginHeight() : child->marginWidth(); | 491 return isHorizontalFlow() ? child->marginHeight() : child->marginWidth(); |
| 496 } | 492 } |
| 497 | 493 |
| 498 LayoutUnit RenderFlexibleBox::crossAxisScrollbarExtent() const | |
| 499 { | |
| 500 return isHorizontalFlow() ? horizontalScrollbarHeight() : verticalScrollbarW
idth(); | |
| 501 } | |
| 502 | |
| 503 LayoutUnit RenderFlexibleBox::crossAxisScrollbarExtentForChild(RenderBox* child)
const | |
| 504 { | |
| 505 return isHorizontalFlow() ? child->horizontalScrollbarHeight() : child->vert
icalScrollbarWidth(); | |
| 506 } | |
| 507 | |
| 508 LayoutPoint RenderFlexibleBox::flowAwareLocationForChild(RenderBox* child) const | 494 LayoutPoint RenderFlexibleBox::flowAwareLocationForChild(RenderBox* child) const |
| 509 { | 495 { |
| 510 return isHorizontalFlow() ? child->location() : child->location().transposed
Point(); | 496 return isHorizontalFlow() ? child->location() : child->location().transposed
Point(); |
| 511 } | 497 } |
| 512 | 498 |
| 513 void RenderFlexibleBox::setFlowAwareLocationForChild(RenderBox* child, const Lay
outPoint& location) | 499 void RenderFlexibleBox::setFlowAwareLocationForChild(RenderBox* child, const Lay
outPoint& location) |
| 514 { | 500 { |
| 515 if (isHorizontalFlow()) | 501 if (isHorizontalFlow()) |
| 516 child->setLocation(location); | 502 child->setLocation(location); |
| 517 else | 503 else |
| (...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 586 } | 572 } |
| 587 | 573 |
| 588 layoutAndPlaceChildren(crossAxisOffset, orderedChildren, childSizes, ava
ilableFreeSpace, relayoutChildren, lineContexts, hasInfiniteLineLength); | 574 layoutAndPlaceChildren(crossAxisOffset, orderedChildren, childSizes, ava
ilableFreeSpace, relayoutChildren, lineContexts, hasInfiniteLineLength); |
| 589 } | 575 } |
| 590 if (hasLineIfEmpty()) { | 576 if (hasLineIfEmpty()) { |
| 591 // Even if computeNextFlexLine returns true, the flexbox might not have | 577 // Even if computeNextFlexLine returns true, the flexbox might not have |
| 592 // a line because all our children might be out of flow positioned. | 578 // a line because all our children might be out of flow positioned. |
| 593 // Instead of just checking if we have a line, make sure the flexbox | 579 // Instead of just checking if we have a line, make sure the flexbox |
| 594 // has at least a line's worth of height to cover this case. | 580 // has at least a line's worth of height to cover this case. |
| 595 LayoutUnit minHeight = borderAndPaddingLogicalHeight() | 581 LayoutUnit minHeight = borderAndPaddingLogicalHeight() |
| 596 + lineHeight(true, HorizontalLine, PositionOfInteriorLineBoxes) | 582 + lineHeight(true, HorizontalLine, PositionOfInteriorLineBoxes); |
| 597 + scrollbarLogicalHeight(); | |
| 598 if (height() < minHeight) | 583 if (height() < minHeight) |
| 599 setLogicalHeight(minHeight); | 584 setLogicalHeight(minHeight); |
| 600 } | 585 } |
| 601 | 586 |
| 602 updateLogicalHeight(); | 587 updateLogicalHeight(); |
| 603 repositionLogicalHeightDependentFlexItems(lineContexts); | 588 repositionLogicalHeightDependentFlexItems(lineContexts); |
| 604 } | 589 } |
| 605 | 590 |
| 606 LayoutUnit RenderFlexibleBox::autoMarginOffsetInMainAxis(const OrderedFlexItemLi
st& children, LayoutUnit& availableFreeSpace) | 591 LayoutUnit RenderFlexibleBox::autoMarginOffsetInMainAxis(const OrderedFlexItemLi
st& children, LayoutUnit& availableFreeSpace) |
| 607 { | 592 { |
| (...skipping 377 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 985 } | 970 } |
| 986 | 971 |
| 987 void RenderFlexibleBox::layoutAndPlaceChildren(LayoutUnit& crossAxisOffset, cons
t OrderedFlexItemList& children, const Vector<LayoutUnit, 16>& childSizes, Layou
tUnit availableFreeSpace, bool relayoutChildren, Vector<LineContext>& lineContex
ts, bool hasInfiniteLineLength) | 972 void RenderFlexibleBox::layoutAndPlaceChildren(LayoutUnit& crossAxisOffset, cons
t OrderedFlexItemList& children, const Vector<LayoutUnit, 16>& childSizes, Layou
tUnit availableFreeSpace, bool relayoutChildren, Vector<LineContext>& lineContex
ts, bool hasInfiniteLineLength) |
| 988 { | 973 { |
| 989 ASSERT(childSizes.size() == children.size()); | 974 ASSERT(childSizes.size() == children.size()); |
| 990 | 975 |
| 991 size_t numberOfChildrenForJustifyContent = numberOfInFlowPositionedChildren(
children); | 976 size_t numberOfChildrenForJustifyContent = numberOfInFlowPositionedChildren(
children); |
| 992 LayoutUnit autoMarginOffset = autoMarginOffsetInMainAxis(children, available
FreeSpace); | 977 LayoutUnit autoMarginOffset = autoMarginOffsetInMainAxis(children, available
FreeSpace); |
| 993 LayoutUnit mainAxisOffset = flowAwareBorderStart() + flowAwarePaddingStart()
; | 978 LayoutUnit mainAxisOffset = flowAwareBorderStart() + flowAwarePaddingStart()
; |
| 994 mainAxisOffset += initialJustifyContentOffset(availableFreeSpace, style()->j
ustifyContent(), numberOfChildrenForJustifyContent); | 979 mainAxisOffset += initialJustifyContentOffset(availableFreeSpace, style()->j
ustifyContent(), numberOfChildrenForJustifyContent); |
| 995 if (style()->flexDirection() == FlowRowReverse) | |
| 996 mainAxisOffset += isHorizontalFlow() ? verticalScrollbarWidth() : horizo
ntalScrollbarHeight(); | |
| 997 | 980 |
| 998 LayoutUnit totalMainExtent = mainAxisExtent(); | 981 LayoutUnit totalMainExtent = mainAxisExtent(); |
| 999 LayoutUnit maxAscent = 0, maxDescent = 0; // Used when align-items: baseline
. | 982 LayoutUnit maxAscent = 0, maxDescent = 0; // Used when align-items: baseline
. |
| 1000 LayoutUnit maxChildCrossAxisExtent = 0; | 983 LayoutUnit maxChildCrossAxisExtent = 0; |
| 1001 size_t seenInFlowPositionedChildren = 0; | 984 size_t seenInFlowPositionedChildren = 0; |
| 1002 bool shouldFlipMainAxis = !isColumnFlow() && !isLeftToRightFlow(); | 985 bool shouldFlipMainAxis = !isColumnFlow() && !isLeftToRightFlow(); |
| 1003 for (size_t i = 0; i < children.size(); ++i) { | 986 for (size_t i = 0; i < children.size(); ++i) { |
| 1004 RenderBox* child = children[i]; | 987 RenderBox* child = children[i]; |
| 1005 | 988 |
| 1006 if (child->isOutOfFlowPositioned()) { | 989 if (child->isOutOfFlowPositioned()) { |
| (...skipping 22 matching lines...) Expand all Loading... |
| 1029 LayoutUnit childCrossAxisMarginBoxExtent; | 1012 LayoutUnit childCrossAxisMarginBoxExtent; |
| 1030 if (alignmentForChild(child) == ItemPositionBaseline && !hasAutoMarginsI
nCrossAxis(child)) { | 1013 if (alignmentForChild(child) == ItemPositionBaseline && !hasAutoMarginsI
nCrossAxis(child)) { |
| 1031 LayoutUnit ascent = marginBoxAscentForChild(child); | 1014 LayoutUnit ascent = marginBoxAscentForChild(child); |
| 1032 LayoutUnit descent = (crossAxisMarginExtentForChild(child) + crossAx
isExtentForChild(child)) - ascent; | 1015 LayoutUnit descent = (crossAxisMarginExtentForChild(child) + crossAx
isExtentForChild(child)) - ascent; |
| 1033 | 1016 |
| 1034 maxAscent = std::max(maxAscent, ascent); | 1017 maxAscent = std::max(maxAscent, ascent); |
| 1035 maxDescent = std::max(maxDescent, descent); | 1018 maxDescent = std::max(maxDescent, descent); |
| 1036 | 1019 |
| 1037 childCrossAxisMarginBoxExtent = maxAscent + maxDescent; | 1020 childCrossAxisMarginBoxExtent = maxAscent + maxDescent; |
| 1038 } else { | 1021 } else { |
| 1039 childCrossAxisMarginBoxExtent = crossAxisIntrinsicExtentForChild(chi
ld) + crossAxisMarginExtentForChild(child) + crossAxisScrollbarExtentForChild(ch
ild); | 1022 childCrossAxisMarginBoxExtent = crossAxisIntrinsicExtentForChild(chi
ld) + crossAxisMarginExtentForChild(child); |
| 1040 } | 1023 } |
| 1041 if (!isColumnFlow()) | 1024 if (!isColumnFlow()) |
| 1042 setLogicalHeight(std::max(logicalHeight(), crossAxisOffset + flowAwa
reBorderAfter() + flowAwarePaddingAfter() + childCrossAxisMarginBoxExtent + cros
sAxisScrollbarExtent())); | 1025 setLogicalHeight(std::max(logicalHeight(), crossAxisOffset + flowAwa
reBorderAfter() + flowAwarePaddingAfter() + childCrossAxisMarginBoxExtent)); |
| 1043 maxChildCrossAxisExtent = std::max(maxChildCrossAxisExtent, childCrossAx
isMarginBoxExtent); | 1026 maxChildCrossAxisExtent = std::max(maxChildCrossAxisExtent, childCrossAx
isMarginBoxExtent); |
| 1044 | 1027 |
| 1045 mainAxisOffset += flowAwareMarginStartForChild(child); | 1028 mainAxisOffset += flowAwareMarginStartForChild(child); |
| 1046 | 1029 |
| 1047 LayoutUnit childMainExtent = mainAxisExtentForChild(child); | 1030 LayoutUnit childMainExtent = mainAxisExtentForChild(child); |
| 1048 // In an RTL column situation, this will apply the margin-right/margin-e
nd on the left. | 1031 // In an RTL column situation, this will apply the margin-right/margin-e
nd on the left. |
| 1049 // This will be fixed later in flipForRightToLeftColumn. | 1032 // This will be fixed later in flipForRightToLeftColumn. |
| 1050 LayoutPoint childLocation(shouldFlipMainAxis ? totalMainExtent - mainAxi
sOffset - childMainExtent : mainAxisOffset, | 1033 LayoutPoint childLocation(shouldFlipMainAxis ? totalMainExtent - mainAxi
sOffset - childMainExtent : mainAxisOffset, |
| 1051 crossAxisOffset + flowAwareMarginBeforeForChild(child)); | 1034 crossAxisOffset + flowAwareMarginBeforeForChild(child)); |
| 1052 | 1035 |
| 1053 // FIXME: Supporting layout deltas. | 1036 // FIXME: Supporting layout deltas. |
| 1054 setFlowAwareLocationForChild(child, childLocation); | 1037 setFlowAwareLocationForChild(child, childLocation); |
| 1055 mainAxisOffset += childMainExtent + flowAwareMarginEndForChild(child); | 1038 mainAxisOffset += childMainExtent + flowAwareMarginEndForChild(child); |
| 1056 | 1039 |
| 1057 ++seenInFlowPositionedChildren; | 1040 ++seenInFlowPositionedChildren; |
| 1058 if (seenInFlowPositionedChildren < numberOfChildrenForJustifyContent) | 1041 if (seenInFlowPositionedChildren < numberOfChildrenForJustifyContent) |
| 1059 mainAxisOffset += justifyContentSpaceBetweenChildren(availableFreeSp
ace, style()->justifyContent(), numberOfChildrenForJustifyContent); | 1042 mainAxisOffset += justifyContentSpaceBetweenChildren(availableFreeSp
ace, style()->justifyContent(), numberOfChildrenForJustifyContent); |
| 1060 } | 1043 } |
| 1061 | 1044 |
| 1062 if (isColumnFlow()) | 1045 if (isColumnFlow()) |
| 1063 setLogicalHeight(mainAxisOffset + flowAwareBorderEnd() + flowAwarePaddin
gEnd() + scrollbarLogicalHeight()); | 1046 setLogicalHeight(mainAxisOffset + flowAwareBorderEnd() + flowAwarePaddin
gEnd()); |
| 1064 | 1047 |
| 1065 if (style()->flexDirection() == FlowColumnReverse) { | 1048 if (style()->flexDirection() == FlowColumnReverse) { |
| 1066 // We have to do an extra pass for column-reverse to reposition the flex
items since the start depends | 1049 // We have to do an extra pass for column-reverse to reposition the flex
items since the start depends |
| 1067 // on the height of the flexbox, which we only know after we've position
ed all the flex items. | 1050 // on the height of the flexbox, which we only know after we've position
ed all the flex items. |
| 1068 updateLogicalHeight(); | 1051 updateLogicalHeight(); |
| 1069 layoutColumnReverse(children, crossAxisOffset, availableFreeSpace); | 1052 layoutColumnReverse(children, crossAxisOffset, availableFreeSpace); |
| 1070 } | 1053 } |
| 1071 | 1054 |
| 1072 if (m_numberOfInFlowChildrenOnFirstLine == -1) | 1055 if (m_numberOfInFlowChildrenOnFirstLine == -1) |
| 1073 m_numberOfInFlowChildrenOnFirstLine = seenInFlowPositionedChildren; | 1056 m_numberOfInFlowChildrenOnFirstLine = seenInFlowPositionedChildren; |
| 1074 lineContexts.append(LineContext(crossAxisOffset, maxChildCrossAxisExtent, ch
ildren.size(), maxAscent)); | 1057 lineContexts.append(LineContext(crossAxisOffset, maxChildCrossAxisExtent, ch
ildren.size(), maxAscent)); |
| 1075 crossAxisOffset += maxChildCrossAxisExtent; | 1058 crossAxisOffset += maxChildCrossAxisExtent; |
| 1076 } | 1059 } |
| 1077 | 1060 |
| 1078 void RenderFlexibleBox::layoutColumnReverse(const OrderedFlexItemList& children,
LayoutUnit crossAxisOffset, LayoutUnit availableFreeSpace) | 1061 void RenderFlexibleBox::layoutColumnReverse(const OrderedFlexItemList& children,
LayoutUnit crossAxisOffset, LayoutUnit availableFreeSpace) |
| 1079 { | 1062 { |
| 1080 // This is similar to the logic in layoutAndPlaceChildren, except we place t
he children | 1063 // This is similar to the logic in layoutAndPlaceChildren, except we place t
he children |
| 1081 // starting from the end of the flexbox. We also don't need to layout anythi
ng since we're | 1064 // starting from the end of the flexbox. We also don't need to layout anythi
ng since we're |
| 1082 // just moving the children to a new position. | 1065 // just moving the children to a new position. |
| 1083 size_t numberOfChildrenForJustifyContent = numberOfInFlowPositionedChildren(
children); | 1066 size_t numberOfChildrenForJustifyContent = numberOfInFlowPositionedChildren(
children); |
| 1084 LayoutUnit mainAxisOffset = logicalHeight() - flowAwareBorderEnd() - flowAwa
rePaddingEnd(); | 1067 LayoutUnit mainAxisOffset = logicalHeight() - flowAwareBorderEnd() - flowAwa
rePaddingEnd(); |
| 1085 mainAxisOffset -= initialJustifyContentOffset(availableFreeSpace, style()->j
ustifyContent(), numberOfChildrenForJustifyContent); | 1068 mainAxisOffset -= initialJustifyContentOffset(availableFreeSpace, style()->j
ustifyContent(), numberOfChildrenForJustifyContent); |
| 1086 mainAxisOffset -= isHorizontalFlow() ? verticalScrollbarWidth() : horizontal
ScrollbarHeight(); | |
| 1087 | 1069 |
| 1088 size_t seenInFlowPositionedChildren = 0; | 1070 size_t seenInFlowPositionedChildren = 0; |
| 1089 for (size_t i = 0; i < children.size(); ++i) { | 1071 for (size_t i = 0; i < children.size(); ++i) { |
| 1090 RenderBox* child = children[i]; | 1072 RenderBox* child = children[i]; |
| 1091 | 1073 |
| 1092 if (child->isOutOfFlowPositioned()) { | 1074 if (child->isOutOfFlowPositioned()) { |
| 1093 child->layer()->setStaticBlockPosition(mainAxisOffset); | 1075 child->layer()->setStaticBlockPosition(mainAxisOffset); |
| 1094 continue; | 1076 continue; |
| 1095 } | 1077 } |
| 1096 mainAxisOffset -= mainAxisExtentForChild(child) + flowAwareMarginEndForC
hild(child); | 1078 mainAxisOffset -= mainAxisExtentForChild(child) + flowAwareMarginEndForC
hild(child); |
| (...skipping 223 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1320 ASSERT(child); | 1302 ASSERT(child); |
| 1321 LayoutUnit lineCrossAxisExtent = lineContexts[lineNumber].crossAxisE
xtent; | 1303 LayoutUnit lineCrossAxisExtent = lineContexts[lineNumber].crossAxisE
xtent; |
| 1322 LayoutUnit originalOffset = lineContexts[lineNumber].crossAxisOffset
- crossAxisStartEdge; | 1304 LayoutUnit originalOffset = lineContexts[lineNumber].crossAxisOffset
- crossAxisStartEdge; |
| 1323 LayoutUnit newOffset = contentExtent - originalOffset - lineCrossAxi
sExtent; | 1305 LayoutUnit newOffset = contentExtent - originalOffset - lineCrossAxi
sExtent; |
| 1324 adjustAlignmentForChild(child, newOffset - originalOffset); | 1306 adjustAlignmentForChild(child, newOffset - originalOffset); |
| 1325 } | 1307 } |
| 1326 } | 1308 } |
| 1327 } | 1309 } |
| 1328 | 1310 |
| 1329 } | 1311 } |
| OLD | NEW |