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 1887 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1898 case GridAxisCenter: { | 1898 case GridAxisCenter: { |
1899 size_t childEndLine = rowsSpan.resolvedFinalPosition(); | 1899 size_t childEndLine = rowsSpan.resolvedFinalPosition(); |
1900 LayoutUnit endOfRow = m_rowPositions[childEndLine]; | 1900 LayoutUnit endOfRow = m_rowPositions[childEndLine]; |
1901 // m_rowPositions include gutters so we need to subtract them to get the
actual end position for a given | 1901 // m_rowPositions include gutters so we need to subtract them to get the
actual end position for a given |
1902 // row (this does not have to be done for the last track as there are no
more m_rowPositions after it) | 1902 // row (this does not have to be done for the last track as there are no
more m_rowPositions after it) |
1903 if (childEndLine < m_rowPositions.size() - 1) | 1903 if (childEndLine < m_rowPositions.size() - 1) |
1904 endOfRow -= guttersSize(ForRows, 2); | 1904 endOfRow -= guttersSize(ForRows, 2); |
1905 LayoutUnit childBreadth = child.logicalHeight() + child.marginLogicalHei
ght(); | 1905 LayoutUnit childBreadth = child.logicalHeight() + child.marginLogicalHei
ght(); |
1906 if (childEndLine - childStartLine > 1 && childEndLine < m_rowPositions.s
ize() - 1) | 1906 if (childEndLine - childStartLine > 1 && childEndLine < m_rowPositions.s
ize() - 1) |
1907 endOfRow -= offsetBetweenTracks(styleRef().alignContentDistribution(
), m_rowPositions, childBreadth); | 1907 endOfRow -= offsetBetweenTracks(styleRef().alignContentDistribution(
), m_rowPositions, childBreadth); |
1908 LayoutUnit offsetFromStartPosition = computeOverflowAlignmentOffset(chil
d.styleRef().alignSelfOverflowAlignment(), endOfRow - startOfRow, childBreadth); | 1908 OverflowAlignment overflow = child.styleRef().resolvedAlignment(styleRef
(), ItemPositionStretch).overflow(); |
| 1909 LayoutUnit offsetFromStartPosition = computeOverflowAlignmentOffset(over
flow, endOfRow - startOfRow, childBreadth); |
1909 return startPosition + (axisPosition == GridAxisEnd ? offsetFromStartPos
ition : offsetFromStartPosition / 2); | 1910 return startPosition + (axisPosition == GridAxisEnd ? offsetFromStartPos
ition : offsetFromStartPosition / 2); |
1910 } | 1911 } |
1911 } | 1912 } |
1912 | 1913 |
1913 ASSERT_NOT_REACHED(); | 1914 ASSERT_NOT_REACHED(); |
1914 return 0; | 1915 return 0; |
1915 } | 1916 } |
1916 | 1917 |
1917 LayoutUnit LayoutGrid::rowAxisOffsetForChild(const LayoutBox& child) const | 1918 LayoutUnit LayoutGrid::rowAxisOffsetForChild(const LayoutBox& child) const |
1918 { | 1919 { |
(...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2072 | 2073 |
2073 return LayoutPoint(rowAxisOffset, columnAxisOffsetForChild(child)); | 2074 return LayoutPoint(rowAxisOffset, columnAxisOffsetForChild(child)); |
2074 } | 2075 } |
2075 | 2076 |
2076 void LayoutGrid::paintChildren(const PaintInfo& paintInfo, const LayoutPoint& pa
intOffset) const | 2077 void LayoutGrid::paintChildren(const PaintInfo& paintInfo, const LayoutPoint& pa
intOffset) const |
2077 { | 2078 { |
2078 GridPainter(*this).paintChildren(paintInfo, paintOffset); | 2079 GridPainter(*this).paintChildren(paintInfo, paintOffset); |
2079 } | 2080 } |
2080 | 2081 |
2081 } // namespace blink | 2082 } // namespace blink |
OLD | NEW |