Chromium Code Reviews| 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 458 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 469 // returning the max preferred height (=logical width) | 469 // returning the max preferred height (=logical width) |
| 470 if (!child.isHorizontalWritingMode() && child.styleRef().height().isAuto()) | 470 if (!child.isHorizontalWritingMode() && child.styleRef().height().isAuto()) |
| 471 return child.maxPreferredLogicalWidth(); | 471 return child.maxPreferredLogicalWidth(); |
| 472 return child.size().height(); | 472 return child.size().height(); |
| 473 } | 473 } |
| 474 | 474 |
| 475 LayoutUnit LayoutFlexibleBox::childIntrinsicWidth(const LayoutBox& child) const | 475 LayoutUnit LayoutFlexibleBox::childIntrinsicWidth(const LayoutBox& child) const |
| 476 { | 476 { |
| 477 if (!child.isHorizontalWritingMode() && needToStretchChildLogicalHeight(chil d)) | 477 if (!child.isHorizontalWritingMode() && needToStretchChildLogicalHeight(chil d)) |
| 478 return constrainedChildIntrinsicContentLogicalHeight(child); | 478 return constrainedChildIntrinsicContentLogicalHeight(child); |
| 479 // TOOO(cbiesinger): should this return the maxPreferredLogicalWidth? | 479 if (child.isHorizontalWritingMode() && child.styleRef().width().isAuto()) { |
| 480 // This value is already clamped by min/max-width | |
| 481 return child.maxPreferredLogicalWidth(); | |
| 482 } | |
| 480 return child.size().width(); | 483 return child.size().width(); |
| 481 } | 484 } |
| 482 | 485 |
| 483 LayoutUnit LayoutFlexibleBox::crossAxisIntrinsicExtentForChild(const LayoutBox& child) const | 486 LayoutUnit LayoutFlexibleBox::crossAxisIntrinsicExtentForChild(const LayoutBox& child) const |
| 484 { | 487 { |
| 485 return isHorizontalFlow() ? childIntrinsicHeight(child) : childIntrinsicWidt h(child); | 488 return isHorizontalFlow() ? childIntrinsicHeight(child) : childIntrinsicWidt h(child); |
| 486 } | 489 } |
| 487 | 490 |
| 488 LayoutUnit LayoutFlexibleBox::mainAxisExtentForChild(const LayoutBox& child) con st | 491 LayoutUnit LayoutFlexibleBox::mainAxisExtentForChild(const LayoutBox& child) con st |
| 489 { | 492 { |
| (...skipping 335 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 825 | 828 |
| 826 Length flexBasis = flexBasisForChild(child); | 829 Length flexBasis = flexBasisForChild(child); |
| 827 if (mainAxisLengthIsDefinite(child, flexBasis)) | 830 if (mainAxisLengthIsDefinite(child, flexBasis)) |
| 828 return std::max(LayoutUnit(), computeMainAxisExtentForChild(child, MainO rPreferredSize, flexBasis)); | 831 return std::max(LayoutUnit(), computeMainAxisExtentForChild(child, MainO rPreferredSize, flexBasis)); |
| 829 | 832 |
| 830 LayoutUnit mainAxisExtent; | 833 LayoutUnit mainAxisExtent; |
| 831 if (childFlexBaseSizeRequiresLayout(child)) { | 834 if (childFlexBaseSizeRequiresLayout(child)) { |
| 832 if (childLayoutType == NeverLayout) | 835 if (childLayoutType == NeverLayout) |
| 833 return LayoutUnit(); | 836 return LayoutUnit(); |
| 834 | 837 |
| 835 if (child.needsLayout() || childLayoutType == ForceLayout || !m_intrinsi cSizeAlongMainAxis.contains(&child)) { | 838 if (1 || child.needsLayout() || childLayoutType == ForceLayout || !m_int rinsicSizeAlongMainAxis.contains(&child)) { |
|
eae
2016/06/29 20:20:13
You probably forgot to remove this...
cbiesinger
2016/06/29 20:36:51
Yeah, included this entire file by accident :/
| |
| 836 child.forceChildLayout(); | 839 child.forceChildLayout(); |
| 837 cacheChildMainSize(child); | 840 cacheChildMainSize(child); |
| 838 } | 841 } |
| 839 mainAxisExtent = m_intrinsicSizeAlongMainAxis.get(&child); | 842 mainAxisExtent = m_intrinsicSizeAlongMainAxis.get(&child); |
| 840 } else { | 843 } else { |
| 841 // We don't need to add scrollbarLogicalWidth here. For overflow: scroll , the preferred width | 844 // We don't need to add scrollbarLogicalWidth here. For overflow: scroll , the preferred width |
| 842 // already includes the scrollbar size (via scrollbarLogicalWidth()). Fo r overflow: auto, | 845 // already includes the scrollbar size (via scrollbarLogicalWidth()). Fo r overflow: auto, |
| 843 // childFlexBaseSizeRequiresLayout returns true and we handle that via t he other branch | 846 // childFlexBaseSizeRequiresLayout returns true and we handle that via t he other branch |
| 844 // of this if. | 847 // of this if. |
| 845 mainAxisExtent = child.maxPreferredLogicalWidth(); | 848 mainAxisExtent = child.maxPreferredLogicalWidth(); |
| (...skipping 1036 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1882 ASSERT(child); | 1885 ASSERT(child); |
| 1883 LayoutUnit lineCrossAxisExtent = lineContexts[lineNumber].crossAxisE xtent; | 1886 LayoutUnit lineCrossAxisExtent = lineContexts[lineNumber].crossAxisE xtent; |
| 1884 LayoutUnit originalOffset = lineContexts[lineNumber].crossAxisOffset - crossAxisStartEdge; | 1887 LayoutUnit originalOffset = lineContexts[lineNumber].crossAxisOffset - crossAxisStartEdge; |
| 1885 LayoutUnit newOffset = contentExtent - originalOffset - lineCrossAxi sExtent; | 1888 LayoutUnit newOffset = contentExtent - originalOffset - lineCrossAxi sExtent; |
| 1886 adjustAlignmentForChild(*child, newOffset - originalOffset); | 1889 adjustAlignmentForChild(*child, newOffset - originalOffset); |
| 1887 } | 1890 } |
| 1888 } | 1891 } |
| 1889 } | 1892 } |
| 1890 | 1893 |
| 1891 } // namespace blink | 1894 } // namespace blink |
| OLD | NEW |