| 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 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 84 struct Violation; | 84 struct Violation; |
| 85 | 85 |
| 86 // Use an inline capacity of 8, since flexbox containers usually have less t
han 8 children. | 86 // Use an inline capacity of 8, since flexbox containers usually have less t
han 8 children. |
| 87 typedef Vector<LayoutRect, 8> ChildFrameRects; | 87 typedef Vector<LayoutRect, 8> ChildFrameRects; |
| 88 | 88 |
| 89 bool hasOrthogonalFlow(LayoutBox& child) const; | 89 bool hasOrthogonalFlow(LayoutBox& child) const; |
| 90 bool isColumnFlow() const; | 90 bool isColumnFlow() const; |
| 91 bool isLeftToRightFlow() const; | 91 bool isLeftToRightFlow() const; |
| 92 bool isMultiline() const; | 92 bool isMultiline() const; |
| 93 Length flexBasisForChild(LayoutBox& child) const; | 93 Length flexBasisForChild(LayoutBox& child) const; |
| 94 bool percentageMainSizeIsResolvable(); |
| 94 LayoutUnit crossAxisExtentForChild(LayoutBox& child) const; | 95 LayoutUnit crossAxisExtentForChild(LayoutBox& child) const; |
| 95 LayoutUnit crossAxisIntrinsicExtentForChild(LayoutBox& child) const; | 96 LayoutUnit crossAxisIntrinsicExtentForChild(LayoutBox& child) const; |
| 96 LayoutUnit childIntrinsicHeight(LayoutBox& child) const; | 97 LayoutUnit childIntrinsicHeight(LayoutBox& child) const; |
| 97 LayoutUnit childIntrinsicWidth(LayoutBox& child) const; | 98 LayoutUnit childIntrinsicWidth(LayoutBox& child) const; |
| 98 LayoutUnit mainAxisExtentForChild(LayoutBox& child) const; | 99 LayoutUnit mainAxisExtentForChild(LayoutBox& child) const; |
| 99 LayoutUnit crossAxisExtent() const; | 100 LayoutUnit crossAxisExtent() const; |
| 100 LayoutUnit mainAxisExtent() const; | 101 LayoutUnit mainAxisExtent() const; |
| 101 LayoutUnit crossAxisContentExtent() const; | 102 LayoutUnit crossAxisContentExtent() const; |
| 102 LayoutUnit mainAxisContentExtent(LayoutUnit contentLogicalHeight); | 103 LayoutUnit mainAxisContentExtent(LayoutUnit contentLogicalHeight); |
| 103 LayoutUnit computeMainAxisExtentForChild(LayoutBox& child, SizeType, const L
ength& size); | 104 LayoutUnit computeMainAxisExtentForChild(LayoutBox& child, SizeType, const L
ength& size); |
| (...skipping 14 matching lines...) Expand all Loading... |
| 118 LayoutUnit crossAxisScrollbarExtentForChild(LayoutBox& child) const; | 119 LayoutUnit crossAxisScrollbarExtentForChild(LayoutBox& child) const; |
| 119 LayoutPoint flowAwareLocationForChild(LayoutBox& child) const; | 120 LayoutPoint flowAwareLocationForChild(LayoutBox& child) const; |
| 120 // FIXME: Supporting layout deltas. | 121 // FIXME: Supporting layout deltas. |
| 121 void setFlowAwareLocationForChild(LayoutBox& child, const LayoutPoint&); | 122 void setFlowAwareLocationForChild(LayoutBox& child, const LayoutPoint&); |
| 122 void adjustAlignmentForChild(LayoutBox& child, LayoutUnit); | 123 void adjustAlignmentForChild(LayoutBox& child, LayoutUnit); |
| 123 ItemPosition alignmentForChild(LayoutBox& child) const; | 124 ItemPosition alignmentForChild(LayoutBox& child) const; |
| 124 LayoutUnit mainAxisBorderAndPaddingExtentForChild(LayoutBox& child) const; | 125 LayoutUnit mainAxisBorderAndPaddingExtentForChild(LayoutBox& child) const; |
| 125 LayoutUnit preferredMainAxisContentExtentForChild(LayoutBox& child, bool has
InfiniteLineLength, bool relayoutChildren = false); | 126 LayoutUnit preferredMainAxisContentExtentForChild(LayoutBox& child, bool has
InfiniteLineLength, bool relayoutChildren = false); |
| 126 bool childPreferredMainAxisContentExtentRequiresLayout(LayoutBox& child, boo
l hasInfiniteLineLength) const; | 127 bool childPreferredMainAxisContentExtentRequiresLayout(LayoutBox& child, boo
l hasInfiniteLineLength) const; |
| 127 bool needToStretchChildLogicalHeight(LayoutBox& child) const; | 128 bool needToStretchChildLogicalHeight(LayoutBox& child) const; |
| 129 EOverflow mainAxisOverflowForChild(LayoutBox& child) const; |
| 128 | 130 |
| 129 void layoutFlexItems(bool relayoutChildren); | 131 void layoutFlexItems(bool relayoutChildren); |
| 130 LayoutUnit autoMarginOffsetInMainAxis(const OrderedFlexItemList&, LayoutUnit
& availableFreeSpace); | 132 LayoutUnit autoMarginOffsetInMainAxis(const OrderedFlexItemList&, LayoutUnit
& availableFreeSpace); |
| 131 void updateAutoMarginsInMainAxis(LayoutBox& child, LayoutUnit autoMarginOffs
et); | 133 void updateAutoMarginsInMainAxis(LayoutBox& child, LayoutUnit autoMarginOffs
et); |
| 132 bool hasAutoMarginsInCrossAxis(LayoutBox& child) const; | 134 bool hasAutoMarginsInCrossAxis(LayoutBox& child) const; |
| 133 bool updateAutoMarginsInCrossAxis(LayoutBox& child, LayoutUnit availableAlig
nmentSpace); | 135 bool updateAutoMarginsInCrossAxis(LayoutBox& child, LayoutUnit availableAlig
nmentSpace); |
| 134 void repositionLogicalHeightDependentFlexItems(Vector<LineContext>&); | 136 void repositionLogicalHeightDependentFlexItems(Vector<LineContext>&); |
| 135 LayoutUnit clientLogicalBottomAfterRepositioning(); | 137 LayoutUnit clientLogicalBottomAfterRepositioning(); |
| 136 void appendChildFrameRects(ChildFrameRects&); | 138 void appendChildFrameRects(ChildFrameRects&); |
| 137 | 139 |
| 138 LayoutUnit availableAlignmentSpaceForChild(LayoutUnit lineCrossAxisExtent, L
ayoutBox& child); | 140 LayoutUnit availableAlignmentSpaceForChild(LayoutUnit lineCrossAxisExtent, L
ayoutBox& child); |
| 139 LayoutUnit availableAlignmentSpaceForChildBeforeStretching(LayoutUnit lineCr
ossAxisExtent, LayoutBox& child); | 141 LayoutUnit availableAlignmentSpaceForChildBeforeStretching(LayoutUnit lineCr
ossAxisExtent, LayoutBox& child); |
| 140 LayoutUnit marginBoxAscentForChild(LayoutBox& child); | 142 LayoutUnit marginBoxAscentForChild(LayoutBox& child); |
| 141 | 143 |
| 142 LayoutUnit computeChildMarginValue(Length margin); | 144 LayoutUnit computeChildMarginValue(Length margin); |
| 143 void prepareOrderIteratorAndMargins(); | 145 void prepareOrderIteratorAndMargins(); |
| 144 LayoutUnit adjustChildSizeForMinAndMax(LayoutBox& child, LayoutUnit childSiz
e); | 146 LayoutUnit adjustChildSizeForMinAndMax(LayoutBox& child, LayoutUnit childSiz
e, bool hasInfiniteLineLength); |
| 145 // The hypothetical main size of an item is the flex base size clamped accor
ding to its min and max main size properties | 147 // The hypothetical main size of an item is the flex base size clamped accor
ding to its min and max main size properties |
| 146 bool computeNextFlexLine(OrderedFlexItemList& orderedChildren, LayoutUnit& s
umFlexBaseSize, double& totalFlexGrow, double& totalWeightedFlexShrink, LayoutUn
it& sumHypotheticalMainSize, bool& hasInfiniteLineLength, bool relayoutChildren)
; | 148 bool computeNextFlexLine(OrderedFlexItemList& orderedChildren, LayoutUnit& s
umFlexBaseSize, double& totalFlexGrow, double& totalWeightedFlexShrink, LayoutUn
it& sumHypotheticalMainSize, bool& hasInfiniteLineLength, bool relayoutChildren)
; |
| 147 | 149 |
| 148 bool resolveFlexibleLengths(FlexSign, const OrderedFlexItemList&, LayoutUnit
& availableFreeSpace, double& totalFlexGrow, double& totalWeightedFlexShrink, In
flexibleFlexItemSize&, Vector<LayoutUnit, 16>& childSizes, bool hasInfiniteLineL
ength); | 150 bool resolveFlexibleLengths(FlexSign, const OrderedFlexItemList&, LayoutUnit
& availableFreeSpace, double& totalFlexGrow, double& totalWeightedFlexShrink, In
flexibleFlexItemSize&, Vector<LayoutUnit, 16>& childSizes, bool hasInfiniteLineL
ength); |
| 149 void freezeViolations(const Vector<Violation>&, LayoutUnit& availableFreeSpa
ce, double& totalFlexGrow, double& totalWeightedFlexShrink, InflexibleFlexItemSi
ze&, bool hasInfiniteLineLength); | 151 void freezeViolations(const Vector<Violation>&, LayoutUnit& availableFreeSpa
ce, double& totalFlexGrow, double& totalWeightedFlexShrink, InflexibleFlexItemSi
ze&, bool hasInfiniteLineLength); |
| 150 | 152 |
| 151 void resetAutoMarginsAndLogicalTopInCrossAxis(LayoutBox& child); | 153 void resetAutoMarginsAndLogicalTopInCrossAxis(LayoutBox& child); |
| 152 void setOverrideMainAxisSizeForChild(LayoutBox& child, LayoutUnit childPrefe
rredSize); | 154 void setOverrideMainAxisSizeForChild(LayoutBox& child, LayoutUnit childPrefe
rredSize); |
| 153 void prepareChildForPositionedLayout(LayoutBox& child, LayoutUnit mainAxisOf
fset, LayoutUnit crossAxisOffset, PositionedLayoutMode); | 155 void prepareChildForPositionedLayout(LayoutBox& child, LayoutUnit mainAxisOf
fset, LayoutUnit crossAxisOffset, PositionedLayoutMode); |
| 154 size_t numberOfInFlowPositionedChildren(const OrderedFlexItemList&) const; | 156 size_t numberOfInFlowPositionedChildren(const OrderedFlexItemList&) const; |
| (...skipping 10 matching lines...) Expand all Loading... |
| 165 | 167 |
| 166 mutable OrderIterator m_orderIterator; | 168 mutable OrderIterator m_orderIterator; |
| 167 int m_numberOfInFlowChildrenOnFirstLine; | 169 int m_numberOfInFlowChildrenOnFirstLine; |
| 168 }; | 170 }; |
| 169 | 171 |
| 170 DEFINE_LAYOUT_OBJECT_TYPE_CASTS(LayoutFlexibleBox, isFlexibleBox()); | 172 DEFINE_LAYOUT_OBJECT_TYPE_CASTS(LayoutFlexibleBox, isFlexibleBox()); |
| 171 | 173 |
| 172 } // namespace blink | 174 } // namespace blink |
| 173 | 175 |
| 174 #endif // LayoutFlexibleBox_h | 176 #endif // LayoutFlexibleBox_h |
| OLD | NEW |