| 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 731 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 742 } | 742 } |
| 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 if (minTrackBreadth.hasPercentage() || maxTrackBreadth.hasPercentage()) { |
| 753 // For the block axis we check that the percentage height is resolvable on t
he first in-flow child. | 753 // For the inline axis this only happens when we're computing the intrin
sic sizes (AvailableSpaceIndefinite). |
| 754 if ((sizingOperation == IntrinsicSizeComputation) || (direction == ForRows &
& firstInFlowChildBox() && !firstInFlowChildBox()->percentageLogicalHeightIsReso
lvable())) { | 754 // For the block axis we check that the percentage height is resolvable
on the first in-flow child. |
| 755 if (minTrackBreadth.hasPercentage()) | 755 if ((sizingOperation == IntrinsicSizeComputation) || (direction == ForRo
ws && firstInFlowChildBox() && !firstInFlowChildBox()->percentageLogicalHeightIs
Resolvable())) { |
| 756 minTrackBreadth = Length(Auto); | 756 if (minTrackBreadth.hasPercentage()) |
| 757 if (maxTrackBreadth.hasPercentage()) | 757 minTrackBreadth = Length(Auto); |
| 758 maxTrackBreadth = Length(Auto); | 758 if (maxTrackBreadth.hasPercentage()) |
| 759 maxTrackBreadth = Length(Auto); |
| 760 } |
| 759 } | 761 } |
| 760 | 762 |
| 761 // Flex sizes are invalid as a min sizing function. However we still can hav
e a flexible |minTrackBreadth| | 763 // Flex sizes are invalid as a min sizing function. However we still can hav
e a flexible |minTrackBreadth| |
| 762 // if the track had a flex size directly (e.g. "1fr"), the spec says that in
this case it implies an automatic minimum. | 764 // if the track had a flex size directly (e.g. "1fr"), the spec says that in
this case it implies an automatic minimum. |
| 763 if (minTrackBreadth.isFlex()) | 765 if (minTrackBreadth.isFlex()) |
| 764 minTrackBreadth = Length(Auto); | 766 minTrackBreadth = Length(Auto); |
| 765 | 767 |
| 766 return GridTrackSize(minTrackBreadth, maxTrackBreadth); | 768 return GridTrackSize(minTrackBreadth, maxTrackBreadth); |
| 767 } | 769 } |
| 768 | 770 |
| (...skipping 1480 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2249 return LayoutPoint(rowAxisOffset, columnAxisOffsetForChild(child, sizingData
)); | 2251 return LayoutPoint(rowAxisOffset, columnAxisOffsetForChild(child, sizingData
)); |
| 2250 } | 2252 } |
| 2251 | 2253 |
| 2252 void LayoutGrid::paintChildren(const PaintInfo& paintInfo, const LayoutPoint& pa
intOffset) const | 2254 void LayoutGrid::paintChildren(const PaintInfo& paintInfo, const LayoutPoint& pa
intOffset) const |
| 2253 { | 2255 { |
| 2254 if (!m_gridItemArea.isEmpty()) | 2256 if (!m_gridItemArea.isEmpty()) |
| 2255 GridPainter(*this).paintChildren(paintInfo, paintOffset); | 2257 GridPainter(*this).paintChildren(paintInfo, paintOffset); |
| 2256 } | 2258 } |
| 2257 | 2259 |
| 2258 } // namespace blink | 2260 } // namespace blink |
| OLD | NEW |