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

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: Fix fast/table/003.html test 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 800 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 // For the block axis we check that the percentage height is resolvable on the first in-flow child.
821 // TODO (lajava) This condition for determining whether a size is indefi nite or not is not working correctly for orthogonal flows. 821 if ((sizingOperation == IntrinsicSizeComputation) || (direction == ForRo ws && !hasDefiniteLogicalHeight())) {
822 if ((sizingOperation == IntrinsicSizeComputation) || (direction == ForRo ws && firstInFlowChildBox() && !firstInFlowChildBox()->percentageLogicalHeightIs Resolvable())) {
823 if (minTrackBreadth.hasPercentage()) 822 if (minTrackBreadth.hasPercentage())
824 minTrackBreadth = Length(Auto); 823 minTrackBreadth = Length(Auto);
825 if (maxTrackBreadth.hasPercentage()) 824 if (maxTrackBreadth.hasPercentage())
826 maxTrackBreadth = Length(Auto); 825 maxTrackBreadth = Length(Auto);
827 } 826 }
828 } 827 }
829 828
830 // Flex sizes are invalid as a min sizing function. However we still can hav e a flexible |minTrackBreadth| 829 // 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. 830 // 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()) 831 if (minTrackBreadth.isFlex())
(...skipping 1530 matching lines...) Expand 10 before | Expand all | Expand 10 after
2363 return isOrthogonalChild(child) ? childLocation.transposedPoint() : childLoc ation; 2362 return isOrthogonalChild(child) ? childLocation.transposedPoint() : childLoc ation;
2364 } 2363 }
2365 2364
2366 void LayoutGrid::paintChildren(const PaintInfo& paintInfo, const LayoutPoint& pa intOffset) const 2365 void LayoutGrid::paintChildren(const PaintInfo& paintInfo, const LayoutPoint& pa intOffset) const
2367 { 2366 {
2368 if (!m_gridItemArea.isEmpty()) 2367 if (!m_gridItemArea.isEmpty())
2369 GridPainter(*this).paintChildren(paintInfo, paintOffset); 2368 GridPainter(*this).paintChildren(paintInfo, paintOffset);
2370 } 2369 }
2371 2370
2372 } // namespace blink 2371 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698