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 874 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
885 return { Length(Fixed), Length(Fixed) }; | 885 return { Length(Fixed), Length(Fixed) }; |
886 | 886 |
887 const GridTrackSize& trackSize = rawGridTrackSize(direction, translatedIndex
); | 887 const GridTrackSize& trackSize = rawGridTrackSize(direction, translatedIndex
); |
888 | 888 |
889 GridLength minTrackBreadth = trackSize.minTrackBreadth(); | 889 GridLength minTrackBreadth = trackSize.minTrackBreadth(); |
890 GridLength maxTrackBreadth = trackSize.maxTrackBreadth(); | 890 GridLength maxTrackBreadth = trackSize.maxTrackBreadth(); |
891 | 891 |
892 // If the logical width/height of the grid container is indefinite, percenta
ge values are treated as <auto>. | 892 // If the logical width/height of the grid container is indefinite, percenta
ge values are treated as <auto>. |
893 if (minTrackBreadth.hasPercentage() || maxTrackBreadth.hasPercentage()) { | 893 if (minTrackBreadth.hasPercentage() || maxTrackBreadth.hasPercentage()) { |
894 // For the inline axis this only happens when we're computing the intrin
sic sizes (AvailableSpaceIndefinite). | 894 // For the inline axis this only happens when we're computing the intrin
sic sizes (AvailableSpaceIndefinite). |
895 // For the block axis we check that the percentage height is resolvable
on the first in-flow child. | 895 if ((sizingOperation == IntrinsicSizeComputation) || (direction == ForRo
ws && !hasDefiniteLogicalHeight())) { |
896 // TODO (lajava) This condition for determining whether a size is indefi
nite or not is not working correctly for orthogonal flows. | |
897 if ((sizingOperation == IntrinsicSizeComputation) || (direction == ForRo
ws && firstInFlowChildBox() && !firstInFlowChildBox()->percentageLogicalHeightIs
Resolvable())) { | |
898 if (minTrackBreadth.hasPercentage()) | 896 if (minTrackBreadth.hasPercentage()) |
899 minTrackBreadth = Length(Auto); | 897 minTrackBreadth = Length(Auto); |
900 if (maxTrackBreadth.hasPercentage()) | 898 if (maxTrackBreadth.hasPercentage()) |
901 maxTrackBreadth = Length(Auto); | 899 maxTrackBreadth = Length(Auto); |
902 } | 900 } |
903 } | 901 } |
904 | 902 |
905 // Flex sizes are invalid as a min sizing function. However we still can hav
e a flexible |minTrackBreadth| | 903 // Flex sizes are invalid as a min sizing function. However we still can hav
e a flexible |minTrackBreadth| |
906 // if the track had a flex size directly (e.g. "1fr"), the spec says that in
this case it implies an automatic minimum. | 904 // if the track had a flex size directly (e.g. "1fr"), the spec says that in
this case it implies an automatic minimum. |
907 if (minTrackBreadth.isFlex()) | 905 if (minTrackBreadth.isFlex()) |
(...skipping 1691 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2599 return isOrthogonalChild(child) ? childLocation.transposedPoint() : childLoc
ation; | 2597 return isOrthogonalChild(child) ? childLocation.transposedPoint() : childLoc
ation; |
2600 } | 2598 } |
2601 | 2599 |
2602 void LayoutGrid::paintChildren(const PaintInfo& paintInfo, const LayoutPoint& pa
intOffset) const | 2600 void LayoutGrid::paintChildren(const PaintInfo& paintInfo, const LayoutPoint& pa
intOffset) const |
2603 { | 2601 { |
2604 if (!m_gridItemArea.isEmpty()) | 2602 if (!m_gridItemArea.isEmpty()) |
2605 GridPainter(*this).paintChildren(paintInfo, paintOffset); | 2603 GridPainter(*this).paintChildren(paintInfo, paintOffset); |
2606 } | 2604 } |
2607 | 2605 |
2608 } // namespace blink | 2606 } // namespace blink |
OLD | NEW |