| 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 18 matching lines...) Expand all Loading... |
| 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 | 38 |
| 39 typedef std::pair<RenderBox*, size_t> GridItemWithSpan; |
| 40 |
| 39 class RenderGrid FINAL : public RenderBlock { | 41 class RenderGrid FINAL : public RenderBlock { |
| 40 public: | 42 public: |
| 41 RenderGrid(Element*); | 43 RenderGrid(Element*); |
| 42 virtual ~RenderGrid(); | 44 virtual ~RenderGrid(); |
| 43 | 45 |
| 44 virtual const char* renderName() const OVERRIDE; | 46 virtual const char* renderName() const OVERRIDE; |
| 45 | 47 |
| 46 virtual void layoutBlock(bool relayoutChildren) OVERRIDE; | 48 virtual void layoutBlock(bool relayoutChildren) OVERRIDE; |
| 47 | 49 |
| 48 virtual bool canCollapseAnonymousBlockChild() const OVERRIDE { return false;
} | 50 virtual bool canCollapseAnonymousBlockChild() const OVERRIDE { return false;
} |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 87 GridTrackSizingDirection autoPlacementMajorAxisDirection() const; | 89 GridTrackSizingDirection autoPlacementMajorAxisDirection() const; |
| 88 GridTrackSizingDirection autoPlacementMinorAxisDirection() const; | 90 GridTrackSizingDirection autoPlacementMinorAxisDirection() const; |
| 89 | 91 |
| 90 void layoutGridItems(); | 92 void layoutGridItems(); |
| 91 void populateGridPositions(const GridSizingData&); | 93 void populateGridPositions(const GridSizingData&); |
| 92 | 94 |
| 93 typedef LayoutUnit (RenderGrid::* SizingFunction)(RenderBox*, GridTrackSizin
gDirection, Vector<GridTrack>&); | 95 typedef LayoutUnit (RenderGrid::* SizingFunction)(RenderBox*, GridTrackSizin
gDirection, Vector<GridTrack>&); |
| 94 typedef LayoutUnit (GridTrack::* AccumulatorGetter)() const; | 96 typedef LayoutUnit (GridTrack::* AccumulatorGetter)() const; |
| 95 typedef void (GridTrack::* AccumulatorGrowFunction)(LayoutUnit); | 97 typedef void (GridTrack::* AccumulatorGrowFunction)(LayoutUnit); |
| 96 typedef bool (GridTrackSize::* FilterFunction)() const; | 98 typedef bool (GridTrackSize::* FilterFunction)() const; |
| 97 void resolveContentBasedTrackSizingFunctionsForItems(GridTrackSizingDirectio
n, GridSizingData&, RenderBox*, FilterFunction, SizingFunction, AccumulatorGette
r, AccumulatorGrowFunction); | 99 void resolveContentBasedTrackSizingFunctionsForItems(GridTrackSizingDirectio
n, GridSizingData&, GridItemWithSpan&, FilterFunction, SizingFunction, Accumulat
orGetter, AccumulatorGrowFunction); |
| 98 void distributeSpaceToTracks(Vector<GridTrack*>&, Vector<GridTrack*>* tracks
ForGrowthAboveMaxBreadth, AccumulatorGetter, AccumulatorGrowFunction, GridSizing
Data&, LayoutUnit& availableLogicalSpace); | 100 void distributeSpaceToTracks(Vector<GridTrack*>&, Vector<GridTrack*>* tracks
ForGrowthAboveMaxBreadth, AccumulatorGetter, AccumulatorGrowFunction, GridSizing
Data&, LayoutUnit& availableLogicalSpace); |
| 99 | 101 |
| 100 double computeNormalizedFractionBreadth(Vector<GridTrack>&, const GridSpan&
tracksSpan, GridTrackSizingDirection, LayoutUnit availableLogicalSpace) const; | 102 double computeNormalizedFractionBreadth(Vector<GridTrack>&, const GridSpan&
tracksSpan, GridTrackSizingDirection, LayoutUnit availableLogicalSpace) const; |
| 101 | 103 |
| 102 const GridTrackSize& gridTrackSize(GridTrackSizingDirection, size_t) const; | 104 const GridTrackSize& gridTrackSize(GridTrackSizingDirection, size_t) const; |
| 103 | 105 |
| 104 LayoutUnit logicalHeightForChild(RenderBox*, Vector<GridTrack>&); | 106 LayoutUnit logicalHeightForChild(RenderBox*, Vector<GridTrack>&); |
| 105 LayoutUnit minContentForChild(RenderBox*, GridTrackSizingDirection, Vector<G
ridTrack>& columnTracks); | 107 LayoutUnit minContentForChild(RenderBox*, GridTrackSizingDirection, Vector<G
ridTrack>& columnTracks); |
| 106 LayoutUnit maxContentForChild(RenderBox*, GridTrackSizingDirection, Vector<G
ridTrack>& columnTracks); | 108 LayoutUnit maxContentForChild(RenderBox*, GridTrackSizingDirection, Vector<G
ridTrack>& columnTracks); |
| 107 LayoutUnit startOfColumnForChild(const RenderBox* child) const; | 109 LayoutUnit startOfColumnForChild(const RenderBox* child) const; |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 150 OrderIterator m_orderIterator; | 152 OrderIterator m_orderIterator; |
| 151 Vector<RenderBox*> m_gridItemsOverflowingGridArea; | 153 Vector<RenderBox*> m_gridItemsOverflowingGridArea; |
| 152 HashMap<const RenderBox*, size_t> m_gridItemsIndexesMap; | 154 HashMap<const RenderBox*, size_t> m_gridItemsIndexesMap; |
| 153 }; | 155 }; |
| 154 | 156 |
| 155 DEFINE_RENDER_OBJECT_TYPE_CASTS(RenderGrid, isRenderGrid()); | 157 DEFINE_RENDER_OBJECT_TYPE_CASTS(RenderGrid, isRenderGrid()); |
| 156 | 158 |
| 157 } // namespace blink | 159 } // namespace blink |
| 158 | 160 |
| 159 #endif // RenderGrid_h | 161 #endif // RenderGrid_h |
| OLD | NEW |