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

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

Issue 1317643005: [css-grid] Fix track sizing algo w/ size restrictions and intrinsic sizes (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 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 87 matching lines...) Expand 10 before | Expand all | Expand 10 after
98 void addChild(LayoutObject* newChild, LayoutObject* beforeChild = nullptr) o verride; 98 void addChild(LayoutObject* newChild, LayoutObject* beforeChild = nullptr) o verride;
99 void removeChild(LayoutObject*) override; 99 void removeChild(LayoutObject*) override;
100 100
101 void styleDidChange(StyleDifference, const ComputedStyle*) override; 101 void styleDidChange(StyleDifference, const ComputedStyle*) override;
102 102
103 bool explicitGridDidResize(const ComputedStyle&) const; 103 bool explicitGridDidResize(const ComputedStyle&) const;
104 bool namedGridLinesDefinitionDidChange(const ComputedStyle&) const; 104 bool namedGridLinesDefinitionDidChange(const ComputedStyle&) const;
105 105
106 class GridIterator; 106 class GridIterator;
107 struct GridSizingData; 107 struct GridSizingData;
108 bool gridElementIsShrinkToFit();
109 void computeUsedBreadthOfGridTracks(GridTrackSizingDirection, GridSizingData &, LayoutUnit& availableLogicalSpace); 108 void computeUsedBreadthOfGridTracks(GridTrackSizingDirection, GridSizingData &, LayoutUnit& availableLogicalSpace);
110 LayoutUnit computeUsedBreadthOfMinLength(GridTrackSizingDirection, const Gri dLength&) const; 109 LayoutUnit computeUsedBreadthOfMinLength(GridTrackSizingDirection, const Gri dLength&) const;
111 LayoutUnit computeUsedBreadthOfMaxLength(GridTrackSizingDirection, const Gri dLength&, LayoutUnit usedBreadth) const; 110 LayoutUnit computeUsedBreadthOfMaxLength(GridTrackSizingDirection, const Gri dLength&, LayoutUnit usedBreadth) const;
112 LayoutUnit computeUsedBreadthOfSpecifiedLength(GridTrackSizingDirection, con st Length&) const; 111 LayoutUnit computeUsedBreadthOfSpecifiedLength(GridTrackSizingDirection, con st Length&) const;
113 void resolveContentBasedTrackSizingFunctions(GridTrackSizingDirection, GridS izingData&); 112 void resolveContentBasedTrackSizingFunctions(GridTrackSizingDirection, GridS izingData&);
114 113
115 void ensureGridSize(size_t maximumRowIndex, size_t maximumColumnIndex); 114 void ensureGridSize(size_t maximumRowIndex, size_t maximumColumnIndex);
116 void insertItemIntoGrid(LayoutBox&, const GridCoordinate&); 115 void insertItemIntoGrid(LayoutBox&, const GridCoordinate&);
117 void placeItemsOnGrid(); 116 void placeItemsOnGrid();
118 void populateExplicitGridAndOrderIterator(); 117 void populateExplicitGridAndOrderIterator();
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
179 ASSERT(!m_gridIsDirty); 178 ASSERT(!m_gridIsDirty);
180 return m_grid[0].size(); 179 return m_grid[0].size();
181 } 180 }
182 size_t gridRowCount() const 181 size_t gridRowCount() const
183 { 182 {
184 ASSERT(!m_gridIsDirty); 183 ASSERT(!m_gridIsDirty);
185 return m_grid.size(); 184 return m_grid.size();
186 } 185 }
187 186
188 bool hasDefiniteLogicalSize(GridTrackSizingDirection) const; 187 bool hasDefiniteLogicalSize(GridTrackSizingDirection) const;
188 void maximizeTracks(Vector<GridTrack>&, GridSizingData&, LayoutUnit& spaceTo Distribute);
189 189
190 typedef Vector<Vector<GridCell>> GridRepresentation; 190 typedef Vector<Vector<GridCell>> GridRepresentation;
191 GridRepresentation m_grid; 191 GridRepresentation m_grid;
192 bool m_gridIsDirty; 192 bool m_gridIsDirty;
193 Vector<LayoutUnit> m_rowPositions; 193 Vector<LayoutUnit> m_rowPositions;
194 Vector<LayoutUnit> m_columnPositions; 194 Vector<LayoutUnit> m_columnPositions;
195 HashMap<const LayoutBox*, GridCoordinate> m_gridItemCoordinate; 195 HashMap<const LayoutBox*, GridCoordinate> m_gridItemCoordinate;
196 OrderIterator m_orderIterator; 196 OrderIterator m_orderIterator;
197 Vector<LayoutBox*> m_gridItemsOverflowingGridArea; 197 Vector<LayoutBox*> m_gridItemsOverflowingGridArea;
198 HashMap<const LayoutBox*, size_t> m_gridItemsIndexesMap; 198 HashMap<const LayoutBox*, size_t> m_gridItemsIndexesMap;
199 }; 199 };
200 200
201 DEFINE_LAYOUT_OBJECT_TYPE_CASTS(LayoutGrid, isLayoutGrid()); 201 DEFINE_LAYOUT_OBJECT_TYPE_CASTS(LayoutGrid, isLayoutGrid());
202 202
203 } // namespace blink 203 } // namespace blink
204 204
205 #endif // LayoutGrid_h 205 #endif // LayoutGrid_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698