Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(380)

Side by Side Diff: third_party/WebKit/Source/core/layout/LayoutFlexibleBox.h

Issue 2170533002: [css-flexbox] Some more code refactoring (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/layout/LayoutFlexibleBox.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 129 matching lines...) Expand 10 before | Expand all | Expand 10 after
140 LayoutUnit flowAwareMarginBeforeForChild(const LayoutBox& child) const; 140 LayoutUnit flowAwareMarginBeforeForChild(const LayoutBox& child) const;
141 LayoutUnit crossAxisMarginExtentForChild(const LayoutBox& child) const; 141 LayoutUnit crossAxisMarginExtentForChild(const LayoutBox& child) const;
142 LayoutUnit crossAxisScrollbarExtent() const; 142 LayoutUnit crossAxisScrollbarExtent() const;
143 LayoutUnit crossAxisScrollbarExtentForChild(const LayoutBox& child) const; 143 LayoutUnit crossAxisScrollbarExtentForChild(const LayoutBox& child) const;
144 LayoutPoint flowAwareLocationForChild(const LayoutBox& child) const; 144 LayoutPoint flowAwareLocationForChild(const LayoutBox& child) const;
145 bool useChildAspectRatio(const LayoutBox& child) const; 145 bool useChildAspectRatio(const LayoutBox& child) const;
146 LayoutUnit computeMainSizeFromAspectRatioUsing(const LayoutBox& child, Lengt h crossSizeLength) const; 146 LayoutUnit computeMainSizeFromAspectRatioUsing(const LayoutBox& child, Lengt h crossSizeLength) const;
147 void setFlowAwareLocationForChild(LayoutBox& child, const LayoutPoint&); 147 void setFlowAwareLocationForChild(LayoutBox& child, const LayoutPoint&);
148 void adjustAlignmentForChild(LayoutBox& child, LayoutUnit); 148 void adjustAlignmentForChild(LayoutBox& child, LayoutUnit);
149 ItemPosition alignmentForChild(const LayoutBox& child) const; 149 ItemPosition alignmentForChild(const LayoutBox& child) const;
150 LayoutUnit mainAxisBorderAndPaddingExtentForChild(const LayoutBox& child) co nst; 150 LayoutUnit computeInnerFlexBaseSizeForChild(LayoutBox& child, LayoutUnit mai nAxisBorderAndPadding, ChildLayoutType = LayoutIfNeeded);
151 LayoutUnit computeInnerFlexBaseSizeForChild(LayoutBox& child, ChildLayoutTyp e = LayoutIfNeeded);
152 bool mainAxisLengthIsDefinite(const LayoutBox& child, const Length& flexBasi s) const; 151 bool mainAxisLengthIsDefinite(const LayoutBox& child, const Length& flexBasi s) const;
153 bool crossAxisLengthIsDefinite(const LayoutBox& child, const Length& flexBas is) const; 152 bool crossAxisLengthIsDefinite(const LayoutBox& child, const Length& flexBas is) const;
154 bool childFlexBaseSizeRequiresLayout(const LayoutBox& child) const; 153 bool childFlexBaseSizeRequiresLayout(const LayoutBox& child) const;
155 bool needToStretchChildLogicalHeight(const LayoutBox& child) const; 154 bool needToStretchChildLogicalHeight(const LayoutBox& child) const;
156 bool childHasIntrinsicMainAxisSize(const LayoutBox& child) const; 155 bool childHasIntrinsicMainAxisSize(const LayoutBox& child) const;
157 EOverflow mainAxisOverflowForChild(const LayoutBox& child) const; 156 EOverflow mainAxisOverflowForChild(const LayoutBox& child) const;
158 EOverflow crossAxisOverflowForChild(const LayoutBox& child) const; 157 EOverflow crossAxisOverflowForChild(const LayoutBox& child) const;
159 void cacheChildMainSize(const LayoutBox& child); 158 void cacheChildMainSize(const LayoutBox& child);
160 159
161 void layoutFlexItems(bool relayoutChildren, SubtreeLayoutScope&); 160 void layoutFlexItems(bool relayoutChildren, SubtreeLayoutScope&);
162 LayoutUnit autoMarginOffsetInMainAxis(const OrderedFlexItemList&, LayoutUnit & availableFreeSpace); 161 LayoutUnit autoMarginOffsetInMainAxis(const OrderedFlexItemList&, LayoutUnit & availableFreeSpace);
163 void updateAutoMarginsInMainAxis(LayoutBox& child, LayoutUnit autoMarginOffs et); 162 void updateAutoMarginsInMainAxis(LayoutBox& child, LayoutUnit autoMarginOffs et);
164 bool hasAutoMarginsInCrossAxis(const LayoutBox& child) const; 163 bool hasAutoMarginsInCrossAxis(const LayoutBox& child) const;
165 bool updateAutoMarginsInCrossAxis(LayoutBox& child, LayoutUnit availableAlig nmentSpace); 164 bool updateAutoMarginsInCrossAxis(LayoutBox& child, LayoutUnit availableAlig nmentSpace);
166 void repositionLogicalHeightDependentFlexItems(Vector<LineContext>&); 165 void repositionLogicalHeightDependentFlexItems(Vector<LineContext>&);
167 LayoutUnit clientLogicalBottomAfterRepositioning(); 166 LayoutUnit clientLogicalBottomAfterRepositioning();
168 167
169 LayoutUnit availableAlignmentSpaceForChild(LayoutUnit lineCrossAxisExtent, c onst LayoutBox& child); 168 LayoutUnit availableAlignmentSpaceForChild(LayoutUnit lineCrossAxisExtent, c onst LayoutBox& child);
170 LayoutUnit availableAlignmentSpaceForChildBeforeStretching(LayoutUnit lineCr ossAxisExtent, const LayoutBox& child); 169 LayoutUnit availableAlignmentSpaceForChildBeforeStretching(LayoutUnit lineCr ossAxisExtent, const LayoutBox& child);
171 LayoutUnit marginBoxAscentForChild(const LayoutBox& child); 170 LayoutUnit marginBoxAscentForChild(const LayoutBox& child);
172 171
173 LayoutUnit computeChildMarginValue(Length margin); 172 LayoutUnit computeChildMarginValue(Length margin);
174 void prepareOrderIteratorAndMargins(); 173 void prepareOrderIteratorAndMargins();
175 LayoutUnit adjustChildSizeForMinAndMax(const LayoutBox& child, LayoutUnit ch ildSize); 174 LayoutUnit adjustChildSizeForMinAndMax(const LayoutBox& child, LayoutUnit ch ildSize);
176 LayoutUnit adjustChildSizeForAspectRatioCrossAxisMinAndMax(const LayoutBox& child, LayoutUnit childSize); 175 LayoutUnit adjustChildSizeForAspectRatioCrossAxisMinAndMax(const LayoutBox& child, LayoutUnit childSize);
176 FlexItem constructFlexItem(LayoutBox& child, ChildLayoutType);
177 // The hypothetical main size of an item is the flex base size clamped accor ding to its min and max main size properties 177 // The hypothetical main size of an item is the flex base size clamped accor ding to its min and max main size properties
178 bool computeNextFlexLine(OrderedFlexItemList& orderedChildren, LayoutUnit& s umFlexBaseSize, double& totalFlexGrow, double& totalFlexShrink, double& totalWei ghtedFlexShrink, LayoutUnit& sumHypotheticalMainSize, bool relayoutChildren); 178 bool computeNextFlexLine(OrderedFlexItemList& orderedChildren, LayoutUnit& s umFlexBaseSize, double& totalFlexGrow, double& totalFlexShrink, double& totalWei ghtedFlexShrink, LayoutUnit& sumHypotheticalMainSize, bool relayoutChildren);
179 179
180 void freezeInflexibleItems(FlexSign, OrderedFlexItemList& children, LayoutUn it& remainingFreeSpace, double& totalFlexGrow, double& totalFlexShrink, double& totalWeightedFlexShrink); 180 void freezeInflexibleItems(FlexSign, OrderedFlexItemList& children, LayoutUn it& remainingFreeSpace, double& totalFlexGrow, double& totalFlexShrink, double& totalWeightedFlexShrink);
181 bool resolveFlexibleLengths(FlexSign, OrderedFlexItemList&, LayoutUnit initi alFreeSpace, LayoutUnit& remainingFreeSpace, double& totalFlexGrow, double& tota lFlexShrink, double& totalWeightedFlexShrink); 181 bool resolveFlexibleLengths(FlexSign, OrderedFlexItemList&, LayoutUnit initi alFreeSpace, LayoutUnit& remainingFreeSpace, double& totalFlexGrow, double& tota lFlexShrink, double& totalWeightedFlexShrink);
182 void freezeViolations(Vector<FlexItem*>&, LayoutUnit& availableFreeSpace, do uble& totalFlexGrow, double& totalFlexShrink, double& totalWeightedFlexShrink); 182 void freezeViolations(Vector<FlexItem*>&, LayoutUnit& availableFreeSpace, do uble& totalFlexGrow, double& totalFlexShrink, double& totalWeightedFlexShrink);
183 183
184 void resetAutoMarginsAndLogicalTopInCrossAxis(LayoutBox& child); 184 void resetAutoMarginsAndLogicalTopInCrossAxis(LayoutBox& child);
185 void setOverrideMainAxisContentSizeForChild(LayoutBox& child, LayoutUnit chi ldPreferredSize); 185 void setOverrideMainAxisContentSizeForChild(LayoutBox& child, LayoutUnit chi ldPreferredSize);
186 void prepareChildForPositionedLayout(LayoutBox& child); 186 void prepareChildForPositionedLayout(LayoutBox& child);
(...skipping 21 matching lines...) Expand all
208 208
209 // This is SizeIsUnknown outside of layoutBlock() 209 // This is SizeIsUnknown outside of layoutBlock()
210 mutable SizeDefiniteness m_hasDefiniteHeight; 210 mutable SizeDefiniteness m_hasDefiniteHeight;
211 }; 211 };
212 212
213 DEFINE_LAYOUT_OBJECT_TYPE_CASTS(LayoutFlexibleBox, isFlexibleBox()); 213 DEFINE_LAYOUT_OBJECT_TYPE_CASTS(LayoutFlexibleBox, isFlexibleBox());
214 214
215 } // namespace blink 215 } // namespace blink
216 216
217 #endif // LayoutFlexibleBox_h 217 #endif // LayoutFlexibleBox_h
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/layout/LayoutFlexibleBox.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698