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

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

Issue 2135703002: [css-grid] Fix crash when using auto repeat for indefinite widths (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Test improvements 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
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 113 matching lines...) Expand 10 before | Expand all | Expand 10 after
124 void computeUsedBreadthOfGridTracks(GridTrackSizingDirection, GridSizingData &, LayoutUnit& baseSizesWithoutMaximization, LayoutUnit& growthLimitsWithoutMaxi mization); 124 void computeUsedBreadthOfGridTracks(GridTrackSizingDirection, GridSizingData &, LayoutUnit& baseSizesWithoutMaximization, LayoutUnit& growthLimitsWithoutMaxi mization);
125 LayoutUnit computeUsedBreadthOfMinLength(const GridLength&, LayoutUnit maxBr eadth) const; 125 LayoutUnit computeUsedBreadthOfMinLength(const GridLength&, LayoutUnit maxBr eadth) const;
126 LayoutUnit computeUsedBreadthOfMaxLength(const GridLength&, LayoutUnit usedB readth, LayoutUnit maxBreadth) const; 126 LayoutUnit computeUsedBreadthOfMaxLength(const GridLength&, LayoutUnit usedB readth, LayoutUnit maxBreadth) const;
127 void resolveContentBasedTrackSizingFunctions(GridTrackSizingDirection, GridS izingData&); 127 void resolveContentBasedTrackSizingFunctions(GridTrackSizingDirection, GridS izingData&);
128 128
129 void ensureGridSize(size_t maximumRowSize, size_t maximumColumnSize); 129 void ensureGridSize(size_t maximumRowSize, size_t maximumColumnSize);
130 void insertItemIntoGrid(LayoutBox&, const GridArea&); 130 void insertItemIntoGrid(LayoutBox&, const GridArea&);
131 131
132 size_t computeAutoRepeatTracksCount(GridTrackSizingDirection) const; 132 size_t computeAutoRepeatTracksCount(GridTrackSizingDirection) const;
133 133
134 void placeItemsOnGrid(); 134 void placeItemsOnGrid(SizingOperation);
135 void populateExplicitGridAndOrderIterator(); 135 void populateExplicitGridAndOrderIterator();
136 std::unique_ptr<GridArea> createEmptyGridAreaAtSpecifiedPositionsOutsideGrid (const LayoutBox&, GridTrackSizingDirection, const GridSpan& specifiedPositions) const; 136 std::unique_ptr<GridArea> createEmptyGridAreaAtSpecifiedPositionsOutsideGrid (const LayoutBox&, GridTrackSizingDirection, const GridSpan& specifiedPositions) const;
137 void placeSpecifiedMajorAxisItemsOnGrid(const Vector<LayoutBox*>&); 137 void placeSpecifiedMajorAxisItemsOnGrid(const Vector<LayoutBox*>&);
138 void placeAutoMajorAxisItemsOnGrid(const Vector<LayoutBox*>&); 138 void placeAutoMajorAxisItemsOnGrid(const Vector<LayoutBox*>&);
139 void placeAutoMajorAxisItemOnGrid(LayoutBox&, std::pair<size_t, size_t>& aut oPlacementCursor); 139 void placeAutoMajorAxisItemOnGrid(LayoutBox&, std::pair<size_t, size_t>& aut oPlacementCursor);
140 GridTrackSizingDirection autoPlacementMajorAxisDirection() const; 140 GridTrackSizingDirection autoPlacementMajorAxisDirection() const;
141 GridTrackSizingDirection autoPlacementMinorAxisDirection() const; 141 GridTrackSizingDirection autoPlacementMinorAxisDirection() const;
142 142
143 void computeIntrinsicLogicalHeight(GridSizingData&); 143 void computeIntrinsicLogicalHeight(GridSizingData&);
144 LayoutUnit computeTrackBasedLogicalHeight(const GridSizingData&) const; 144 LayoutUnit computeTrackBasedLogicalHeight(const GridSizingData&) const;
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
202 202
203 size_t gridItemSpan(const LayoutBox&, GridTrackSizingDirection); 203 size_t gridItemSpan(const LayoutBox&, GridTrackSizingDirection);
204 bool spanningItemCrossesFlexibleSizedTracks(const GridSpan&, GridTrackSizing Direction, SizingOperation) const; 204 bool spanningItemCrossesFlexibleSizedTracks(const GridSpan&, GridTrackSizing Direction, SizingOperation) const;
205 205
206 size_t gridColumnCount() const; 206 size_t gridColumnCount() const;
207 size_t gridRowCount() const; 207 size_t gridRowCount() const;
208 208
209 bool isOrthogonalChild(const LayoutBox&) const; 209 bool isOrthogonalChild(const LayoutBox&) const;
210 GridTrackSizingDirection flowAwareDirectionForChild(const LayoutBox&, GridTr ackSizingDirection) const; 210 GridTrackSizingDirection flowAwareDirectionForChild(const LayoutBox&, GridTr ackSizingDirection) const;
211 211
212 void clearGridDataAndMarkAsDirty() const;
jfernandez 2016/07/11 12:52:22 Why const ?
svillar 2016/07/11 14:18:43 Because it's called inside computeIntrinsicLogical
213
212 typedef Vector<Vector<GridCell>> GridRepresentation; 214 typedef Vector<Vector<GridCell>> GridRepresentation;
213 GridRepresentation m_grid; 215 mutable GridRepresentation m_grid;
eae 2016/07/12 17:38:48 A const clear method and mutable non-cache data me
214 bool m_gridIsDirty; 216 mutable bool m_gridIsDirty;
215 Vector<LayoutUnit> m_rowPositions; 217 Vector<LayoutUnit> m_rowPositions;
216 Vector<LayoutUnit> m_columnPositions; 218 Vector<LayoutUnit> m_columnPositions;
217 LayoutUnit m_offsetBetweenColumns; 219 LayoutUnit m_offsetBetweenColumns;
218 LayoutUnit m_offsetBetweenRows; 220 LayoutUnit m_offsetBetweenRows;
219 HashMap<const LayoutBox*, GridArea> m_gridItemArea; 221 mutable HashMap<const LayoutBox*, GridArea> m_gridItemArea;
220 OrderIterator m_orderIterator; 222 OrderIterator m_orderIterator;
221 Vector<LayoutBox*> m_gridItemsOverflowingGridArea; 223 mutable Vector<LayoutBox*> m_gridItemsOverflowingGridArea;
222 HashMap<const LayoutBox*, size_t> m_gridItemsIndexesMap; 224 mutable HashMap<const LayoutBox*, size_t> m_gridItemsIndexesMap;
223 225
224 LayoutUnit m_minContentHeight { -1 }; 226 LayoutUnit m_minContentHeight { -1 };
225 LayoutUnit m_maxContentHeight { -1 }; 227 LayoutUnit m_maxContentHeight { -1 };
226 228
227 int m_smallestRowStart; 229 int m_smallestRowStart;
228 int m_smallestColumnStart; 230 int m_smallestColumnStart;
229 231
230 size_t m_autoRepeatColumns { 0 }; 232 mutable size_t m_autoRepeatColumns { 0 };
231 size_t m_autoRepeatRows { 0 }; 233 mutable size_t m_autoRepeatRows { 0 };
232 234
233 bool m_hasAnyOrthogonalChild; 235 bool m_hasAnyOrthogonalChild;
234 }; 236 };
235 237
236 DEFINE_LAYOUT_OBJECT_TYPE_CASTS(LayoutGrid, isLayoutGrid()); 238 DEFINE_LAYOUT_OBJECT_TYPE_CASTS(LayoutGrid, isLayoutGrid());
237 239
238 } // namespace blink 240 } // namespace blink
239 241
240 #endif // LayoutGrid_h 242 #endif // LayoutGrid_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698