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

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

Issue 2056043002: [css-flexbox] Cache whether our main axis size is definite (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: different approach 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 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
92 enum ChildLayoutType { 92 enum ChildLayoutType {
93 LayoutIfNeeded, 93 LayoutIfNeeded,
94 ForceLayout, 94 ForceLayout,
95 NeverLayout 95 NeverLayout
96 }; 96 };
97 97
98 enum class TransformedWritingMode { 98 enum class TransformedWritingMode {
99 TopToBottomWritingMode, RightToLeftWritingMode, LeftToRightWritingMode, BottomToTopWritingMode 99 TopToBottomWritingMode, RightToLeftWritingMode, LeftToRightWritingMode, BottomToTopWritingMode
100 }; 100 };
101 101
102 enum class SizeDefiniteness {
103 Definite, Indefinite, Unknown
104 };
105
102 struct FlexItem; 106 struct FlexItem;
103 struct LineContext; 107 struct LineContext;
104 108
105 typedef Vector<FlexItem> OrderedFlexItemList; 109 typedef Vector<FlexItem> OrderedFlexItemList;
106 // Use an inline capacity of 8, since flexbox containers usually have less t han 8 children. 110 // Use an inline capacity of 8, since flexbox containers usually have less t han 8 children.
107 typedef Vector<LayoutRect, 8> ChildFrameRects; 111 typedef Vector<LayoutRect, 8> ChildFrameRects;
108 112
109 bool hasOrthogonalFlow(const LayoutBox& child) const; 113 bool hasOrthogonalFlow(const LayoutBox& child) const;
110 bool isColumnFlow() const; 114 bool isColumnFlow() const;
111 bool isLeftToRightFlow() const; 115 bool isLeftToRightFlow() const;
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
193 // This is used to cache the preferred size for orthogonal flow children so we don't have to relayout to get it 197 // This is used to cache the preferred size for orthogonal flow children so we don't have to relayout to get it
194 HashMap<const LayoutObject*, LayoutUnit> m_intrinsicSizeAlongMainAxis; 198 HashMap<const LayoutObject*, LayoutUnit> m_intrinsicSizeAlongMainAxis;
195 199
196 // This set is used to keep track of which children we laid out in this curr ent layout iteration. 200 // This set is used to keep track of which children we laid out in this curr ent layout iteration.
197 // We need it because the ones in this set may need an additional layout pas s for correct stretch alignment 201 // We need it because the ones in this set may need an additional layout pas s for correct stretch alignment
198 // handling, as the first layout likely did not use the correct value for pe rcentage sizing of children. 202 // handling, as the first layout likely did not use the correct value for pe rcentage sizing of children.
199 HashSet<const LayoutObject*> m_relaidOutChildren; 203 HashSet<const LayoutObject*> m_relaidOutChildren;
200 204
201 mutable OrderIterator m_orderIterator; 205 mutable OrderIterator m_orderIterator;
202 int m_numberOfInFlowChildrenOnFirstLine; 206 int m_numberOfInFlowChildrenOnFirstLine;
207
208 // This is SizeIsUnknown outside of layoutBlock()
209 mutable SizeDefiniteness m_hasDefiniteHeight;
203 }; 210 };
204 211
205 DEFINE_LAYOUT_OBJECT_TYPE_CASTS(LayoutFlexibleBox, isFlexibleBox()); 212 DEFINE_LAYOUT_OBJECT_TYPE_CASTS(LayoutFlexibleBox, isFlexibleBox());
206 213
207 } // namespace blink 214 } // namespace blink
208 215
209 #endif // LayoutFlexibleBox_h 216 #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