| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 |
| OLD | NEW |