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

Side by Side Diff: Source/core/rendering/RenderGrid.h

Issue 592803003: [CSS Grid Layout] Size tracks using a list of all items sorted by span (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 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 17 matching lines...) Expand all
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 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
87 GridTrackSizingDirection autoPlacementMajorAxisDirection() const; 88 GridTrackSizingDirection autoPlacementMajorAxisDirection() const;
88 GridTrackSizingDirection autoPlacementMinorAxisDirection() const; 89 GridTrackSizingDirection autoPlacementMinorAxisDirection() const;
89 90
90 void layoutGridItems(); 91 void layoutGridItems();
91 void populateGridPositions(const GridSizingData&); 92 void populateGridPositions(const GridSizingData&);
92 93
93 typedef LayoutUnit (RenderGrid::* SizingFunction)(RenderBox&, GridTrackSizin gDirection, Vector<GridTrack>&); 94 typedef LayoutUnit (RenderGrid::* SizingFunction)(RenderBox&, GridTrackSizin gDirection, Vector<GridTrack>&);
94 typedef LayoutUnit (GridTrack::* AccumulatorGetter)() const; 95 typedef LayoutUnit (GridTrack::* AccumulatorGetter)() const;
95 typedef void (GridTrack::* AccumulatorGrowFunction)(LayoutUnit); 96 typedef void (GridTrack::* AccumulatorGrowFunction)(LayoutUnit);
96 typedef bool (GridTrackSize::* FilterFunction)() const; 97 typedef bool (GridTrackSize::* FilterFunction)() const;
97 void resolveContentBasedTrackSizingFunctionsForItems(GridTrackSizingDirectio n, GridSizingData&, RenderBox&, FilterFunction, SizingFunction, AccumulatorGette r, AccumulatorGrowFunction); 98 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); 99 void distributeSpaceToTracks(Vector<GridTrack*>&, Vector<GridTrack*>* tracks ForGrowthAboveMaxBreadth, AccumulatorGetter, AccumulatorGrowFunction, GridSizing Data&, LayoutUnit& availableLogicalSpace);
99 100
100 double computeNormalizedFractionBreadth(Vector<GridTrack>&, const GridSpan& tracksSpan, GridTrackSizingDirection, LayoutUnit availableLogicalSpace) const; 101 double computeNormalizedFractionBreadth(Vector<GridTrack>&, const GridSpan& tracksSpan, GridTrackSizingDirection, LayoutUnit availableLogicalSpace) const;
101 102
102 const GridTrackSize& gridTrackSize(GridTrackSizingDirection, size_t) const; 103 const GridTrackSize& gridTrackSize(GridTrackSizingDirection, size_t) const;
103 104
104 LayoutUnit logicalHeightForChild(RenderBox&, Vector<GridTrack>&); 105 LayoutUnit logicalHeightForChild(RenderBox&, Vector<GridTrack>&);
105 LayoutUnit minContentForChild(RenderBox&, GridTrackSizingDirection, Vector<G ridTrack>& columnTracks); 106 LayoutUnit minContentForChild(RenderBox&, GridTrackSizingDirection, Vector<G ridTrack>& columnTracks);
106 LayoutUnit maxContentForChild(RenderBox&, GridTrackSizingDirection, Vector<G ridTrack>& columnTracks); 107 LayoutUnit maxContentForChild(RenderBox&, GridTrackSizingDirection, Vector<G ridTrack>& columnTracks);
107 LayoutUnit startOfColumnForChild(const RenderBox& child) const; 108 LayoutUnit startOfColumnForChild(const RenderBox& child) const;
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
150 OrderIterator m_orderIterator; 151 OrderIterator m_orderIterator;
151 Vector<RenderBox*> m_gridItemsOverflowingGridArea; 152 Vector<RenderBox*> m_gridItemsOverflowingGridArea;
152 HashMap<const RenderBox*, size_t> m_gridItemsIndexesMap; 153 HashMap<const RenderBox*, size_t> m_gridItemsIndexesMap;
153 }; 154 };
154 155
155 DEFINE_RENDER_OBJECT_TYPE_CASTS(RenderGrid, isRenderGrid()); 156 DEFINE_RENDER_OBJECT_TYPE_CASTS(RenderGrid, isRenderGrid());
156 157
157 } // namespace blink 158 } // namespace blink
158 159
159 #endif // RenderGrid_h 160 #endif // RenderGrid_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698