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 1079 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1090 childSize = maxExtent; | 1090 childSize = maxExtent; |
1091 } | 1091 } |
1092 | 1092 |
1093 Length min = isHorizontalFlow() ? child.style()->minWidth() : child.style()-
>minHeight(); | 1093 Length min = isHorizontalFlow() ? child.style()->minWidth() : child.style()-
>minHeight(); |
1094 LayoutUnit minExtent; | 1094 LayoutUnit minExtent; |
1095 if (min.isSpecifiedOrIntrinsic()) { | 1095 if (min.isSpecifiedOrIntrinsic()) { |
1096 minExtent = computeMainAxisExtentForChild(child, MinSize, min); | 1096 minExtent = computeMainAxisExtentForChild(child, MinSize, min); |
1097 // computeMainAxisExtentForChild can return -1 when the child has a perc
entage | 1097 // computeMainAxisExtentForChild can return -1 when the child has a perc
entage |
1098 // min size, but we have an indefinite size in that axis. | 1098 // min size, but we have an indefinite size in that axis. |
1099 minExtent = std::max(LayoutUnit(), minExtent); | 1099 minExtent = std::max(LayoutUnit(), minExtent); |
1100 } else if (min.isAuto() && mainAxisOverflowForChild(child) == OverflowVisibl
e && !(isColumnFlow() && child.isFlexibleBox())) { | 1100 } else if (min.isAuto() && mainAxisOverflowForChild(child) == OverflowVisibl
e) { |
1101 // TODO(cbiesinger): For now, we do not handle min-height: auto for nest
ed column flexboxes. We need | |
1102 // to implement https://drafts.csswg.org/css-flexbox/#intrinsic-sizes be
fore that produces | |
1103 // reasonable results. Tracking bug: https://crbug.com/581553 | |
1104 // css-flexbox section 4.5 | |
1105 LayoutUnit contentSize = computeMainAxisExtentForChild(child, MinSize, L
ength(MinContent)); | 1101 LayoutUnit contentSize = computeMainAxisExtentForChild(child, MinSize, L
ength(MinContent)); |
1106 ASSERT(contentSize >= 0); | 1102 ASSERT(contentSize >= 0); |
1107 if (hasAspectRatio(child) && child.intrinsicSize().height() > 0) | 1103 if (hasAspectRatio(child) && child.intrinsicSize().height() > 0) |
1108 contentSize = adjustChildSizeForAspectRatioCrossAxisMinAndMax(child,
contentSize); | 1104 contentSize = adjustChildSizeForAspectRatioCrossAxisMinAndMax(child,
contentSize); |
1109 if (maxExtent != -1 && contentSize > maxExtent) | 1105 if (maxExtent != -1 && contentSize > maxExtent) |
1110 contentSize = maxExtent; | 1106 contentSize = maxExtent; |
1111 | 1107 |
1112 Length mainSize = isHorizontalFlow() ? child.styleRef().width() : child.
styleRef().height(); | 1108 Length mainSize = isHorizontalFlow() ? child.styleRef().width() : child.
styleRef().height(); |
1113 if (mainAxisLengthIsDefinite(child, mainSize)) { | 1109 if (mainAxisLengthIsDefinite(child, mainSize)) { |
1114 LayoutUnit resolvedMainSize = computeMainAxisExtentForChild(child, M
ainOrPreferredSize, mainSize); | 1110 LayoutUnit resolvedMainSize = computeMainAxisExtentForChild(child, M
ainOrPreferredSize, mainSize); |
(...skipping 787 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1902 ASSERT(child); | 1898 ASSERT(child); |
1903 LayoutUnit lineCrossAxisExtent = lineContexts[lineNumber].crossAxisE
xtent; | 1899 LayoutUnit lineCrossAxisExtent = lineContexts[lineNumber].crossAxisE
xtent; |
1904 LayoutUnit originalOffset = lineContexts[lineNumber].crossAxisOffset
- crossAxisStartEdge; | 1900 LayoutUnit originalOffset = lineContexts[lineNumber].crossAxisOffset
- crossAxisStartEdge; |
1905 LayoutUnit newOffset = contentExtent - originalOffset - lineCrossAxi
sExtent; | 1901 LayoutUnit newOffset = contentExtent - originalOffset - lineCrossAxi
sExtent; |
1906 adjustAlignmentForChild(*child, newOffset - originalOffset); | 1902 adjustAlignmentForChild(*child, newOffset - originalOffset); |
1907 } | 1903 } |
1908 } | 1904 } |
1909 } | 1905 } |
1910 | 1906 |
1911 } // namespace blink | 1907 } // namespace blink |
OLD | NEW |