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

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: Use firstInFlowChildBox() 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
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 if ((sizingOperation == IntrinsicSizeComputation) || (direction == ForRows & & firstInFlowChildBox() && !firstInFlowChildBox()->percentageLogicalHeightIsReso lvable())) {
754 if (minTrackBreadth.hasPercentage()) 754 if (minTrackBreadth.hasPercentage())
755 minTrackBreadth = Length(Auto); 755 minTrackBreadth = Length(Auto);
756 if (maxTrackBreadth.hasPercentage()) 756 if (maxTrackBreadth.hasPercentage())
757 maxTrackBreadth = Length(Auto); 757 maxTrackBreadth = Length(Auto);
758 } 758 }
759 759
760 // Flex sizes are invalid as a min sizing function. However we still can hav e a flexible |minTrackBreadth| 760 // 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. 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 (minTrackBreadth.isFlex()) 762 if (minTrackBreadth.isFlex())
763 minTrackBreadth = Length(Auto); 763 minTrackBreadth = Length(Auto);
(...skipping 1484 matching lines...) Expand 10 before | Expand all | Expand 10 after
2248 return LayoutPoint(rowAxisOffset, columnAxisOffsetForChild(child, sizingData )); 2248 return LayoutPoint(rowAxisOffset, columnAxisOffsetForChild(child, sizingData ));
2249 } 2249 }
2250 2250
2251 void LayoutGrid::paintChildren(const PaintInfo& paintInfo, const LayoutPoint& pa intOffset) const 2251 void LayoutGrid::paintChildren(const PaintInfo& paintInfo, const LayoutPoint& pa intOffset) const
2252 { 2252 {
2253 if (!m_gridItemArea.isEmpty()) 2253 if (!m_gridItemArea.isEmpty())
2254 GridPainter(*this).paintChildren(paintInfo, paintOffset); 2254 GridPainter(*this).paintChildren(paintInfo, paintOffset);
2255 } 2255 }
2256 2256
2257 } // namespace blink 2257 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698