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 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
59 int paintIndexForGridItem(const RenderBox* renderBox) { return m_gridItemsIn dexesMap.get(renderBox); } | 59 int paintIndexForGridItem(const RenderBox* renderBox) { return m_gridItemsIn dexesMap.get(renderBox); } |
60 | 60 |
61 bool gridIsDirty() const { return m_gridIsDirty; } | 61 bool gridIsDirty() const { return m_gridIsDirty; } |
62 | 62 |
63 private: | 63 private: |
64 virtual bool isOfType(RenderObjectType type) const override { return type == RenderObjectRenderGrid || RenderBlock::isOfType(type); } | 64 virtual bool isOfType(RenderObjectType type) const override { return type == RenderObjectRenderGrid || RenderBlock::isOfType(type); } |
65 virtual void computeIntrinsicLogicalWidths(LayoutUnit& minLogicalWidth, Layo utUnit& maxLogicalWidth) const override; | 65 virtual void computeIntrinsicLogicalWidths(LayoutUnit& minLogicalWidth, Layo utUnit& maxLogicalWidth) const override; |
66 virtual void computePreferredLogicalWidths() override; | 66 virtual void computePreferredLogicalWidths() override; |
67 | 67 |
68 virtual void addChild(RenderObject* newChild, RenderObject* beforeChild = 0) override; | 68 virtual void addChild(RenderObject* newChild, RenderObject* beforeChild = 0) override; |
69 void addChildToIndexesMap(RenderBox&); | 69 void addChildToIndexesMap(RenderBox& child); |
Julien - ping for review
2015/01/05 13:11:34
Unneeded parameter (the name of the function makes
| |
70 virtual void removeChild(RenderObject*) override; | 70 virtual void removeChild(RenderObject*) override; |
71 | 71 |
72 virtual void styleDidChange(StyleDifference, const RenderStyle*) override; | 72 virtual void styleDidChange(StyleDifference, const RenderStyle*) override; |
73 | 73 |
74 bool explicitGridDidResize(const RenderStyle*) const; | 74 bool explicitGridDidResize(const RenderStyle*) const; |
75 bool namedGridLinesDefinitionDidChange(const RenderStyle*) const; | 75 bool namedGridLinesDefinitionDidChange(const RenderStyle*) const; |
76 | 76 |
77 class GridIterator; | 77 class GridIterator; |
78 struct GridSizingData; | 78 struct GridSizingData; |
79 bool gridElementIsShrinkToFit(); | 79 bool gridElementIsShrinkToFit(); |
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
150 { | 150 { |
151 ASSERT(!gridIsDirty()); | 151 ASSERT(!gridIsDirty()); |
152 return m_grid[0].size(); | 152 return m_grid[0].size(); |
153 } | 153 } |
154 size_t gridRowCount() const | 154 size_t gridRowCount() const |
155 { | 155 { |
156 ASSERT(!gridIsDirty()); | 156 ASSERT(!gridIsDirty()); |
157 return m_grid.size(); | 157 return m_grid.size(); |
158 } | 158 } |
159 | 159 |
160 bool hasAutoPlacedItems() const { return m_hasAutoPlacedItems; } | |
161 void setHasAutoPlacedItems() { m_hasAutoPlacedItems = true; } | |
162 | |
160 typedef Vector<Vector<GridCell> > GridRepresentation; | 163 typedef Vector<Vector<GridCell> > GridRepresentation; |
161 GridRepresentation m_grid; | 164 GridRepresentation m_grid; |
162 bool m_gridIsDirty; | 165 bool m_gridIsDirty; |
166 bool m_hasAutoPlacedItems; | |
163 Vector<LayoutUnit> m_rowPositions; | 167 Vector<LayoutUnit> m_rowPositions; |
164 Vector<LayoutUnit> m_columnPositions; | 168 Vector<LayoutUnit> m_columnPositions; |
165 HashMap<const RenderBox*, GridCoordinate> m_gridItemCoordinate; | 169 HashMap<const RenderBox*, GridCoordinate> m_gridItemCoordinate; |
166 OrderIterator m_orderIterator; | 170 OrderIterator m_orderIterator; |
167 Vector<RenderBox*> m_gridItemsOverflowingGridArea; | 171 Vector<RenderBox*> m_gridItemsOverflowingGridArea; |
168 HashMap<const RenderBox*, size_t> m_gridItemsIndexesMap; | 172 HashMap<const RenderBox*, size_t> m_gridItemsIndexesMap; |
169 }; | 173 }; |
170 | 174 |
171 DEFINE_RENDER_OBJECT_TYPE_CASTS(RenderGrid, isRenderGrid()); | 175 DEFINE_RENDER_OBJECT_TYPE_CASTS(RenderGrid, isRenderGrid()); |
172 | 176 |
173 } // namespace blink | 177 } // namespace blink |
174 | 178 |
175 #endif // RenderGrid_h | 179 #endif // RenderGrid_h |
OLD | NEW |