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

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

Issue 2337573003: [css-grid] Fix intrinsic size computation with flexible sized tracks (Closed)
Patch Set: Patch for landing 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/flex-and-intrinsic-sizes-expected.txt ('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 743 matching lines...) Expand 10 before | Expand all | Expand 10 after
754 } 754 }
755 755
756 for (const auto& trackIndex : flexibleSizedTracksIndex) { 756 for (const auto& trackIndex : flexibleSizedTracksIndex) {
757 GridTrackSize trackSize = gridTrackSize(direction, trackIndex); 757 GridTrackSize trackSize = gridTrackSize(direction, trackIndex);
758 758
759 LayoutUnit oldBaseSize = tracks[trackIndex].baseSize(); 759 LayoutUnit oldBaseSize = tracks[trackIndex].baseSize();
760 LayoutUnit baseSize = std::max(oldBaseSize, LayoutUnit(flexFraction * tr ackSize.maxTrackBreadth().flex())); 760 LayoutUnit baseSize = std::max(oldBaseSize, LayoutUnit(flexFraction * tr ackSize.maxTrackBreadth().flex()));
761 if (LayoutUnit increment = baseSize - oldBaseSize) { 761 if (LayoutUnit increment = baseSize - oldBaseSize) {
762 tracks[trackIndex].setBaseSize(baseSize); 762 tracks[trackIndex].setBaseSize(baseSize);
763 freeSpace -= increment; 763 freeSpace -= increment;
764
765 baseSizesWithoutMaximization += increment;
766 growthLimitsWithoutMaximization += increment; 764 growthLimitsWithoutMaximization += increment;
767 } 765 }
768 } 766 }
769 } 767 }
770 768
771 LayoutUnit LayoutGrid::computeUsedBreadthOfMinLength(const GridTrackSize& trackS ize, LayoutUnit maxSize) const 769 LayoutUnit LayoutGrid::computeUsedBreadthOfMinLength(const GridTrackSize& trackS ize, LayoutUnit maxSize) const
772 { 770 {
773 const GridLength& gridLength = trackSize.minTrackBreadth(); 771 const GridLength& gridLength = trackSize.minTrackBreadth();
774 if (gridLength.isFlex()) 772 if (gridLength.isFlex())
775 return LayoutUnit(); 773 return LayoutUnit();
(...skipping 1886 matching lines...) Expand 10 before | Expand all | Expand 10 after
2662 return isOrthogonalChild(child) ? childLocation.transposedPoint() : childLoc ation; 2660 return isOrthogonalChild(child) ? childLocation.transposedPoint() : childLoc ation;
2663 } 2661 }
2664 2662
2665 void LayoutGrid::paintChildren(const PaintInfo& paintInfo, const LayoutPoint& pa intOffset) const 2663 void LayoutGrid::paintChildren(const PaintInfo& paintInfo, const LayoutPoint& pa intOffset) const
2666 { 2664 {
2667 if (!m_gridItemArea.isEmpty()) 2665 if (!m_gridItemArea.isEmpty())
2668 GridPainter(*this).paintChildren(paintInfo, paintOffset); 2666 GridPainter(*this).paintChildren(paintInfo, paintOffset);
2669 } 2667 }
2670 2668
2671 } // namespace blink 2669 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/LayoutTests/fast/css-grid-layout/flex-and-intrinsic-sizes-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698