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

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

Issue 2334133002: [css-grid] Cache definite height detection (Closed)
Patch Set: New version using m_hasDefiniteLogicalHeight class member Created 4 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 Apple Inc. All rights reserved. 2 * Copyright (C) 2011 Apple 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 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after
213 213
214 size_t gridItemSpan(const LayoutBox&, GridTrackSizingDirection); 214 size_t gridItemSpan(const LayoutBox&, GridTrackSizingDirection);
215 bool spanningItemCrossesFlexibleSizedTracks(const GridSpan&, GridTrackSizing Direction, SizingOperation) const; 215 bool spanningItemCrossesFlexibleSizedTracks(const GridSpan&, GridTrackSizing Direction, SizingOperation) const;
216 216
217 size_t gridColumnCount() const; 217 size_t gridColumnCount() const;
218 size_t gridRowCount() const; 218 size_t gridRowCount() const;
219 219
220 bool isOrthogonalChild(const LayoutBox&) const; 220 bool isOrthogonalChild(const LayoutBox&) const;
221 GridTrackSizingDirection flowAwareDirectionForChild(const LayoutBox&, GridTr ackSizingDirection) const; 221 GridTrackSizingDirection flowAwareDirectionForChild(const LayoutBox&, GridTr ackSizingDirection) const;
222 222
223 bool hasDefiniteLogicalHeight() const
jfernandez 2016/09/15 07:27:11 This method has the same name than the one defined
svillar 2016/09/15 08:02:22 Agree, do not use the same name, someone could be
Manuel Rego 2016/09/15 08:56:04 True, I'll change the name to cachedHasDefiniteLog
224 {
225 SECURITY_DCHECK(m_hasDefiniteLogicalHeight);
226 return m_hasDefiniteLogicalHeight.value();
svillar 2016/09/15 08:02:22 For caching like methods I think it's preferred so
svillar 2016/09/15 08:16:00 Beh, forget about this. We need to call it on ever
227 }
228
223 typedef Vector<Vector<GridCell>> GridRepresentation; 229 typedef Vector<Vector<GridCell>> GridRepresentation;
224 GridRepresentation m_grid; 230 GridRepresentation m_grid;
225 bool m_gridIsDirty; 231 bool m_gridIsDirty;
226 Vector<LayoutUnit> m_rowPositions; 232 Vector<LayoutUnit> m_rowPositions;
227 Vector<LayoutUnit> m_columnPositions; 233 Vector<LayoutUnit> m_columnPositions;
228 LayoutUnit m_offsetBetweenColumns; 234 LayoutUnit m_offsetBetweenColumns;
229 LayoutUnit m_offsetBetweenRows; 235 LayoutUnit m_offsetBetweenRows;
230 HashMap<const LayoutBox*, GridArea> m_gridItemArea; 236 HashMap<const LayoutBox*, GridArea> m_gridItemArea;
231 OrderIterator m_orderIterator; 237 OrderIterator m_orderIterator;
232 Vector<LayoutBox*> m_gridItemsOverflowingGridArea; 238 Vector<LayoutBox*> m_gridItemsOverflowingGridArea;
233 HashMap<const LayoutBox*, size_t> m_gridItemsIndexesMap; 239 HashMap<const LayoutBox*, size_t> m_gridItemsIndexesMap;
234 240
235 LayoutUnit m_minContentHeight { -1 }; 241 LayoutUnit m_minContentHeight { -1 };
236 LayoutUnit m_maxContentHeight { -1 }; 242 LayoutUnit m_maxContentHeight { -1 };
237 243
238 int m_smallestRowStart; 244 int m_smallestRowStart;
239 int m_smallestColumnStart; 245 int m_smallestColumnStart;
240 246
241 size_t m_autoRepeatColumns { 0 }; 247 size_t m_autoRepeatColumns { 0 };
242 size_t m_autoRepeatRows { 0 }; 248 size_t m_autoRepeatRows { 0 };
243 249
244 bool m_hasAnyOrthogonalChild; 250 bool m_hasAnyOrthogonalChild;
245 251
246 std::unique_ptr<OrderedTrackIndexSet> m_autoRepeatEmptyColumns { nullptr }; 252 std::unique_ptr<OrderedTrackIndexSet> m_autoRepeatEmptyColumns { nullptr };
247 std::unique_ptr<OrderedTrackIndexSet> m_autoRepeatEmptyRows { nullptr }; 253 std::unique_ptr<OrderedTrackIndexSet> m_autoRepeatEmptyRows { nullptr };
254
255 Optional<bool> m_hasDefiniteLogicalHeight;
248 }; 256 };
249 257
250 DEFINE_LAYOUT_OBJECT_TYPE_CASTS(LayoutGrid, isLayoutGrid()); 258 DEFINE_LAYOUT_OBJECT_TYPE_CASTS(LayoutGrid, isLayoutGrid());
251 259
252 } // namespace blink 260 } // namespace blink
253 261
254 #endif // LayoutGrid_h 262 #endif // LayoutGrid_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698