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 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
102 // See https://bugs.webkit.org/show_bug.cgi?id=116117 and http://crbug.com/2
40765. | 102 // See https://bugs.webkit.org/show_bug.cgi?id=116117 and http://crbug.com/2
40765. |
103 float previousMaxContentFlexFraction = -1; | 103 float previousMaxContentFlexFraction = -1; |
104 for (LayoutBox* child = firstChildBox(); child; child = child->nextSiblingBo
x()) { | 104 for (LayoutBox* child = firstChildBox(); child; child = child->nextSiblingBo
x()) { |
105 if (child->isOutOfFlowPositioned()) | 105 if (child->isOutOfFlowPositioned()) |
106 continue; | 106 continue; |
107 | 107 |
108 LayoutUnit margin = marginIntrinsicLogicalWidthForChild(*child); | 108 LayoutUnit margin = marginIntrinsicLogicalWidthForChild(*child); |
109 | 109 |
110 LayoutUnit minPreferredLogicalWidth; | 110 LayoutUnit minPreferredLogicalWidth; |
111 LayoutUnit maxPreferredLogicalWidth; | 111 LayoutUnit maxPreferredLogicalWidth; |
112 bool hasOrthogonalWritingMode = child->isHorizontalWritingMode() != isHo
rizontalWritingMode(); | 112 computeChildPreferredLogicalWidths(*child, minPreferredLogicalWidth, max
PreferredLogicalWidth); |
113 if (hasOrthogonalWritingMode) { | |
114 minPreferredLogicalWidth = maxPreferredLogicalWidth = child->compute
LogicalHeightWithoutLayout(); | |
115 } else { | |
116 minPreferredLogicalWidth = child->minPreferredLogicalWidth(); | |
117 maxPreferredLogicalWidth = child->maxPreferredLogicalWidth(); | |
118 } | |
119 ASSERT(minPreferredLogicalWidth >= 0); | 113 ASSERT(minPreferredLogicalWidth >= 0); |
120 ASSERT(maxPreferredLogicalWidth >= 0); | 114 ASSERT(maxPreferredLogicalWidth >= 0); |
121 minPreferredLogicalWidth += margin; | 115 minPreferredLogicalWidth += margin; |
122 maxPreferredLogicalWidth += margin; | 116 maxPreferredLogicalWidth += margin; |
123 if (!isColumnFlow()) { | 117 if (!isColumnFlow()) { |
124 maxLogicalWidth += maxPreferredLogicalWidth; | 118 maxLogicalWidth += maxPreferredLogicalWidth; |
125 if (isMultiline()) { | 119 if (isMultiline()) { |
126 // For multiline, the min preferred width is if you put a break
between each item. | 120 // For multiline, the min preferred width is if you put a break
between each item. |
127 minLogicalWidth = std::max(minLogicalWidth, minPreferredLogicalW
idth); | 121 minLogicalWidth = std::max(minLogicalWidth, minPreferredLogicalW
idth); |
128 } else { | 122 } else { |
(...skipping 1500 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1629 ASSERT(child); | 1623 ASSERT(child); |
1630 LayoutUnit lineCrossAxisExtent = lineContexts[lineNumber].crossAxisE
xtent; | 1624 LayoutUnit lineCrossAxisExtent = lineContexts[lineNumber].crossAxisE
xtent; |
1631 LayoutUnit originalOffset = lineContexts[lineNumber].crossAxisOffset
- crossAxisStartEdge; | 1625 LayoutUnit originalOffset = lineContexts[lineNumber].crossAxisOffset
- crossAxisStartEdge; |
1632 LayoutUnit newOffset = contentExtent - originalOffset - lineCrossAxi
sExtent; | 1626 LayoutUnit newOffset = contentExtent - originalOffset - lineCrossAxi
sExtent; |
1633 adjustAlignmentForChild(*child, newOffset - originalOffset); | 1627 adjustAlignmentForChild(*child, newOffset - originalOffset); |
1634 } | 1628 } |
1635 } | 1629 } |
1636 } | 1630 } |
1637 | 1631 |
1638 } // namespace blink | 1632 } // namespace blink |
OLD | NEW |