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

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: Avoid overflow, since width is auto. Created 5 years, 5 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 136 matching lines...) Expand 10 before | Expand all | Expand 10 after
147 LayoutUnit columnPositionForChild(const LayoutBox&) const; 147 LayoutUnit columnPositionForChild(const LayoutBox&) const;
148 LayoutUnit rowPositionForChild(const LayoutBox&) const; 148 LayoutUnit rowPositionForChild(const LayoutBox&) const;
149 void computeContentPositionAndDistributionRowOffset(LayoutUnit availableFree Space, GridSizingData&) const; 149 void computeContentPositionAndDistributionRowOffset(LayoutUnit availableFree Space, GridSizingData&) const;
150 void computeContentPositionAndDistributionColumnOffset(LayoutUnit availableF reeSpace, GridSizingData&) const; 150 void computeContentPositionAndDistributionColumnOffset(LayoutUnit availableF reeSpace, GridSizingData&) 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 155
156 virtual void paintChildren(const PaintInfo&, const LayoutPoint&) override; 156 virtual void paintChildren(const PaintInfo&, const LayoutPoint&) override;
157 bool allowedToStretchLogicalHeightForChild(const LayoutBox& child) const; 157 bool hasAutoSizeInColumnAxisForChild(const LayoutBox&) const;
158 bool hasAutoSizeInRowAxisForChild(const LayoutBox&) const;
159 bool allowedToStretchChildAlongColumnAxis(const LayoutBox&) const;
160 bool allowedToStretchChildAlongRowAxis(const LayoutBox&) const;
158 bool needToStretchChildLogicalHeight(const LayoutBox&) const; 161 bool needToStretchChildLogicalHeight(const LayoutBox&) const;
159 LayoutUnit childIntrinsicHeight(const LayoutBox&) const; 162 LayoutUnit childIntrinsicHeight(const LayoutBox&) const;
160 LayoutUnit childIntrinsicWidth(const LayoutBox&) const; 163 LayoutUnit childIntrinsicWidth(const LayoutBox&) const;
161 LayoutUnit intrinsicLogicalHeightForChild(const LayoutBox&) const; 164 LayoutUnit intrinsicLogicalHeightForChild(const LayoutBox&) const;
162 LayoutUnit marginLogicalHeightForChild(const LayoutBox&) const; 165 LayoutUnit marginLogicalHeightForChild(const LayoutBox&) const;
163 LayoutUnit computeMarginLogicalHeightForChild(const LayoutBox&) const; 166 LayoutUnit computeMarginLogicalHeightForChild(const LayoutBox&) const;
164 LayoutUnit availableAlignmentSpaceForChildBeforeStretching(LayoutUnit gridAr eaBreadthForChild, const LayoutBox&) const; 167 LayoutUnit availableAlignmentSpaceForChildBeforeStretching(LayoutUnit gridAr eaBreadthForChild, const LayoutBox&) const;
165 void applyStretchAlignmentToChildIfNeeded(LayoutBox&, LayoutUnit gridAreaBre adthForChild); 168 void applyStretchAlignmentToChildIfNeeded(LayoutBox&);
166 169
167 #if ENABLE(ASSERT) 170 #if ENABLE(ASSERT)
168 bool tracksAreWiderThanMinTrackBreadth(GridTrackSizingDirection, const Vecto r<GridTrack>&); 171 bool tracksAreWiderThanMinTrackBreadth(GridTrackSizingDirection, const Vecto r<GridTrack>&);
169 #endif 172 #endif
170 173
171 size_t gridItemSpan(const LayoutBox&, GridTrackSizingDirection); 174 size_t gridItemSpan(const LayoutBox&, GridTrackSizingDirection);
172 bool spanningItemCrossesFlexibleSizedTracks(const GridCoordinate&, GridTrack SizingDirection) const; 175 bool spanningItemCrossesFlexibleSizedTracks(const GridCoordinate&, GridTrack SizingDirection) const;
173 176
174 size_t gridColumnCount() const 177 size_t gridColumnCount() const
175 { 178 {
(...skipping 17 matching lines...) Expand all
193 OrderIterator m_orderIterator; 196 OrderIterator m_orderIterator;
194 Vector<LayoutBox*> m_gridItemsOverflowingGridArea; 197 Vector<LayoutBox*> m_gridItemsOverflowingGridArea;
195 HashMap<const LayoutBox*, size_t> m_gridItemsIndexesMap; 198 HashMap<const LayoutBox*, size_t> m_gridItemsIndexesMap;
196 }; 199 };
197 200
198 DEFINE_LAYOUT_OBJECT_TYPE_CASTS(LayoutGrid, isLayoutGrid()); 201 DEFINE_LAYOUT_OBJECT_TYPE_CASTS(LayoutGrid, isLayoutGrid());
199 202
200 } // namespace blink 203 } // namespace blink
201 204
202 #endif // LayoutGrid_h 205 #endif // LayoutGrid_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698