| 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 866 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 877 } else { | 877 } else { |
| 878 // The max preferred logical width includes the intrinsic scrollbar logical | 878 // The max preferred logical width includes the intrinsic scrollbar logical |
| 879 // width, which is only set for overflow: scroll. To handle overflow: auto, | 879 // width, which is only set for overflow: scroll. To handle overflow: auto, |
| 880 // we have to take scrollbarLogicalWidth() into account, and then subtract | 880 // we have to take scrollbarLogicalWidth() into account, and then subtract |
| 881 // the intrinsic width again so as to not double-count overflow: scroll | 881 // the intrinsic width again so as to not double-count overflow: scroll |
| 882 // scrollbars. | 882 // scrollbars. |
| 883 mainSize = child.maxPreferredLogicalWidth() + | 883 mainSize = child.maxPreferredLogicalWidth() + |
| 884 child.scrollbarLogicalWidth() - child.scrollbarLogicalWidth(); | 884 child.scrollbarLogicalWidth() - child.scrollbarLogicalWidth(); |
| 885 } | 885 } |
| 886 m_intrinsicSizeAlongMainAxis.set(&child, mainSize); | 886 m_intrinsicSizeAlongMainAxis.set(&child, mainSize); |
| 887 m_relaidOutChildren.add(&child); | 887 m_relaidOutChildren.insert(&child); |
| 888 } | 888 } |
| 889 | 889 |
| 890 void LayoutFlexibleBox::clearCachedMainSizeForChild(const LayoutBox& child) { | 890 void LayoutFlexibleBox::clearCachedMainSizeForChild(const LayoutBox& child) { |
| 891 m_intrinsicSizeAlongMainAxis.remove(&child); | 891 m_intrinsicSizeAlongMainAxis.remove(&child); |
| 892 } | 892 } |
| 893 | 893 |
| 894 DISABLE_CFI_PERF | 894 DISABLE_CFI_PERF |
| 895 LayoutUnit LayoutFlexibleBox::computeInnerFlexBaseSizeForChild( | 895 LayoutUnit LayoutFlexibleBox::computeInnerFlexBaseSizeForChild( |
| 896 LayoutBox& child, | 896 LayoutBox& child, |
| 897 LayoutUnit mainAxisBorderAndPadding, | 897 LayoutUnit mainAxisBorderAndPadding, |
| (...skipping 922 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1820 // Have to force another relayout even though the child is sized | 1820 // Have to force another relayout even though the child is sized |
| 1821 // correctly, because its descendants are not sized correctly yet. Our | 1821 // correctly, because its descendants are not sized correctly yet. Our |
| 1822 // previous layout of the child was done without an override height set. | 1822 // previous layout of the child was done without an override height set. |
| 1823 // So, redo it here. | 1823 // So, redo it here. |
| 1824 forceChildRelayout = true; | 1824 forceChildRelayout = true; |
| 1825 } | 1825 } |
| 1826 updateBlockChildDirtyBitsBeforeLayout(forceChildRelayout, *child); | 1826 updateBlockChildDirtyBitsBeforeLayout(forceChildRelayout, *child); |
| 1827 if (!child->needsLayout()) | 1827 if (!child->needsLayout()) |
| 1828 markChildForPaginationRelayoutIfNeeded(*child, layoutScope); | 1828 markChildForPaginationRelayoutIfNeeded(*child, layoutScope); |
| 1829 if (child->needsLayout()) | 1829 if (child->needsLayout()) |
| 1830 m_relaidOutChildren.add(child); | 1830 m_relaidOutChildren.insert(child); |
| 1831 child->layoutIfNeeded(); | 1831 child->layoutIfNeeded(); |
| 1832 | 1832 |
| 1833 updateAutoMarginsInMainAxis(*child, autoMarginOffset); | 1833 updateAutoMarginsInMainAxis(*child, autoMarginOffset); |
| 1834 | 1834 |
| 1835 LayoutUnit childCrossAxisMarginBoxExtent; | 1835 LayoutUnit childCrossAxisMarginBoxExtent; |
| 1836 if (alignmentForChild(*child) == ItemPositionBaseline && | 1836 if (alignmentForChild(*child) == ItemPositionBaseline && |
| 1837 !hasAutoMarginsInCrossAxis(*child)) { | 1837 !hasAutoMarginsInCrossAxis(*child)) { |
| 1838 LayoutUnit ascent = marginBoxAscentForChild(*child); | 1838 LayoutUnit ascent = marginBoxAscentForChild(*child); |
| 1839 LayoutUnit descent = (crossAxisMarginExtentForChild(*child) + | 1839 LayoutUnit descent = (crossAxisMarginExtentForChild(*child) + |
| 1840 crossAxisExtentForChild(*child)) - | 1840 crossAxisExtentForChild(*child)) - |
| (...skipping 342 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2183 LayoutUnit originalOffset = | 2183 LayoutUnit originalOffset = |
| 2184 lineContexts[lineNumber].crossAxisOffset - crossAxisStartEdge; | 2184 lineContexts[lineNumber].crossAxisOffset - crossAxisStartEdge; |
| 2185 LayoutUnit newOffset = | 2185 LayoutUnit newOffset = |
| 2186 contentExtent - originalOffset - lineCrossAxisExtent; | 2186 contentExtent - originalOffset - lineCrossAxisExtent; |
| 2187 adjustAlignmentForChild(*flexItem.box, newOffset - originalOffset); | 2187 adjustAlignmentForChild(*flexItem.box, newOffset - originalOffset); |
| 2188 } | 2188 } |
| 2189 } | 2189 } |
| 2190 } | 2190 } |
| 2191 | 2191 |
| 2192 } // namespace blink | 2192 } // namespace blink |
| OLD | NEW |