| 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 559 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 570 LayoutUnit RenderFlexibleBox::crossAxisMarginExtentForChild(RenderBox* child) co
nst | 570 LayoutUnit RenderFlexibleBox::crossAxisMarginExtentForChild(RenderBox* child) co
nst |
| 571 { | 571 { |
| 572 return isHorizontalFlow() ? child->marginHeight() : child->marginWidth(); | 572 return isHorizontalFlow() ? child->marginHeight() : child->marginWidth(); |
| 573 } | 573 } |
| 574 | 574 |
| 575 LayoutUnit RenderFlexibleBox::crossAxisScrollbarExtent() const | 575 LayoutUnit RenderFlexibleBox::crossAxisScrollbarExtent() const |
| 576 { | 576 { |
| 577 return isHorizontalFlow() ? horizontalScrollbarHeight() : verticalScrollbarW
idth(); | 577 return isHorizontalFlow() ? horizontalScrollbarHeight() : verticalScrollbarW
idth(); |
| 578 } | 578 } |
| 579 | 579 |
| 580 LayoutUnit RenderFlexibleBox::crossAxisScrollbarExtentForChild(RenderBox* child)
const |
| 581 { |
| 582 return isHorizontalFlow() ? child->horizontalScrollbarHeight() : child->vert
icalScrollbarWidth(); |
| 583 } |
| 584 |
| 580 LayoutPoint RenderFlexibleBox::flowAwareLocationForChild(RenderBox* child) const | 585 LayoutPoint RenderFlexibleBox::flowAwareLocationForChild(RenderBox* child) const |
| 581 { | 586 { |
| 582 return isHorizontalFlow() ? child->location() : child->location().transposed
Point(); | 587 return isHorizontalFlow() ? child->location() : child->location().transposed
Point(); |
| 583 } | 588 } |
| 584 | 589 |
| 585 void RenderFlexibleBox::setFlowAwareLocationForChild(RenderBox* child, const Lay
outPoint& location) | 590 void RenderFlexibleBox::setFlowAwareLocationForChild(RenderBox* child, const Lay
outPoint& location) |
| 586 { | 591 { |
| 587 if (isHorizontalFlow()) | 592 if (isHorizontalFlow()) |
| 588 child->setLocation(location); | 593 child->setLocation(location); |
| 589 else | 594 else |
| (...skipping 516 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1106 LayoutUnit childCrossAxisMarginBoxExtent; | 1111 LayoutUnit childCrossAxisMarginBoxExtent; |
| 1107 if (alignmentForChild(child) == ItemPositionBaseline && !hasAutoMarginsI
nCrossAxis(child)) { | 1112 if (alignmentForChild(child) == ItemPositionBaseline && !hasAutoMarginsI
nCrossAxis(child)) { |
| 1108 LayoutUnit ascent = marginBoxAscentForChild(child); | 1113 LayoutUnit ascent = marginBoxAscentForChild(child); |
| 1109 LayoutUnit descent = (crossAxisMarginExtentForChild(child) + crossAx
isExtentForChild(child)) - ascent; | 1114 LayoutUnit descent = (crossAxisMarginExtentForChild(child) + crossAx
isExtentForChild(child)) - ascent; |
| 1110 | 1115 |
| 1111 maxAscent = std::max(maxAscent, ascent); | 1116 maxAscent = std::max(maxAscent, ascent); |
| 1112 maxDescent = std::max(maxDescent, descent); | 1117 maxDescent = std::max(maxDescent, descent); |
| 1113 | 1118 |
| 1114 childCrossAxisMarginBoxExtent = maxAscent + maxDescent; | 1119 childCrossAxisMarginBoxExtent = maxAscent + maxDescent; |
| 1115 } else { | 1120 } else { |
| 1116 childCrossAxisMarginBoxExtent = crossAxisIntrinsicExtentForChild(chi
ld) + crossAxisMarginExtentForChild(child); | 1121 childCrossAxisMarginBoxExtent = crossAxisIntrinsicExtentForChild(chi
ld) + crossAxisMarginExtentForChild(child) + crossAxisScrollbarExtentForChild(ch
ild); |
| 1117 } | 1122 } |
| 1118 if (!isColumnFlow()) | 1123 if (!isColumnFlow()) |
| 1119 setLogicalHeight(std::max(logicalHeight(), crossAxisOffset + flowAwa
reBorderAfter() + flowAwarePaddingAfter() + childCrossAxisMarginBoxExtent + cros
sAxisScrollbarExtent())); | 1124 setLogicalHeight(std::max(logicalHeight(), crossAxisOffset + flowAwa
reBorderAfter() + flowAwarePaddingAfter() + childCrossAxisMarginBoxExtent + cros
sAxisScrollbarExtent())); |
| 1120 maxChildCrossAxisExtent = std::max(maxChildCrossAxisExtent, childCrossAx
isMarginBoxExtent); | 1125 maxChildCrossAxisExtent = std::max(maxChildCrossAxisExtent, childCrossAx
isMarginBoxExtent); |
| 1121 | 1126 |
| 1122 mainAxisOffset += flowAwareMarginStartForChild(child); | 1127 mainAxisOffset += flowAwareMarginStartForChild(child); |
| 1123 | 1128 |
| 1124 LayoutUnit childMainExtent = mainAxisExtentForChild(child); | 1129 LayoutUnit childMainExtent = mainAxisExtentForChild(child); |
| 1125 // In an RTL column situation, this will apply the margin-right/margin-e
nd on the left. | 1130 // In an RTL column situation, this will apply the margin-right/margin-e
nd on the left. |
| 1126 // This will be fixed later in flipForRightToLeftColumn. | 1131 // This will be fixed later in flipForRightToLeftColumn. |
| (...skipping 270 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1397 ASSERT(child); | 1402 ASSERT(child); |
| 1398 LayoutUnit lineCrossAxisExtent = lineContexts[lineNumber].crossAxisE
xtent; | 1403 LayoutUnit lineCrossAxisExtent = lineContexts[lineNumber].crossAxisE
xtent; |
| 1399 LayoutUnit originalOffset = lineContexts[lineNumber].crossAxisOffset
- crossAxisStartEdge; | 1404 LayoutUnit originalOffset = lineContexts[lineNumber].crossAxisOffset
- crossAxisStartEdge; |
| 1400 LayoutUnit newOffset = contentExtent - originalOffset - lineCrossAxi
sExtent; | 1405 LayoutUnit newOffset = contentExtent - originalOffset - lineCrossAxi
sExtent; |
| 1401 adjustAlignmentForChild(child, newOffset - originalOffset); | 1406 adjustAlignmentForChild(child, newOffset - originalOffset); |
| 1402 } | 1407 } |
| 1403 } | 1408 } |
| 1404 } | 1409 } |
| 1405 | 1410 |
| 1406 } | 1411 } |
| OLD | NEW |