| 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 1198 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1209 | 1209 |
| 1210 Length min = isHorizontalFlow() ? child.style()->minWidth() | 1210 Length min = isHorizontalFlow() ? child.style()->minWidth() |
| 1211 : child.style()->minHeight(); | 1211 : child.style()->minHeight(); |
| 1212 LayoutUnit minExtent; | 1212 LayoutUnit minExtent; |
| 1213 if (min.isSpecifiedOrIntrinsic()) { | 1213 if (min.isSpecifiedOrIntrinsic()) { |
| 1214 minExtent = computeMainAxisExtentForChild(child, MinSize, min); | 1214 minExtent = computeMainAxisExtentForChild(child, MinSize, min); |
| 1215 // computeMainAxisExtentForChild can return -1 when the child has a | 1215 // computeMainAxisExtentForChild can return -1 when the child has a |
| 1216 // percentage min size, but we have an indefinite size in that axis. | 1216 // percentage min size, but we have an indefinite size in that axis. |
| 1217 minExtent = std::max(LayoutUnit(), minExtent); | 1217 minExtent = std::max(LayoutUnit(), minExtent); |
| 1218 } else if (min.isAuto() && !child.styleRef().containsSize() && | 1218 } else if (min.isAuto() && !child.styleRef().containsSize() && |
| 1219 mainAxisOverflowForChild(child) == OverflowVisible && | 1219 mainAxisOverflowForChild(child) == EOverflow::Visible && |
| 1220 !(isColumnFlow() && child.isFlexibleBox())) { | 1220 !(isColumnFlow() && child.isFlexibleBox())) { |
| 1221 // TODO(cbiesinger): For now, we do not handle min-height: auto for nested | 1221 // TODO(cbiesinger): For now, we do not handle min-height: auto for nested |
| 1222 // column flexboxes. We need to implement | 1222 // column flexboxes. We need to implement |
| 1223 // https://drafts.csswg.org/css-flexbox/#intrinsic-sizes before that | 1223 // https://drafts.csswg.org/css-flexbox/#intrinsic-sizes before that |
| 1224 // produces reasonable results. Tracking bug: https://crbug.com/581553 | 1224 // produces reasonable results. Tracking bug: https://crbug.com/581553 |
| 1225 // css-flexbox section 4.5 | 1225 // css-flexbox section 4.5 |
| 1226 LayoutUnit contentSize = | 1226 LayoutUnit contentSize = |
| 1227 computeMainAxisExtentForChild(child, MinSize, Length(MinContent)); | 1227 computeMainAxisExtentForChild(child, MinSize, Length(MinContent)); |
| 1228 DCHECK_GE(contentSize, LayoutUnit()); | 1228 DCHECK_GE(contentSize, LayoutUnit()); |
| 1229 if (hasAspectRatio(child) && child.intrinsicSize().height() > 0) | 1229 if (hasAspectRatio(child) && child.intrinsicSize().height() > 0) |
| (...skipping 943 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2173 LayoutUnit originalOffset = | 2173 LayoutUnit originalOffset = |
| 2174 lineContexts[lineNumber].crossAxisOffset - crossAxisStartEdge; | 2174 lineContexts[lineNumber].crossAxisOffset - crossAxisStartEdge; |
| 2175 LayoutUnit newOffset = | 2175 LayoutUnit newOffset = |
| 2176 contentExtent - originalOffset - lineCrossAxisExtent; | 2176 contentExtent - originalOffset - lineCrossAxisExtent; |
| 2177 adjustAlignmentForChild(*flexItem.box, newOffset - originalOffset); | 2177 adjustAlignmentForChild(*flexItem.box, newOffset - originalOffset); |
| 2178 } | 2178 } |
| 2179 } | 2179 } |
| 2180 } | 2180 } |
| 2181 | 2181 |
| 2182 } // namespace blink | 2182 } // namespace blink |
| OLD | NEW |