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 17 matching lines...) Expand all Loading... |
28 | 28 |
29 #include "core/rendering/OrderIterator.h" | 29 #include "core/rendering/OrderIterator.h" |
30 #include "core/rendering/RenderBlock.h" | 30 #include "core/rendering/RenderBlock.h" |
31 #include "core/rendering/style/GridResolvedPosition.h" | 31 #include "core/rendering/style/GridResolvedPosition.h" |
32 | 32 |
33 namespace blink { | 33 namespace blink { |
34 | 34 |
35 struct GridCoordinate; | 35 struct GridCoordinate; |
36 struct GridSpan; | 36 struct GridSpan; |
37 class GridTrack; | 37 class GridTrack; |
| 38 class GridItemWithSpan; |
38 | 39 |
39 class RenderGrid FINAL : public RenderBlock { | 40 class RenderGrid FINAL : public RenderBlock { |
40 public: | 41 public: |
41 RenderGrid(Element*); | 42 RenderGrid(Element*); |
42 virtual ~RenderGrid(); | 43 virtual ~RenderGrid(); |
43 | 44 |
44 virtual const char* renderName() const OVERRIDE; | 45 virtual const char* renderName() const OVERRIDE; |
45 | 46 |
46 virtual void layoutBlock(bool relayoutChildren) OVERRIDE; | 47 virtual void layoutBlock(bool relayoutChildren) OVERRIDE; |
47 | 48 |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
94 GridTrackSizingDirection autoPlacementMajorAxisDirection() const; | 95 GridTrackSizingDirection autoPlacementMajorAxisDirection() const; |
95 GridTrackSizingDirection autoPlacementMinorAxisDirection() const; | 96 GridTrackSizingDirection autoPlacementMinorAxisDirection() const; |
96 | 97 |
97 void layoutGridItems(); | 98 void layoutGridItems(); |
98 void populateGridPositions(const GridSizingData&); | 99 void populateGridPositions(const GridSizingData&); |
99 | 100 |
100 typedef LayoutUnit (RenderGrid::* SizingFunction)(RenderBox&, GridTrackSizin
gDirection, Vector<GridTrack>&); | 101 typedef LayoutUnit (RenderGrid::* SizingFunction)(RenderBox&, GridTrackSizin
gDirection, Vector<GridTrack>&); |
101 typedef LayoutUnit (GridTrack::* AccumulatorGetter)() const; | 102 typedef LayoutUnit (GridTrack::* AccumulatorGetter)() const; |
102 typedef void (GridTrack::* AccumulatorGrowFunction)(LayoutUnit); | 103 typedef void (GridTrack::* AccumulatorGrowFunction)(LayoutUnit); |
103 typedef bool (GridTrackSize::* FilterFunction)() const; | 104 typedef bool (GridTrackSize::* FilterFunction)() const; |
104 void resolveContentBasedTrackSizingFunctionsForItems(GridTrackSizingDirectio
n, GridSizingData&, RenderBox&, FilterFunction, SizingFunction, AccumulatorGette
r, AccumulatorGrowFunction); | 105 void resolveContentBasedTrackSizingFunctionsForItems(GridTrackSizingDirectio
n, GridSizingData&, GridItemWithSpan&, FilterFunction, SizingFunction, Accumulat
orGetter, AccumulatorGrowFunction); |
105 void distributeSpaceToTracks(Vector<GridTrack*>&, Vector<GridTrack*>* tracks
ForGrowthAboveMaxBreadth, AccumulatorGetter, AccumulatorGrowFunction, GridSizing
Data&, LayoutUnit& availableLogicalSpace); | 106 void distributeSpaceToTracks(Vector<GridTrack*>&, Vector<GridTrack*>* tracks
ForGrowthAboveMaxBreadth, AccumulatorGetter, AccumulatorGrowFunction, GridSizing
Data&, LayoutUnit& availableLogicalSpace); |
106 | 107 |
107 double computeNormalizedFractionBreadth(Vector<GridTrack>&, const GridSpan&
tracksSpan, GridTrackSizingDirection, LayoutUnit availableLogicalSpace) const; | 108 double computeNormalizedFractionBreadth(Vector<GridTrack>&, const GridSpan&
tracksSpan, GridTrackSizingDirection, LayoutUnit availableLogicalSpace) const; |
108 | 109 |
109 GridTrackSize gridTrackSize(GridTrackSizingDirection, size_t) const; | 110 GridTrackSize gridTrackSize(GridTrackSizingDirection, size_t) const; |
110 | 111 |
111 LayoutUnit logicalHeightForChild(RenderBox&, Vector<GridTrack>&); | 112 LayoutUnit logicalHeightForChild(RenderBox&, Vector<GridTrack>&); |
112 LayoutUnit minContentForChild(RenderBox&, GridTrackSizingDirection, Vector<G
ridTrack>& columnTracks); | 113 LayoutUnit minContentForChild(RenderBox&, GridTrackSizingDirection, Vector<G
ridTrack>& columnTracks); |
113 LayoutUnit maxContentForChild(RenderBox&, GridTrackSizingDirection, Vector<G
ridTrack>& columnTracks); | 114 LayoutUnit maxContentForChild(RenderBox&, GridTrackSizingDirection, Vector<G
ridTrack>& columnTracks); |
114 LayoutUnit startOfColumnForChild(const RenderBox& child) const; | 115 LayoutUnit startOfColumnForChild(const RenderBox& child) const; |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
154 OrderIterator m_orderIterator; | 155 OrderIterator m_orderIterator; |
155 Vector<RenderBox*> m_gridItemsOverflowingGridArea; | 156 Vector<RenderBox*> m_gridItemsOverflowingGridArea; |
156 HashMap<const RenderBox*, size_t> m_gridItemsIndexesMap; | 157 HashMap<const RenderBox*, size_t> m_gridItemsIndexesMap; |
157 }; | 158 }; |
158 | 159 |
159 DEFINE_RENDER_OBJECT_TYPE_CASTS(RenderGrid, isRenderGrid()); | 160 DEFINE_RENDER_OBJECT_TYPE_CASTS(RenderGrid, isRenderGrid()); |
160 | 161 |
161 } // namespace blink | 162 } // namespace blink |
162 | 163 |
163 #endif // RenderGrid_h | 164 #endif // RenderGrid_h |
OLD | NEW |