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

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

Issue 2037383002: [css-grid] Fix definite/indefinite size detection on block axis (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@fix-percentage-widths
Patch Set: Patch for landing Created 4 years, 6 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/Source/core/layout/LayoutBox.cpp ('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 732 matching lines...) Expand 10 before | Expand all | Expand 10 after
743 743
744 GridTrackSize LayoutGrid::gridTrackSize(GridTrackSizingDirection direction, size _t translatedIndex, SizingOperation sizingOperation) const 744 GridTrackSize LayoutGrid::gridTrackSize(GridTrackSizingDirection direction, size _t translatedIndex, SizingOperation sizingOperation) const
745 { 745 {
746 const GridTrackSize& trackSize = rawGridTrackSize(direction, translatedIndex ); 746 const GridTrackSize& trackSize = rawGridTrackSize(direction, translatedIndex );
747 747
748 GridLength minTrackBreadth = trackSize.minTrackBreadth(); 748 GridLength minTrackBreadth = trackSize.minTrackBreadth();
749 GridLength maxTrackBreadth = trackSize.maxTrackBreadth(); 749 GridLength maxTrackBreadth = trackSize.maxTrackBreadth();
750 750
751 // If the logical width/height of the grid container is indefinite, percenta ge values are treated as <auto>. 751 // If the logical width/height of the grid container is indefinite, percenta ge values are treated as <auto>.
752 // For the inline axis this only happens when we're computing the intrinsic sizes (AvailableSpaceIndefinite). 752 // For the inline axis this only happens when we're computing the intrinsic sizes (AvailableSpaceIndefinite).
753 if (sizingOperation == IntrinsicSizeComputation || (direction == ForRows && !hasDefiniteLogicalHeight())) { 753 // For the block axis we check that the percentage height is resolvable on t he first in-flow child.
754 if ((sizingOperation == IntrinsicSizeComputation) || (direction == ForRows & & firstInFlowChildBox() && !firstInFlowChildBox()->percentageLogicalHeightIsReso lvable())) {
754 if (minTrackBreadth.hasPercentage()) 755 if (minTrackBreadth.hasPercentage())
755 minTrackBreadth = Length(Auto); 756 minTrackBreadth = Length(Auto);
756 if (maxTrackBreadth.hasPercentage()) 757 if (maxTrackBreadth.hasPercentage())
757 maxTrackBreadth = Length(Auto); 758 maxTrackBreadth = Length(Auto);
758 } 759 }
759 760
760 // Flex sizes are invalid as a min sizing function. However we still can hav e a flexible |minTrackBreadth| 761 // Flex sizes are invalid as a min sizing function. However we still can hav e a flexible |minTrackBreadth|
761 // if the track had a flex size directly (e.g. "1fr"), the spec says that in this case it implies an automatic minimum. 762 // if the track had a flex size directly (e.g. "1fr"), the spec says that in this case it implies an automatic minimum.
762 if (minTrackBreadth.isFlex()) 763 if (minTrackBreadth.isFlex())
763 minTrackBreadth = Length(Auto); 764 minTrackBreadth = Length(Auto);
(...skipping 1484 matching lines...) Expand 10 before | Expand all | Expand 10 after
2248 return LayoutPoint(rowAxisOffset, columnAxisOffsetForChild(child, sizingData )); 2249 return LayoutPoint(rowAxisOffset, columnAxisOffsetForChild(child, sizingData ));
2249 } 2250 }
2250 2251
2251 void LayoutGrid::paintChildren(const PaintInfo& paintInfo, const LayoutPoint& pa intOffset) const 2252 void LayoutGrid::paintChildren(const PaintInfo& paintInfo, const LayoutPoint& pa intOffset) const
2252 { 2253 {
2253 if (!m_gridItemArea.isEmpty()) 2254 if (!m_gridItemArea.isEmpty())
2254 GridPainter(*this).paintChildren(paintInfo, paintOffset); 2255 GridPainter(*this).paintChildren(paintInfo, paintOffset);
2255 } 2256 }
2256 2257
2257 } // namespace blink 2258 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/layout/LayoutBox.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698