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 298 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
309 bool LayoutFlexibleBox::hasLeftOverflow() const { | 309 bool LayoutFlexibleBox::hasLeftOverflow() const { |
310 EFlexDirection flexDirection = style()->flexDirection(); | 310 EFlexDirection flexDirection = style()->flexDirection(); |
311 if (isHorizontalWritingMode()) | 311 if (isHorizontalWritingMode()) |
312 return flexDirection == | 312 return flexDirection == |
313 (style()->isLeftToRightDirection() ? FlowRowReverse : FlowRow); | 313 (style()->isLeftToRightDirection() ? FlowRowReverse : FlowRow); |
314 return flexDirection == FlowColumnReverse; | 314 return flexDirection == FlowColumnReverse; |
315 } | 315 } |
316 | 316 |
317 void LayoutFlexibleBox::removeChild(LayoutObject* child) { | 317 void LayoutFlexibleBox::removeChild(LayoutObject* child) { |
318 LayoutBlock::removeChild(child); | 318 LayoutBlock::removeChild(child); |
319 m_intrinsicSizeAlongMainAxis.remove(child); | 319 m_intrinsicSizeAlongMainAxis.erase(child); |
320 } | 320 } |
321 | 321 |
322 // TODO (lajava): Is this function still needed ? Every time the flex | 322 // TODO (lajava): Is this function still needed ? Every time the flex |
323 // container's align-items value changes we propagate the diff to its children | 323 // container's align-items value changes we propagate the diff to its children |
324 // (see ComputedStyle::stylePropagationDiff). | 324 // (see ComputedStyle::stylePropagationDiff). |
325 void LayoutFlexibleBox::styleDidChange(StyleDifference diff, | 325 void LayoutFlexibleBox::styleDidChange(StyleDifference diff, |
326 const ComputedStyle* oldStyle) { | 326 const ComputedStyle* oldStyle) { |
327 LayoutBlock::styleDidChange(diff, oldStyle); | 327 LayoutBlock::styleDidChange(diff, oldStyle); |
328 | 328 |
329 if (oldStyle && oldStyle->alignItemsPosition() == ItemPositionStretch && | 329 if (oldStyle && oldStyle->alignItemsPosition() == ItemPositionStretch && |
(...skipping 551 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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.insert(&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.erase(&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, |
898 ChildLayoutType childLayoutType) { | 898 ChildLayoutType childLayoutType) { |
899 child.clearOverrideSize(); | 899 child.clearOverrideSize(); |
900 | 900 |
901 if (child.isImage() || child.isVideo() || child.isCanvas()) | 901 if (child.isImage() || child.isVideo() || child.isCanvas()) |
(...skipping 1281 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 |