Changeset 145758 in webkit
- Timestamp:
- Mar 13, 2013 2:50:11 PM (11 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r145750 r145758 1 2013-03-13 Julien Chaffraix <jchaffraix@webkit.org> 2 3 [CSS Grid Layout] Handle min-width / max-width on the grid element 4 https://bugs.webkit.org/show_bug.cgi?id=112269 5 6 Reviewed by Ojan Vafai. 7 8 * fast/css-grid-layout/grid-element-min-max-width-expected.txt: Added. 9 * fast/css-grid-layout/grid-element-min-max-width.html: Added. 10 1 11 2013-03-13 Tao Bai <michaelbai@chromium.org> 2 12 -
trunk/Source/WebCore/ChangeLog
r145756 r145758 1 2013-03-13 Julien Chaffraix <jchaffraix@webkit.org> 2 3 [CSS Grid Layout] Handle min-width / max-width on the grid element 4 https://bugs.webkit.org/show_bug.cgi?id=112269 5 6 Reviewed by Ojan Vafai. 7 8 Test: fast/css-grid-layout/grid-element-min-max-width.html 9 10 * rendering/RenderGrid.cpp: 11 (WebCore::RenderGrid::GridIterator::GridIterator): 12 Added some sanity checks that the starting indexes are in the grid. 13 14 (WebCore::RenderGrid::computeIntrinsicLogicalWidths): 15 Updated the code to use m_grid to iterate: this is the correct way to 16 go as it will handle implicit rows / columns properly. Added a comment 17 about the current way being inefficient and incorrect with spanning grid 18 items. 19 20 (WebCore::RenderGrid::computePreferredLogicalWidths): 21 Updated the comments. 22 23 (WebCore::RenderGrid::gridTrackSize): 24 * rendering/RenderGrid.h: 25 Constified gridTrackSize. 26 1 27 2013-03-13 Simon Hausmann <simon.hausmann@digia.com> 2 28 -
trunk/Source/WebCore/rendering/RenderGrid.cpp
r145378 r145758 79 79 , m_childIndex(0) 80 80 { 81 ASSERT(m_rowIndex < m_grid.size()); 82 ASSERT(m_columnIndex < m_grid[0].size()); 81 83 } 82 84 … … 191 193 const_cast<RenderGrid*>(this)->placeItemsOnGrid(); 192 194 193 const Vector<GridTrackSize>& trackStyles = style()->gridColumns(); 194 for (size_t i = 0; i < trackStyles.size(); ++i) { 195 LayoutUnit minTrackBreadth = computePreferredTrackWidth(trackStyles[i].minTrackBreadth(), i); 196 LayoutUnit maxTrackBreadth = computePreferredTrackWidth(trackStyles[i].maxTrackBreadth(), i); 195 // FIXME: This is an inefficient way to fill our sizes as it will try every grid areas, when we would 196 // only want to account for fixed grid tracks and grid items. Also this will be incorrect if we have spanning 197 // grid items. 198 for (size_t i = 0; i < gridColumnCount(); ++i) { 199 const GridTrackSize& trackSize = gridTrackSize(ForColumns, i); 200 LayoutUnit minTrackBreadth = computePreferredTrackWidth(trackSize.minTrackBreadth(), i); 201 LayoutUnit maxTrackBreadth = computePreferredTrackWidth(trackSize.maxTrackBreadth(), i); 197 202 maxTrackBreadth = std::max(maxTrackBreadth, minTrackBreadth); 198 203 … … 213 218 m_maxPreferredLogicalWidth = 0; 214 219 215 // FIXME: We don't take our own logical width into account. 220 // FIXME: We don't take our own logical width into account. Once we do, we need to make sure 221 // we apply (and test the interaction with) min-width / max-width. 222 216 223 computeIntrinsicLogicalWidths(m_minPreferredLogicalWidth, m_maxPreferredLogicalWidth); 217 // FIXME: We should account for min / max logical width.218 224 219 225 LayoutUnit borderAndPaddingInInlineDirection = borderAndPaddingLogicalWidth(); … … 317 323 } 318 324 319 const GridTrackSize& RenderGrid::gridTrackSize(TrackSizingDirection direction, size_t i) 325 const GridTrackSize& RenderGrid::gridTrackSize(TrackSizingDirection direction, size_t i) const 320 326 { 321 327 const Vector<GridTrackSize>& trackStyles = (direction == ForColumns) ? style()->gridColumns() : style()->gridRows(); -
trunk/Source/WebCore/rendering/RenderGrid.h
r145378 r145758 108 108 void distributeSpaceToTracks(Vector<GridTrack*>&, Vector<GridTrack*>* tracksForGrowthAboveMaxBreadth, AccumulatorGetter, AccumulatorGrowFunction, LayoutUnit& availableLogicalSpace); 109 109 110 const GridTrackSize& gridTrackSize(TrackSizingDirection, size_t) ;110 const GridTrackSize& gridTrackSize(TrackSizingDirection, size_t) const; 111 111 size_t maximumIndexInDirection(TrackSizingDirection) const; 112 112
Note: See TracChangeset
for help on using the changeset viewer.