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

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

Issue 1228983003: [CSS Grid Layout] Do not stretch always grid items with auto width (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Applied suggested changes. Created 5 years, 4 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
« no previous file with comments | « Source/core/layout/LayoutBox.cpp ('k') | Source/core/layout/LayoutGrid.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 139 matching lines...) Expand 10 before | Expand all | Expand 10 after
150 ContentAlignmentData computeContentPositionAndDistributionOffset(GridTrackSi zingDirection, LayoutUnit availableFreeSpace, unsigned numberOfGridTracks) const ; 150 ContentAlignmentData computeContentPositionAndDistributionOffset(GridTrackSi zingDirection, LayoutUnit availableFreeSpace, unsigned numberOfGridTracks) const ;
151 LayoutPoint findChildLogicalPosition(const LayoutBox&, GridSizingData&) cons t; 151 LayoutPoint findChildLogicalPosition(const LayoutBox&, GridSizingData&) cons t;
152 GridCoordinate cachedGridCoordinate(const LayoutBox&) const; 152 GridCoordinate cachedGridCoordinate(const LayoutBox&) const;
153 153
154 LayoutUnit gridAreaBreadthForChild(const LayoutBox& child, GridTrackSizingDi rection, const Vector<GridTrack>&) const; 154 LayoutUnit gridAreaBreadthForChild(const LayoutBox& child, GridTrackSizingDi rection, const Vector<GridTrack>&) const;
155 LayoutUnit gridAreaBreadthForChildIncludingAlignmentOffsets(const LayoutBox& , GridTrackSizingDirection, const GridSizingData&) const; 155 LayoutUnit gridAreaBreadthForChildIncludingAlignmentOffsets(const LayoutBox& , GridTrackSizingDirection, const GridSizingData&) const;
156 156
157 void applyStretchAlignmentToTracksIfNeeded(GridTrackSizingDirection, GridSiz ingData&, LayoutUnit availableSpace); 157 void applyStretchAlignmentToTracksIfNeeded(GridTrackSizingDirection, GridSiz ingData&, LayoutUnit availableSpace);
158 158
159 void paintChildren(const PaintInfo&, const LayoutPoint&) override; 159 void paintChildren(const PaintInfo&, const LayoutPoint&) override;
160 bool allowedToStretchLogicalHeightForChild(const LayoutBox& child) const; 160
161 bool needToStretchChildLogicalHeight(const LayoutBox&) const; 161 bool needToStretchChildLogicalHeight(const LayoutBox&) const;
162 LayoutUnit childIntrinsicHeight(const LayoutBox&) const; 162 LayoutUnit childIntrinsicHeight(const LayoutBox&) const;
163 LayoutUnit childIntrinsicWidth(const LayoutBox&) const; 163 LayoutUnit childIntrinsicWidth(const LayoutBox&) const;
164 LayoutUnit intrinsicLogicalHeightForChild(const LayoutBox&) const; 164 LayoutUnit intrinsicLogicalHeightForChild(const LayoutBox&) const;
165 LayoutUnit marginLogicalHeightForChild(const LayoutBox&) const; 165 LayoutUnit marginLogicalHeightForChild(const LayoutBox&) const;
166 LayoutUnit computeMarginLogicalHeightForChild(const LayoutBox&) const; 166 LayoutUnit computeMarginLogicalHeightForChild(const LayoutBox&) const;
167 LayoutUnit availableAlignmentSpaceForChildBeforeStretching(LayoutUnit gridAr eaBreadthForChild, const LayoutBox&) const; 167 LayoutUnit availableAlignmentSpaceForChildBeforeStretching(LayoutUnit gridAr eaBreadthForChild, const LayoutBox&) const;
168 void applyStretchAlignmentToChildIfNeeded(LayoutBox&, LayoutUnit gridAreaBre adthForChild); 168 void applyStretchAlignmentToChildIfNeeded(LayoutBox&);
169 169
170 #if ENABLE(ASSERT) 170 #if ENABLE(ASSERT)
171 bool tracksAreWiderThanMinTrackBreadth(GridTrackSizingDirection, const Vecto r<GridTrack>&); 171 bool tracksAreWiderThanMinTrackBreadth(GridTrackSizingDirection, const Vecto r<GridTrack>&);
172 #endif 172 #endif
173 173
174 size_t gridItemSpan(const LayoutBox&, GridTrackSizingDirection); 174 size_t gridItemSpan(const LayoutBox&, GridTrackSizingDirection);
175 bool spanningItemCrossesFlexibleSizedTracks(const GridCoordinate&, GridTrack SizingDirection) const; 175 bool spanningItemCrossesFlexibleSizedTracks(const GridCoordinate&, GridTrack SizingDirection) const;
176 176
177 size_t gridColumnCount() const 177 size_t gridColumnCount() const
178 { 178 {
(...skipping 17 matching lines...) Expand all
196 OrderIterator m_orderIterator; 196 OrderIterator m_orderIterator;
197 Vector<LayoutBox*> m_gridItemsOverflowingGridArea; 197 Vector<LayoutBox*> m_gridItemsOverflowingGridArea;
198 HashMap<const LayoutBox*, size_t> m_gridItemsIndexesMap; 198 HashMap<const LayoutBox*, size_t> m_gridItemsIndexesMap;
199 }; 199 };
200 200
201 DEFINE_LAYOUT_OBJECT_TYPE_CASTS(LayoutGrid, isLayoutGrid()); 201 DEFINE_LAYOUT_OBJECT_TYPE_CASTS(LayoutGrid, isLayoutGrid());
202 202
203 } // namespace blink 203 } // namespace blink
204 204
205 #endif // LayoutGrid_h 205 #endif // LayoutGrid_h
OLDNEW
« no previous file with comments | « Source/core/layout/LayoutBox.cpp ('k') | Source/core/layout/LayoutGrid.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698