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 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
128 LayoutUnit scrollbarWidth = instrinsicScrollbarLogicalWidth(); | 128 LayoutUnit scrollbarWidth = instrinsicScrollbarLogicalWidth(); |
129 maxLogicalWidth += scrollbarWidth; | 129 maxLogicalWidth += scrollbarWidth; |
130 minLogicalWidth += scrollbarWidth; | 130 minLogicalWidth += scrollbarWidth; |
131 } | 131 } |
132 | 132 |
133 static int synthesizedBaselineFromContentBox(const RenderBox* box, LineDirection
Mode direction) | 133 static int synthesizedBaselineFromContentBox(const RenderBox* box, LineDirection
Mode direction) |
134 { | 134 { |
135 return direction == HorizontalLine ? box->borderTop() + box->paddingTop() +
box->contentHeight() : box->borderRight() + box->paddingRight() + box->contentWi
dth(); | 135 return direction == HorizontalLine ? box->borderTop() + box->paddingTop() +
box->contentHeight() : box->borderRight() + box->paddingRight() + box->contentWi
dth(); |
136 } | 136 } |
137 | 137 |
138 int RenderFlexibleBox::baselinePosition(FontBaseline, bool, LineDirectionMode di
rection, LinePositionMode mode) const | 138 int RenderFlexibleBox::baselinePosition(FontBaseline, OwnOrFirstLineStyle, LineD
irectionMode direction, LinePositionMode mode) const |
139 { | 139 { |
140 ASSERT(mode == PositionOnContainingLine); | 140 ASSERT(mode == PositionOnContainingLine); |
141 int baseline = firstLineBoxBaseline(); | 141 int baseline = firstLineBoxBaseline(); |
142 if (baseline == -1) | 142 if (baseline == -1) |
143 baseline = synthesizedBaselineFromContentBox(this, direction); | 143 baseline = synthesizedBaselineFromContentBox(this, direction); |
144 | 144 |
145 return beforeMarginInLineDirection(direction) + baseline; | 145 return beforeMarginInLineDirection(direction) + baseline; |
146 } | 146 } |
147 | 147 |
148 int RenderFlexibleBox::firstLineBoxBaseline() const | 148 int RenderFlexibleBox::firstLineBoxBaseline() const |
(...skipping 509 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
658 } | 658 } |
659 | 659 |
660 layoutAndPlaceChildren(crossAxisOffset, orderedChildren, childSizes, ava
ilableFreeSpace, relayoutChildren, lineContexts, hasInfiniteLineLength); | 660 layoutAndPlaceChildren(crossAxisOffset, orderedChildren, childSizes, ava
ilableFreeSpace, relayoutChildren, lineContexts, hasInfiniteLineLength); |
661 } | 661 } |
662 if (hasLineIfEmpty()) { | 662 if (hasLineIfEmpty()) { |
663 // Even if computeNextFlexLine returns true, the flexbox might not have | 663 // Even if computeNextFlexLine returns true, the flexbox might not have |
664 // a line because all our children might be out of flow positioned. | 664 // a line because all our children might be out of flow positioned. |
665 // Instead of just checking if we have a line, make sure the flexbox | 665 // Instead of just checking if we have a line, make sure the flexbox |
666 // has at least a line's worth of height to cover this case. | 666 // has at least a line's worth of height to cover this case. |
667 LayoutUnit minHeight = borderAndPaddingLogicalHeight() | 667 LayoutUnit minHeight = borderAndPaddingLogicalHeight() |
668 + lineHeight(true, isHorizontalWritingMode() ? HorizontalLine : Vert
icalLine, PositionOfInteriorLineBoxes) | 668 + lineHeight(FirstLineStyle, isHorizontalWritingMode() ? HorizontalL
ine : VerticalLine, PositionOfInteriorLineBoxes) |
669 + scrollbarLogicalHeight(); | 669 + scrollbarLogicalHeight(); |
670 if (height() < minHeight) | 670 if (height() < minHeight) |
671 setLogicalHeight(minHeight); | 671 setLogicalHeight(minHeight); |
672 } | 672 } |
673 | 673 |
674 updateLogicalHeight(); | 674 updateLogicalHeight(); |
675 repositionLogicalHeightDependentFlexItems(lineContexts); | 675 repositionLogicalHeightDependentFlexItems(lineContexts); |
676 } | 676 } |
677 | 677 |
678 LayoutUnit RenderFlexibleBox::autoMarginOffsetInMainAxis(const OrderedFlexItemLi
st& children, LayoutUnit& availableFreeSpace) | 678 LayoutUnit RenderFlexibleBox::autoMarginOffsetInMainAxis(const OrderedFlexItemLi
st& children, LayoutUnit& availableFreeSpace) |
(...skipping 718 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1397 ASSERT(child); | 1397 ASSERT(child); |
1398 LayoutUnit lineCrossAxisExtent = lineContexts[lineNumber].crossAxisE
xtent; | 1398 LayoutUnit lineCrossAxisExtent = lineContexts[lineNumber].crossAxisE
xtent; |
1399 LayoutUnit originalOffset = lineContexts[lineNumber].crossAxisOffset
- crossAxisStartEdge; | 1399 LayoutUnit originalOffset = lineContexts[lineNumber].crossAxisOffset
- crossAxisStartEdge; |
1400 LayoutUnit newOffset = contentExtent - originalOffset - lineCrossAxi
sExtent; | 1400 LayoutUnit newOffset = contentExtent - originalOffset - lineCrossAxi
sExtent; |
1401 adjustAlignmentForChild(child, newOffset - originalOffset); | 1401 adjustAlignmentForChild(child, newOffset - originalOffset); |
1402 } | 1402 } |
1403 } | 1403 } |
1404 } | 1404 } |
1405 | 1405 |
1406 } | 1406 } |
OLD | NEW |