OLD | NEW |
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 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
84 void insertItemIntoGrid(RenderBox*, const GridCoordinate&); | 84 void insertItemIntoGrid(RenderBox*, const GridCoordinate&); |
85 void placeItemsOnGrid(); | 85 void placeItemsOnGrid(); |
86 void populateExplicitGridAndOrderIterator(); | 86 void populateExplicitGridAndOrderIterator(); |
87 void placeSpecifiedMajorAxisItemsOnGrid(Vector<RenderBox*>); | 87 void placeSpecifiedMajorAxisItemsOnGrid(Vector<RenderBox*>); |
88 void placeAutoMajorAxisItemsOnGrid(Vector<RenderBox*>); | 88 void placeAutoMajorAxisItemsOnGrid(Vector<RenderBox*>); |
89 void placeAutoMajorAxisItemOnGrid(RenderBox*); | 89 void placeAutoMajorAxisItemOnGrid(RenderBox*); |
90 TrackSizingDirection autoPlacementMajorAxisDirection() const; | 90 TrackSizingDirection autoPlacementMajorAxisDirection() const; |
91 TrackSizingDirection autoPlacementMinorAxisDirection() const; | 91 TrackSizingDirection autoPlacementMinorAxisDirection() const; |
92 | 92 |
93 void layoutGridItems(); | 93 void layoutGridItems(); |
| 94 void populateGridPositions(const Vector<GridTrack>& columnTracks, const Vect
or<GridTrack>& rowTracks); |
94 | 95 |
95 virtual bool supportsPartialLayout() const OVERRIDE { return false; } | 96 virtual bool supportsPartialLayout() const OVERRIDE { return false; } |
96 | 97 |
97 typedef LayoutUnit (RenderGrid::* SizingFunction)(RenderBox*, TrackSizingDir
ection, Vector<GridTrack>&); | 98 typedef LayoutUnit (RenderGrid::* SizingFunction)(RenderBox*, TrackSizingDir
ection, Vector<GridTrack>&); |
98 typedef LayoutUnit (GridTrack::* AccumulatorGetter)() const; | 99 typedef LayoutUnit (GridTrack::* AccumulatorGetter)() const; |
99 typedef void (GridTrack::* AccumulatorGrowFunction)(LayoutUnit); | 100 typedef void (GridTrack::* AccumulatorGrowFunction)(LayoutUnit); |
100 typedef bool (GridTrackSize::* FilterFunction)() const; | 101 typedef bool (GridTrackSize::* FilterFunction)() const; |
101 void resolveContentBasedTrackSizingFunctionsForItems(TrackSizingDirection, V
ector<GridTrack>& columnTracks, Vector<GridTrack>& rowTracks, RenderBox*, Filter
Function, SizingFunction, AccumulatorGetter, AccumulatorGrowFunction); | 102 void resolveContentBasedTrackSizingFunctionsForItems(TrackSizingDirection, V
ector<GridTrack>& columnTracks, Vector<GridTrack>& rowTracks, RenderBox*, Filter
Function, SizingFunction, AccumulatorGetter, AccumulatorGrowFunction); |
102 void distributeSpaceToTracks(Vector<GridTrack*>&, Vector<GridTrack*>* tracks
ForGrowthAboveMaxBreadth, AccumulatorGetter, AccumulatorGrowFunction, LayoutUnit
& availableLogicalSpace); | 103 void distributeSpaceToTracks(Vector<GridTrack*>&, Vector<GridTrack*>* tracks
ForGrowthAboveMaxBreadth, AccumulatorGetter, AccumulatorGrowFunction, LayoutUnit
& availableLogicalSpace); |
103 | 104 |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
141 size_t gridRowCount() const | 142 size_t gridRowCount() const |
142 { | 143 { |
143 ASSERT(!gridIsDirty()); | 144 ASSERT(!gridIsDirty()); |
144 return m_grid.size(); | 145 return m_grid.size(); |
145 } | 146 } |
146 | 147 |
147 typedef Vector<RenderBox*, 1> GridCell; | 148 typedef Vector<RenderBox*, 1> GridCell; |
148 typedef Vector<Vector<GridCell> > GridRepresentation; | 149 typedef Vector<Vector<GridCell> > GridRepresentation; |
149 GridRepresentation m_grid; | 150 GridRepresentation m_grid; |
150 bool m_gridIsDirty; | 151 bool m_gridIsDirty; |
| 152 Vector<LayoutUnit> m_rowPositions; |
| 153 Vector<LayoutUnit> m_columnPositions; |
151 HashMap<const RenderBox*, GridCoordinate> m_gridItemCoordinate; | 154 HashMap<const RenderBox*, GridCoordinate> m_gridItemCoordinate; |
152 OrderIterator m_orderIterator; | 155 OrderIterator m_orderIterator; |
153 }; | 156 }; |
154 | 157 |
155 inline RenderGrid* toRenderGrid(RenderObject* object) | 158 inline RenderGrid* toRenderGrid(RenderObject* object) |
156 { | 159 { |
157 ASSERT_WITH_SECURITY_IMPLICATION(!object || object->isRenderGrid()); | 160 ASSERT_WITH_SECURITY_IMPLICATION(!object || object->isRenderGrid()); |
158 return static_cast<RenderGrid*>(object); | 161 return static_cast<RenderGrid*>(object); |
159 } | 162 } |
160 | 163 |
161 inline const RenderGrid* toRenderGrid(const RenderObject* object) | 164 inline const RenderGrid* toRenderGrid(const RenderObject* object) |
162 { | 165 { |
163 ASSERT_WITH_SECURITY_IMPLICATION(!object || object->isRenderGrid()); | 166 ASSERT_WITH_SECURITY_IMPLICATION(!object || object->isRenderGrid()); |
164 return static_cast<const RenderGrid*>(object); | 167 return static_cast<const RenderGrid*>(object); |
165 } | 168 } |
166 | 169 |
167 // Catch unneeded cast. | 170 // Catch unneeded cast. |
168 void toRenderGrid(const RenderGrid*); | 171 void toRenderGrid(const RenderGrid*); |
169 | 172 |
170 } // namespace WebCore | 173 } // namespace WebCore |
171 | 174 |
172 #endif // RenderGrid_h | 175 #endif // RenderGrid_h |
OLD | NEW |