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

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

Issue 2154593003: [css-grid] Fix indefinite height detection (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: New version Created 4 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 799 matching lines...) Expand 10 before | Expand all | Expand 10 after
810 GridTrackSize LayoutGrid::gridTrackSize(GridTrackSizingDirection direction, size _t translatedIndex, SizingOperation sizingOperation) const 810 GridTrackSize LayoutGrid::gridTrackSize(GridTrackSizingDirection direction, size _t translatedIndex, SizingOperation sizingOperation) const
811 { 811 {
812 const GridTrackSize& trackSize = rawGridTrackSize(direction, translatedIndex ); 812 const GridTrackSize& trackSize = rawGridTrackSize(direction, translatedIndex );
813 813
814 GridLength minTrackBreadth = trackSize.minTrackBreadth(); 814 GridLength minTrackBreadth = trackSize.minTrackBreadth();
815 GridLength maxTrackBreadth = trackSize.maxTrackBreadth(); 815 GridLength maxTrackBreadth = trackSize.maxTrackBreadth();
816 816
817 // If the logical width/height of the grid container is indefinite, percenta ge values are treated as <auto>. 817 // If the logical width/height of the grid container is indefinite, percenta ge values are treated as <auto>.
818 if (minTrackBreadth.hasPercentage() || maxTrackBreadth.hasPercentage()) { 818 if (minTrackBreadth.hasPercentage() || maxTrackBreadth.hasPercentage()) {
819 // For the inline axis this only happens when we're computing the intrin sic sizes (AvailableSpaceIndefinite). 819 // For the inline axis this only happens when we're computing the intrin sic sizes (AvailableSpaceIndefinite).
820 // For the block axis we check that the percentage height is resolvable on the first in-flow child. 820 if ((sizingOperation == IntrinsicSizeComputation) || (direction == ForRo ws && !hasDefiniteLogicalHeight())) {
821 // TODO (lajava) This condition for determining whether a size is indefi nite or not is not working correctly for orthogonal flows.
822 if ((sizingOperation == IntrinsicSizeComputation) || (direction == ForRo ws && firstInFlowChildBox() && !firstInFlowChildBox()->percentageLogicalHeightIs Resolvable())) {
823 if (minTrackBreadth.hasPercentage()) 821 if (minTrackBreadth.hasPercentage())
824 minTrackBreadth = Length(Auto); 822 minTrackBreadth = Length(Auto);
825 if (maxTrackBreadth.hasPercentage()) 823 if (maxTrackBreadth.hasPercentage())
826 maxTrackBreadth = Length(Auto); 824 maxTrackBreadth = Length(Auto);
827 } 825 }
828 } 826 }
829 827
830 // Flex sizes are invalid as a min sizing function. However we still can hav e a flexible |minTrackBreadth| 828 // Flex sizes are invalid as a min sizing function. However we still can hav e a flexible |minTrackBreadth|
831 // if the track had a flex size directly (e.g. "1fr"), the spec says that in this case it implies an automatic minimum. 829 // if the track had a flex size directly (e.g. "1fr"), the spec says that in this case it implies an automatic minimum.
832 if (minTrackBreadth.isFlex()) 830 if (minTrackBreadth.isFlex())
(...skipping 1530 matching lines...) Expand 10 before | Expand all | Expand 10 after
2363 return isOrthogonalChild(child) ? childLocation.transposedPoint() : childLoc ation; 2361 return isOrthogonalChild(child) ? childLocation.transposedPoint() : childLoc ation;
2364 } 2362 }
2365 2363
2366 void LayoutGrid::paintChildren(const PaintInfo& paintInfo, const LayoutPoint& pa intOffset) const 2364 void LayoutGrid::paintChildren(const PaintInfo& paintInfo, const LayoutPoint& pa intOffset) const
2367 { 2365 {
2368 if (!m_gridItemArea.isEmpty()) 2366 if (!m_gridItemArea.isEmpty())
2369 GridPainter(*this).paintChildren(paintInfo, paintOffset); 2367 GridPainter(*this).paintChildren(paintInfo, paintOffset);
2370 } 2368 }
2371 2369
2372 } // namespace blink 2370 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698