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

Side by Side Diff: Source/core/rendering/RenderFlexibleBox.h

Issue 343103003: Flexbox: Allow intrinsic aspect ratios to inform main-size calculation (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 3 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
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 104 matching lines...) Expand 10 before | Expand all | Expand 10 after
115 LayoutUnit crossAxisScrollbarExtentForChild(RenderBox* child) const; 115 LayoutUnit crossAxisScrollbarExtentForChild(RenderBox* child) const;
116 LayoutPoint flowAwareLocationForChild(RenderBox* child) const; 116 LayoutPoint flowAwareLocationForChild(RenderBox* child) const;
117 // FIXME: Supporting layout deltas. 117 // FIXME: Supporting layout deltas.
118 void setFlowAwareLocationForChild(RenderBox* child, const LayoutPoint&); 118 void setFlowAwareLocationForChild(RenderBox* child, const LayoutPoint&);
119 void adjustAlignmentForChild(RenderBox* child, LayoutUnit); 119 void adjustAlignmentForChild(RenderBox* child, LayoutUnit);
120 ItemPosition alignmentForChild(RenderBox* child) const; 120 ItemPosition alignmentForChild(RenderBox* child) const;
121 LayoutUnit mainAxisBorderAndPaddingExtentForChild(RenderBox* child) const; 121 LayoutUnit mainAxisBorderAndPaddingExtentForChild(RenderBox* child) const;
122 LayoutUnit preferredMainAxisContentExtentForChild(RenderBox* child, bool has InfiniteLineLength, bool relayoutChildren = false); 122 LayoutUnit preferredMainAxisContentExtentForChild(RenderBox* child, bool has InfiniteLineLength, bool relayoutChildren = false);
123 bool childPreferredMainAxisContentExtentRequiresLayout(RenderBox* child, boo l hasInfiniteLineLength) const; 123 bool childPreferredMainAxisContentExtentRequiresLayout(RenderBox* child, boo l hasInfiniteLineLength) const;
124 bool needToStretchChildLogicalHeight(RenderBox* child) const; 124 bool needToStretchChildLogicalHeight(RenderBox* child) const;
125 bool needToStretchChildLogicalWidth(RenderBox* child) const;
126 bool childHasFiniteCrossSize(RenderBox* child) const;
125 127
126 void layoutFlexItems(bool relayoutChildren); 128 void layoutFlexItems(bool relayoutChildren);
127 LayoutUnit autoMarginOffsetInMainAxis(const OrderedFlexItemList&, LayoutUnit & availableFreeSpace); 129 LayoutUnit autoMarginOffsetInMainAxis(const OrderedFlexItemList&, LayoutUnit & availableFreeSpace);
128 void updateAutoMarginsInMainAxis(RenderBox* child, LayoutUnit autoMarginOffs et); 130 void updateAutoMarginsInMainAxis(RenderBox* child, LayoutUnit autoMarginOffs et);
129 bool hasAutoMarginsInCrossAxis(RenderBox* child) const; 131 bool hasAutoMarginsInCrossAxis(RenderBox* child) const;
130 bool updateAutoMarginsInCrossAxis(RenderBox* child, LayoutUnit availableAlig nmentSpace); 132 bool updateAutoMarginsInCrossAxis(RenderBox* child, LayoutUnit availableAlig nmentSpace);
131 void repositionLogicalHeightDependentFlexItems(Vector<LineContext>&); 133 void repositionLogicalHeightDependentFlexItems(Vector<LineContext>&);
132 LayoutUnit clientLogicalBottomAfterRepositioning(); 134 LayoutUnit clientLogicalBottomAfterRepositioning();
133 void appendChildFrameRects(ChildFrameRects&); 135 void appendChildFrameRects(ChildFrameRects&);
134 136
(...skipping 12 matching lines...) Expand all
147 149
148 void resetAutoMarginsAndLogicalTopInCrossAxis(RenderBox*); 150 void resetAutoMarginsAndLogicalTopInCrossAxis(RenderBox*);
149 void setLogicalOverrideSize(RenderBox* child, LayoutUnit childPreferredSize) ; 151 void setLogicalOverrideSize(RenderBox* child, LayoutUnit childPreferredSize) ;
150 void prepareChildForPositionedLayout(RenderBox* child, LayoutUnit mainAxisOf fset, LayoutUnit crossAxisOffset, PositionedLayoutMode); 152 void prepareChildForPositionedLayout(RenderBox* child, LayoutUnit mainAxisOf fset, LayoutUnit crossAxisOffset, PositionedLayoutMode);
151 size_t numberOfInFlowPositionedChildren(const OrderedFlexItemList&) const; 153 size_t numberOfInFlowPositionedChildren(const OrderedFlexItemList&) const;
152 void layoutAndPlaceChildren(LayoutUnit& crossAxisOffset, const OrderedFlexIt emList&, const Vector<LayoutUnit, 16>& childSizes, LayoutUnit availableFreeSpace , bool relayoutChildren, Vector<LineContext>&, bool hasInfiniteLineLength); 154 void layoutAndPlaceChildren(LayoutUnit& crossAxisOffset, const OrderedFlexIt emList&, const Vector<LayoutUnit, 16>& childSizes, LayoutUnit availableFreeSpace , bool relayoutChildren, Vector<LineContext>&, bool hasInfiniteLineLength);
153 void layoutColumnReverse(const OrderedFlexItemList&, LayoutUnit crossAxisOff set, LayoutUnit availableFreeSpace); 155 void layoutColumnReverse(const OrderedFlexItemList&, LayoutUnit crossAxisOff set, LayoutUnit availableFreeSpace);
154 void alignFlexLines(Vector<LineContext>&); 156 void alignFlexLines(Vector<LineContext>&);
155 void alignChildren(const Vector<LineContext>&); 157 void alignChildren(const Vector<LineContext>&);
156 void applyStretchAlignmentToChild(RenderBox*, LayoutUnit lineCrossAxisExtent ); 158 void applyStretchAlignmentToChild(RenderBox*, LayoutUnit lineCrossAxisExtent );
159 void computeAspectRatioOfChild(RenderBox* child, double& aspectRatio);
157 void flipForRightToLeftColumn(); 160 void flipForRightToLeftColumn();
158 void flipForWrapReverse(const Vector<LineContext>&, LayoutUnit crossAxisStar tEdge); 161 void flipForWrapReverse(const Vector<LineContext>&, LayoutUnit crossAxisStar tEdge);
159 162
160 // This is used to cache the preferred size for orthogonal flow children so we don't have to relayout to get it 163 // This is used to cache the preferred size for orthogonal flow children so we don't have to relayout to get it
161 HashMap<const RenderObject*, LayoutUnit> m_intrinsicSizeAlongMainAxis; 164 HashMap<const RenderObject*, LayoutUnit> m_intrinsicSizeAlongMainAxis;
162 165
163 mutable OrderIterator m_orderIterator; 166 mutable OrderIterator m_orderIterator;
164 int m_numberOfInFlowChildrenOnFirstLine; 167 int m_numberOfInFlowChildrenOnFirstLine;
165 }; 168 };
166 169
167 DEFINE_RENDER_OBJECT_TYPE_CASTS(RenderFlexibleBox, isFlexibleBox()); 170 DEFINE_RENDER_OBJECT_TYPE_CASTS(RenderFlexibleBox, isFlexibleBox());
168 171
169 } // namespace blink 172 } // namespace blink
170 173
171 #endif // RenderFlexibleBox_h 174 #endif // RenderFlexibleBox_h
OLDNEW
« no previous file with comments | « LayoutTests/css3/images/resources/green-100x50.png ('k') | Source/core/rendering/RenderFlexibleBox.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698