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 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
128 void setFlowAwareLocationForChild(LayoutBox& child, const LayoutPoint&); | 128 void setFlowAwareLocationForChild(LayoutBox& child, const LayoutPoint&); |
129 void adjustAlignmentForChild(LayoutBox& child, LayoutUnit); | 129 void adjustAlignmentForChild(LayoutBox& child, LayoutUnit); |
130 ItemPosition alignmentForChild(LayoutBox& child) const; | 130 ItemPosition alignmentForChild(LayoutBox& child) const; |
131 LayoutUnit mainAxisBorderAndPaddingExtentForChild(LayoutBox& child) const; | 131 LayoutUnit mainAxisBorderAndPaddingExtentForChild(LayoutBox& child) const; |
132 LayoutUnit computeInnerFlexBaseSizeForChild(LayoutBox& child, ChildLayoutTyp
e = LayoutIfNeeded); | 132 LayoutUnit computeInnerFlexBaseSizeForChild(LayoutBox& child, ChildLayoutTyp
e = LayoutIfNeeded); |
133 bool mainAxisLengthIsIndefinite(const Length& flexBasis) const; | 133 bool mainAxisLengthIsIndefinite(const Length& flexBasis) const; |
134 bool childFlexBaseSizeRequiresLayout(LayoutBox& child) const; | 134 bool childFlexBaseSizeRequiresLayout(LayoutBox& child) const; |
135 bool needToStretchChildLogicalHeight(LayoutBox& child) const; | 135 bool needToStretchChildLogicalHeight(LayoutBox& child) const; |
136 EOverflow mainAxisOverflowForChild(LayoutBox& child) const; | 136 EOverflow mainAxisOverflowForChild(LayoutBox& child) const; |
137 | 137 |
138 void layoutFlexItems(bool relayoutChildren); | 138 void layoutFlexItems(bool relayoutChildren, SubtreeLayoutScope&); |
139 LayoutUnit autoMarginOffsetInMainAxis(const OrderedFlexItemList&, LayoutUnit
& availableFreeSpace); | 139 LayoutUnit autoMarginOffsetInMainAxis(const OrderedFlexItemList&, LayoutUnit
& availableFreeSpace); |
140 void updateAutoMarginsInMainAxis(LayoutBox& child, LayoutUnit autoMarginOffs
et); | 140 void updateAutoMarginsInMainAxis(LayoutBox& child, LayoutUnit autoMarginOffs
et); |
141 bool hasAutoMarginsInCrossAxis(LayoutBox& child) const; | 141 bool hasAutoMarginsInCrossAxis(LayoutBox& child) const; |
142 bool updateAutoMarginsInCrossAxis(LayoutBox& child, LayoutUnit availableAlig
nmentSpace); | 142 bool updateAutoMarginsInCrossAxis(LayoutBox& child, LayoutUnit availableAlig
nmentSpace); |
143 void repositionLogicalHeightDependentFlexItems(Vector<LineContext>&); | 143 void repositionLogicalHeightDependentFlexItems(Vector<LineContext>&); |
144 LayoutUnit clientLogicalBottomAfterRepositioning(); | 144 LayoutUnit clientLogicalBottomAfterRepositioning(); |
145 void appendChildFrameRects(ChildFrameRects&); | 145 void appendChildFrameRects(ChildFrameRects&); |
146 | 146 |
147 LayoutUnit availableAlignmentSpaceForChild(LayoutUnit lineCrossAxisExtent, L
ayoutBox& child); | 147 LayoutUnit availableAlignmentSpaceForChild(LayoutUnit lineCrossAxisExtent, L
ayoutBox& child); |
148 LayoutUnit availableAlignmentSpaceForChildBeforeStretching(LayoutUnit lineCr
ossAxisExtent, LayoutBox& child); | 148 LayoutUnit availableAlignmentSpaceForChildBeforeStretching(LayoutUnit lineCr
ossAxisExtent, LayoutBox& child); |
149 LayoutUnit marginBoxAscentForChild(LayoutBox& child); | 149 LayoutUnit marginBoxAscentForChild(LayoutBox& child); |
150 | 150 |
151 LayoutUnit computeChildMarginValue(Length margin); | 151 LayoutUnit computeChildMarginValue(Length margin); |
152 void prepareOrderIteratorAndMargins(); | 152 void prepareOrderIteratorAndMargins(); |
153 LayoutUnit adjustChildSizeForMinAndMax(LayoutBox& child, LayoutUnit childSiz
e, bool childShrunk = false); | 153 LayoutUnit adjustChildSizeForMinAndMax(LayoutBox& child, LayoutUnit childSiz
e, bool childShrunk = false); |
154 // The hypothetical main size of an item is the flex base size clamped accor
ding to its min and max main size properties | 154 // The hypothetical main size of an item is the flex base size clamped accor
ding to its min and max main size properties |
155 bool computeNextFlexLine(OrderedFlexItemList& orderedChildren, LayoutUnit& s
umFlexBaseSize, double& totalFlexGrow, double& totalWeightedFlexShrink, LayoutUn
it& sumHypotheticalMainSize, bool relayoutChildren); | 155 bool computeNextFlexLine(OrderedFlexItemList& orderedChildren, LayoutUnit& s
umFlexBaseSize, double& totalFlexGrow, double& totalWeightedFlexShrink, LayoutUn
it& sumHypotheticalMainSize, bool relayoutChildren); |
156 | 156 |
157 bool resolveFlexibleLengths(FlexSign, const OrderedFlexItemList&, LayoutUnit
& availableFreeSpace, double& totalFlexGrow, double& totalWeightedFlexShrink, In
flexibleFlexItemSize&, Vector<LayoutUnit, 16>& childSizes); | 157 bool resolveFlexibleLengths(FlexSign, const OrderedFlexItemList&, LayoutUnit
& availableFreeSpace, double& totalFlexGrow, double& totalWeightedFlexShrink, In
flexibleFlexItemSize&, Vector<LayoutUnit, 16>& childSizes); |
158 void freezeViolations(const Vector<Violation>&, LayoutUnit& availableFreeSpa
ce, double& totalFlexGrow, double& totalWeightedFlexShrink, InflexibleFlexItemSi
ze&); | 158 void freezeViolations(const Vector<Violation>&, LayoutUnit& availableFreeSpa
ce, double& totalFlexGrow, double& totalWeightedFlexShrink, InflexibleFlexItemSi
ze&); |
159 | 159 |
160 void resetAutoMarginsAndLogicalTopInCrossAxis(LayoutBox& child); | 160 void resetAutoMarginsAndLogicalTopInCrossAxis(LayoutBox& child); |
161 void setOverrideMainAxisSizeForChild(LayoutBox& child, LayoutUnit childPrefe
rredSize); | 161 void setOverrideMainAxisSizeForChild(LayoutBox& child, LayoutUnit childPrefe
rredSize); |
162 void prepareChildForPositionedLayout(LayoutBox& child, LayoutUnit mainAxisOf
fset, LayoutUnit crossAxisOffset, PositionedLayoutMode); | 162 void prepareChildForPositionedLayout(LayoutBox& child, LayoutUnit mainAxisOf
fset, LayoutUnit crossAxisOffset, PositionedLayoutMode); |
163 size_t numberOfInFlowPositionedChildren(const OrderedFlexItemList&) const; | 163 size_t numberOfInFlowPositionedChildren(const OrderedFlexItemList&) const; |
164 void layoutAndPlaceChildren(LayoutUnit& crossAxisOffset, const OrderedFlexIt
emList&, const Vector<LayoutUnit, 16>& childSizes, LayoutUnit availableFreeSpace
, bool relayoutChildren, Vector<LineContext>&); | 164 void layoutAndPlaceChildren(LayoutUnit& crossAxisOffset, const OrderedFlexIt
emList&, const Vector<LayoutUnit, 16>& childSizes, LayoutUnit availableFreeSpace
, bool relayoutChildren, SubtreeLayoutScope&, Vector<LineContext>&); |
165 void layoutColumnReverse(const OrderedFlexItemList&, LayoutUnit crossAxisOff
set, LayoutUnit availableFreeSpace); | 165 void layoutColumnReverse(const OrderedFlexItemList&, LayoutUnit crossAxisOff
set, LayoutUnit availableFreeSpace); |
166 void alignFlexLines(Vector<LineContext>&); | 166 void alignFlexLines(Vector<LineContext>&); |
167 void alignChildren(const Vector<LineContext>&); | 167 void alignChildren(const Vector<LineContext>&); |
168 void applyStretchAlignmentToChild(LayoutBox& child, LayoutUnit lineCrossAxis
Extent); | 168 void applyStretchAlignmentToChild(LayoutBox& child, LayoutUnit lineCrossAxis
Extent); |
169 void flipForRightToLeftColumn(); | 169 void flipForRightToLeftColumn(); |
170 void flipForWrapReverse(const Vector<LineContext>&, LayoutUnit crossAxisStar
tEdge); | 170 void flipForWrapReverse(const Vector<LineContext>&, LayoutUnit crossAxisStar
tEdge); |
171 | 171 |
172 // This is used to cache the preferred size for orthogonal flow children so
we don't have to relayout to get it | 172 // This is used to cache the preferred size for orthogonal flow children so
we don't have to relayout to get it |
173 HashMap<const LayoutObject*, LayoutUnit> m_intrinsicSizeAlongMainAxis; | 173 HashMap<const LayoutObject*, LayoutUnit> m_intrinsicSizeAlongMainAxis; |
174 | 174 |
175 mutable OrderIterator m_orderIterator; | 175 mutable OrderIterator m_orderIterator; |
176 int m_numberOfInFlowChildrenOnFirstLine; | 176 int m_numberOfInFlowChildrenOnFirstLine; |
177 }; | 177 }; |
178 | 178 |
179 DEFINE_LAYOUT_OBJECT_TYPE_CASTS(LayoutFlexibleBox, isFlexibleBox()); | 179 DEFINE_LAYOUT_OBJECT_TYPE_CASTS(LayoutFlexibleBox, isFlexibleBox()); |
180 | 180 |
181 } // namespace blink | 181 } // namespace blink |
182 | 182 |
183 #endif // LayoutFlexibleBox_h | 183 #endif // LayoutFlexibleBox_h |
OLD | NEW |