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

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

Issue 2304543002: [css-grid] Fix definite height detection for auto-repet tracks (Closed)
Patch Set: Created 4 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
« no previous file with comments | « third_party/WebKit/LayoutTests/fast/css-grid-layout/grid-auto-repeat-positioned-container-expected.html ('k') | no next file » | 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 417 matching lines...) Expand 10 before | Expand all | Expand 10 after
428 SubtreeLayoutScope layoutScope(*this); 428 SubtreeLayoutScope layoutScope(*this);
429 429
430 { 430 {
431 // LayoutState needs this deliberate scope to pop before updating scroll information (which 431 // LayoutState needs this deliberate scope to pop before updating scroll information (which
432 // may trigger relayout). 432 // may trigger relayout).
433 LayoutState state(*this, locationOffset()); 433 LayoutState state(*this, locationOffset());
434 434
435 LayoutSize previousSize = size(); 435 LayoutSize previousSize = size();
436 436
437 updateLogicalWidth(); 437 updateLogicalWidth();
438 bool logicalHeightWasIndefinite = computeContentLogicalHeight(MainOrPref erredSize, style()->logicalHeight(), LayoutUnit(-1)) == LayoutUnit(-1); 438 bool logicalHeightWasIndefinite = !hasDefiniteLogicalHeight();
439 439
440 TextAutosizer::LayoutScope textAutosizerLayoutScope(this, &layoutScope); 440 TextAutosizer::LayoutScope textAutosizerLayoutScope(this, &layoutScope);
441 441
442 // TODO(svillar): we won't need to do this once the intrinsic width comp utation is isolated 442 // TODO(svillar): we won't need to do this once the intrinsic width comp utation is isolated
443 // from the LayoutGrid object state (it should not touch any attribute) (see crbug.com/627812) 443 // from the LayoutGrid object state (it should not touch any attribute) (see crbug.com/627812)
444 if (m_autoRepeatColumns && m_autoRepeatColumns != computeAutoRepeatTrack sCount(ForColumns, TrackSizing)) 444 if (m_autoRepeatColumns && m_autoRepeatColumns != computeAutoRepeatTrack sCount(ForColumns, TrackSizing))
445 dirtyGrid(); 445 dirtyGrid();
446 placeItemsOnGrid(TrackSizing); 446 placeItemsOnGrid(TrackSizing);
447 447
448 GridSizingData sizingData(gridColumnCount(), gridRowCount()); 448 GridSizingData sizingData(gridColumnCount(), gridRowCount());
(...skipping 938 matching lines...) Expand 10 before | Expand all | Expand 10 after
1387 const auto& autoRepeatTracks = isRowAxis ? styleRef().gridAutoRepeatColumns( ) : styleRef().gridAutoRepeatRows(); 1387 const auto& autoRepeatTracks = isRowAxis ? styleRef().gridAutoRepeatColumns( ) : styleRef().gridAutoRepeatRows();
1388 size_t autoRepeatTrackListLength = autoRepeatTracks.size(); 1388 size_t autoRepeatTrackListLength = autoRepeatTracks.size();
1389 1389
1390 if (!autoRepeatTrackListLength) 1390 if (!autoRepeatTrackListLength)
1391 return 0; 1391 return 0;
1392 1392
1393 LayoutUnit availableSize; 1393 LayoutUnit availableSize;
1394 if (isRowAxis) { 1394 if (isRowAxis) {
1395 availableSize = sizingOperation == IntrinsicSizeComputation ? LayoutUnit (-1) : availableLogicalWidth(); 1395 availableSize = sizingOperation == IntrinsicSizeComputation ? LayoutUnit (-1) : availableLogicalWidth();
1396 } else { 1396 } else {
1397 availableSize = computeContentLogicalHeight(MainOrPreferredSize, styleRe f().logicalHeight(), LayoutUnit(-1)); 1397 availableSize = availableLogicalHeightForPercentageComputation();
1398 if (availableSize == -1) { 1398 if (availableSize == -1) {
1399 const Length& maxLength = styleRef().logicalMaxHeight(); 1399 const Length& maxLength = styleRef().logicalMaxHeight();
1400 if (!maxLength.isMaxSizeNone()) 1400 if (!maxLength.isMaxSizeNone())
1401 availableSize = computeContentLogicalHeight(MaxSize, maxLength, LayoutUnit(-1)); 1401 availableSize = computeContentLogicalHeight(MaxSize, maxLength, LayoutUnit(-1));
1402 } else { 1402 } else {
1403 availableSize = constrainLogicalHeightByMinMax(availableSize, Layout Unit(-1)); 1403 availableSize = constrainLogicalHeightByMinMax(availableSize, Layout Unit(-1));
1404 } 1404 }
1405 } 1405 }
1406 1406
1407 bool needsToFulfillMinimumSize = false; 1407 bool needsToFulfillMinimumSize = false;
(...skipping 1192 matching lines...) Expand 10 before | Expand all | Expand 10 after
2600 return isOrthogonalChild(child) ? childLocation.transposedPoint() : childLoc ation; 2600 return isOrthogonalChild(child) ? childLocation.transposedPoint() : childLoc ation;
2601 } 2601 }
2602 2602
2603 void LayoutGrid::paintChildren(const PaintInfo& paintInfo, const LayoutPoint& pa intOffset) const 2603 void LayoutGrid::paintChildren(const PaintInfo& paintInfo, const LayoutPoint& pa intOffset) const
2604 { 2604 {
2605 if (!m_gridItemArea.isEmpty()) 2605 if (!m_gridItemArea.isEmpty())
2606 GridPainter(*this).paintChildren(paintInfo, paintOffset); 2606 GridPainter(*this).paintChildren(paintInfo, paintOffset);
2607 } 2607 }
2608 2608
2609 } // namespace blink 2609 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/LayoutTests/fast/css-grid-layout/grid-auto-repeat-positioned-container-expected.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698