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

Side by Side Diff: third_party/WebKit/Source/core/layout/LayoutGrid.h

Issue 1854623002: [css-grid] Use the margin box for non auto minimum sizes (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Patch for landing Created 4 years, 8 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 130 matching lines...) Expand 10 before | Expand all | Expand 10 after
141 void resolveContentBasedTrackSizingFunctionsForNonSpanningItems(GridTrackSiz ingDirection, const GridSpan&, LayoutBox& gridItem, GridTrack&, GridSizingData&) ; 141 void resolveContentBasedTrackSizingFunctionsForNonSpanningItems(GridTrackSiz ingDirection, const GridSpan&, LayoutBox& gridItem, GridTrack&, GridSizingData&) ;
142 template <TrackSizeComputationPhase> void resolveContentBasedTrackSizingFunc tionsForItems(GridTrackSizingDirection, GridSizingData&, const GridItemsSpanGrou pRange&); 142 template <TrackSizeComputationPhase> void resolveContentBasedTrackSizingFunc tionsForItems(GridTrackSizingDirection, GridSizingData&, const GridItemsSpanGrou pRange&);
143 template <TrackSizeComputationPhase> void distributeSpaceToTracks(Vector<Gri dTrack*>&, const Vector<GridTrack*>* growBeyondGrowthLimitsTracks, GridSizingDat a&, LayoutUnit& availableLogicalSpace); 143 template <TrackSizeComputationPhase> void distributeSpaceToTracks(Vector<Gri dTrack*>&, const Vector<GridTrack*>* growBeyondGrowthLimitsTracks, GridSizingDat a&, LayoutUnit& availableLogicalSpace);
144 144
145 typedef HashSet<size_t, DefaultHash<size_t>::Hash, WTF::UnsignedWithZeroKeyH ashTraits<size_t>> TrackIndexSet; 145 typedef HashSet<size_t, DefaultHash<size_t>::Hash, WTF::UnsignedWithZeroKeyH ashTraits<size_t>> TrackIndexSet;
146 double computeFlexFactorUnitSize(const Vector<GridTrack>&, GridTrackSizingDi rection, double flexFactorSum, LayoutUnit& leftOverSpace, const Vector<size_t, 8 >& flexibleTracksIndexes, PassOwnPtr<TrackIndexSet> tracksToTreatAsInflexible = nullptr) const; 146 double computeFlexFactorUnitSize(const Vector<GridTrack>&, GridTrackSizingDi rection, double flexFactorSum, LayoutUnit& leftOverSpace, const Vector<size_t, 8 >& flexibleTracksIndexes, PassOwnPtr<TrackIndexSet> tracksToTreatAsInflexible = nullptr) const;
147 double findFlexFactorUnitSize(const Vector<GridTrack>&, const GridSpan&, Gri dTrackSizingDirection, LayoutUnit leftOverSpace) const; 147 double findFlexFactorUnitSize(const Vector<GridTrack>&, const GridSpan&, Gri dTrackSizingDirection, LayoutUnit leftOverSpace) const;
148 148
149 GridTrackSize gridTrackSize(GridTrackSizingDirection, size_t) const; 149 GridTrackSize gridTrackSize(GridTrackSizingDirection, size_t) const;
150 150
151 bool updateOverrideContainingBlockContentLogicalWidthForChild(LayoutBox&, Gr idSizingData&);
151 LayoutUnit logicalHeightForChild(LayoutBox&, GridSizingData&); 152 LayoutUnit logicalHeightForChild(LayoutBox&, GridSizingData&);
152 LayoutUnit minSizeForChild(LayoutBox&, GridTrackSizingDirection, GridSizingD ata&); 153 LayoutUnit minSizeForChild(LayoutBox&, GridTrackSizingDirection, GridSizingD ata&);
153 LayoutUnit minContentForChild(LayoutBox&, GridTrackSizingDirection, GridSizi ngData&); 154 LayoutUnit minContentForChild(LayoutBox&, GridTrackSizingDirection, GridSizi ngData&);
154 LayoutUnit maxContentForChild(LayoutBox&, GridTrackSizingDirection, GridSizi ngData&); 155 LayoutUnit maxContentForChild(LayoutBox&, GridTrackSizingDirection, GridSizi ngData&);
155 GridAxisPosition columnAxisPositionForChild(const LayoutBox&) const; 156 GridAxisPosition columnAxisPositionForChild(const LayoutBox&) const;
156 GridAxisPosition rowAxisPositionForChild(const LayoutBox&) const; 157 GridAxisPosition rowAxisPositionForChild(const LayoutBox&) const;
157 LayoutUnit rowAxisOffsetForChild(const LayoutBox&, GridSizingData&) const; 158 LayoutUnit rowAxisOffsetForChild(const LayoutBox&, GridSizingData&) const;
158 LayoutUnit columnAxisOffsetForChild(const LayoutBox&, GridSizingData&) const ; 159 LayoutUnit columnAxisOffsetForChild(const LayoutBox&, GridSizingData&) const ;
159 ContentAlignmentData computeContentPositionAndDistributionOffset(GridTrackSi zingDirection, const LayoutUnit& availableFreeSpace, unsigned numberOfGridTracks ) const; 160 ContentAlignmentData computeContentPositionAndDistributionOffset(GridTrackSi zingDirection, const LayoutUnit& availableFreeSpace, unsigned numberOfGridTracks ) const;
160 LayoutPoint findChildLogicalPosition(const LayoutBox&, GridSizingData&) cons t; 161 LayoutPoint findChildLogicalPosition(const LayoutBox&, GridSizingData&) cons t;
161 GridArea cachedGridArea(const LayoutBox&) const; 162 GridArea cachedGridArea(const LayoutBox&) const;
162 GridSpan cachedGridSpan(const LayoutBox&, GridTrackSizingDirection) const; 163 GridSpan cachedGridSpan(const LayoutBox&, GridTrackSizingDirection) const;
163 164
164 LayoutUnit gridAreaBreadthForChild(const LayoutBox& child, GridTrackSizingDi rection, const Vector<GridTrack>&) const; 165 LayoutUnit gridAreaBreadthForChild(const LayoutBox& child, GridTrackSizingDi rection, const Vector<GridTrack>&) const;
165 LayoutUnit gridAreaBreadthForChildIncludingAlignmentOffsets(const LayoutBox& , GridTrackSizingDirection, const GridSizingData&) const; 166 LayoutUnit gridAreaBreadthForChildIncludingAlignmentOffsets(const LayoutBox& , GridTrackSizingDirection, const GridSizingData&) const;
166 167
167 void applyStretchAlignmentToTracksIfNeeded(GridTrackSizingDirection, GridSiz ingData&); 168 void applyStretchAlignmentToTracksIfNeeded(GridTrackSizingDirection, GridSiz ingData&);
168 169
169 void paintChildren(const PaintInfo&, const LayoutPoint&) const override; 170 void paintChildren(const PaintInfo&, const LayoutPoint&) const override;
170 171
171 LayoutUnit marginLogicalHeightForChild(const LayoutBox&) const; 172 LayoutUnit marginLogicalHeightForChild(const LayoutBox&) const;
172 LayoutUnit computeMarginLogicalHeightForChild(const LayoutBox&) const; 173 LayoutUnit computeMarginLogicalSizeForChild(MarginDirection, const LayoutBox &) const;
173 LayoutUnit availableAlignmentSpaceForChildBeforeStretching(LayoutUnit gridAr eaBreadthForChild, const LayoutBox&) const; 174 LayoutUnit availableAlignmentSpaceForChildBeforeStretching(LayoutUnit gridAr eaBreadthForChild, const LayoutBox&) const;
174 void applyStretchAlignmentToChildIfNeeded(LayoutBox&); 175 void applyStretchAlignmentToChildIfNeeded(LayoutBox&);
175 bool hasAutoMarginsInColumnAxis(const LayoutBox&) const; 176 bool hasAutoMarginsInColumnAxis(const LayoutBox&) const;
176 bool hasAutoMarginsInRowAxis(const LayoutBox&) const; 177 bool hasAutoMarginsInRowAxis(const LayoutBox&) const;
177 void updateAutoMarginsInColumnAxisIfNeeded(LayoutBox&); 178 void updateAutoMarginsInColumnAxisIfNeeded(LayoutBox&);
178 void updateAutoMarginsInRowAxisIfNeeded(LayoutBox&); 179 void updateAutoMarginsInRowAxisIfNeeded(LayoutBox&);
179 180
180 #if ENABLE(ASSERT) 181 #if ENABLE(ASSERT)
181 bool tracksAreWiderThanMinTrackBreadth(GridTrackSizingDirection, GridSizingD ata&); 182 bool tracksAreWiderThanMinTrackBreadth(GridTrackSizingDirection, GridSizingD ata&);
182 #endif 183 #endif
(...skipping 29 matching lines...) Expand all
212 213
213 int m_smallestRowStart; 214 int m_smallestRowStart;
214 int m_smallestColumnStart; 215 int m_smallestColumnStart;
215 }; 216 };
216 217
217 DEFINE_LAYOUT_OBJECT_TYPE_CASTS(LayoutGrid, isLayoutGrid()); 218 DEFINE_LAYOUT_OBJECT_TYPE_CASTS(LayoutGrid, isLayoutGrid());
218 219
219 } // namespace blink 220 } // namespace blink
220 221
221 #endif // LayoutGrid_h 222 #endif // LayoutGrid_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698