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 1484 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1495 return; | 1495 return; |
1496 } | 1496 } |
1497 | 1497 |
1498 // For positioned items we cannot use GridSpan::translate(). Because we coul
d end up with negative values, as the positioned items do not create implicit tr
acks per spec. | 1498 // For positioned items we cannot use GridSpan::translate(). Because we coul
d end up with negative values, as the positioned items do not create implicit tr
acks per spec. |
1499 int smallestStart = abs(isForColumns ? m_smallestColumnStart : m_smallestRow
Start); | 1499 int smallestStart = abs(isForColumns ? m_smallestColumnStart : m_smallestRow
Start); |
1500 int resolvedInitialPosition = positions.untranslatedResolvedInitialPosition(
) + smallestStart; | 1500 int resolvedInitialPosition = positions.untranslatedResolvedInitialPosition(
) + smallestStart; |
1501 int resolvedFinalPosition = positions.untranslatedResolvedFinalPosition() +
smallestStart; | 1501 int resolvedFinalPosition = positions.untranslatedResolvedFinalPosition() +
smallestStart; |
1502 | 1502 |
1503 GridPosition startPosition = isForColumns ? child.style()->gridColumnStart()
: child.style()->gridRowStart(); | 1503 GridPosition startPosition = isForColumns ? child.style()->gridColumnStart()
: child.style()->gridRowStart(); |
1504 GridPosition endPosition = isForColumns ? child.style()->gridColumnEnd() : c
hild.style()->gridRowEnd(); | 1504 GridPosition endPosition = isForColumns ? child.style()->gridColumnEnd() : c
hild.style()->gridRowEnd(); |
1505 int lastExplicitLine = isForColumns ? gridColumnCount() : gridRowCount(); | 1505 int firstExplicitLine = smallestStart; |
| 1506 int lastExplicitLine = (isForColumns ? GridResolvedPosition::explicitGridCol
umnCount(styleRef()) : GridResolvedPosition::explicitGridRowCount(styleRef())) +
smallestStart; |
1506 | 1507 |
1507 bool startIsAuto = startPosition.isAuto() | 1508 bool startIsAuto = startPosition.isAuto() |
1508 || (startPosition.isNamedGridArea() && !GridResolvedPosition::isValidNam
edLineOrArea(startPosition.namedGridLine(), styleRef(), GridResolvedPosition::in
itialPositionSide(direction))) | 1509 || (startPosition.isNamedGridArea() && !GridResolvedPosition::isValidNam
edLineOrArea(startPosition.namedGridLine(), styleRef(), GridResolvedPosition::in
itialPositionSide(direction))) |
1509 || (resolvedInitialPosition < 0) | 1510 || (resolvedInitialPosition < firstExplicitLine) |
1510 || (resolvedInitialPosition > lastExplicitLine); | 1511 || (resolvedInitialPosition > lastExplicitLine); |
1511 bool endIsAuto = endPosition.isAuto() | 1512 bool endIsAuto = endPosition.isAuto() |
1512 || (endPosition.isNamedGridArea() && !GridResolvedPosition::isValidNamed
LineOrArea(endPosition.namedGridLine(), styleRef(), GridResolvedPosition::finalP
ositionSide(direction))) | 1513 || (endPosition.isNamedGridArea() && !GridResolvedPosition::isValidNamed
LineOrArea(endPosition.namedGridLine(), styleRef(), GridResolvedPosition::finalP
ositionSide(direction))) |
1513 || (resolvedFinalPosition < 0) | 1514 || (resolvedFinalPosition < firstExplicitLine) |
1514 || (resolvedFinalPosition > lastExplicitLine); | 1515 || (resolvedFinalPosition > lastExplicitLine); |
1515 | 1516 |
1516 size_t initialPosition = startIsAuto ? 0 : resolvedInitialPosition; | 1517 size_t initialPosition = startIsAuto ? 0 : resolvedInitialPosition; |
1517 size_t finalPosition = endIsAuto ? lastExplicitLine : resolvedFinalPosition; | 1518 size_t finalPosition = endIsAuto ? lastExplicitLine : resolvedFinalPosition; |
1518 | 1519 |
1519 LayoutUnit start = startIsAuto ? LayoutUnit() : isForColumns ? m_columnPosi
tions[initialPosition] : m_rowPositions[initialPosition]; | 1520 LayoutUnit start = startIsAuto ? LayoutUnit() : isForColumns ? m_columnPosi
tions[initialPosition] : m_rowPositions[initialPosition]; |
1520 LayoutUnit end = endIsAuto ? isForColumns ? logicalWidth() : logicalHeight()
: isForColumns ? m_columnPositions[finalPosition] : m_rowPositions[finalPositi
on]; | 1521 LayoutUnit end = endIsAuto ? isForColumns ? logicalWidth() : logicalHeight()
: isForColumns ? m_columnPositions[finalPosition] : m_rowPositions[finalPositi
on]; |
1521 | 1522 |
1522 breadth = end - start; | 1523 breadth = end - start; |
1523 | 1524 |
(...skipping 547 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2071 | 2072 |
2072 return LayoutPoint(rowAxisOffset, columnAxisOffsetForChild(child)); | 2073 return LayoutPoint(rowAxisOffset, columnAxisOffsetForChild(child)); |
2073 } | 2074 } |
2074 | 2075 |
2075 void LayoutGrid::paintChildren(const PaintInfo& paintInfo, const LayoutPoint& pa
intOffset) const | 2076 void LayoutGrid::paintChildren(const PaintInfo& paintInfo, const LayoutPoint& pa
intOffset) const |
2076 { | 2077 { |
2077 GridPainter(*this).paintChildren(paintInfo, paintOffset); | 2078 GridPainter(*this).paintChildren(paintInfo, paintOffset); |
2078 } | 2079 } |
2079 | 2080 |
2080 } // namespace blink | 2081 } // namespace blink |
OLD | NEW |