Index: third_party/WebKit/Source/core/style/GridCoordinate.h |
diff --git a/third_party/WebKit/Source/core/style/GridCoordinate.h b/third_party/WebKit/Source/core/style/GridCoordinate.h |
index ae3e89415a13fe5ad8492ca0a4025baef39257ef..8ae7b0eba02dcd1f4a788f8fdd45bb5b738284db 100644 |
--- a/third_party/WebKit/Source/core/style/GridCoordinate.h |
+++ b/third_party/WebKit/Source/core/style/GridCoordinate.h |
@@ -49,65 +49,6 @@ const size_t kGridMaxTracks = 1000000; |
struct GridSpan { |
USING_FAST_MALLOC(GridSpan); |
public: |
- static PassOwnPtr<GridSpan> create(const GridResolvedPosition& resolvedInitialPosition, const GridResolvedPosition& resolvedFinalPosition) |
- { |
- return adoptPtr(new GridSpan(resolvedInitialPosition, resolvedFinalPosition)); |
- } |
- |
- static PassOwnPtr<GridSpan> createWithSpanAgainstOpposite(const GridResolvedPosition& resolvedOppositePosition, const GridPosition& position, GridPositionSide side) |
- { |
- // 'span 1' is contained inside a single grid track regardless of the direction. |
- // That's why the CSS span value is one more than the offset we apply. |
- size_t positionOffset = position.spanPosition() - 1; |
- if (side == ColumnStartSide || side == RowStartSide) { |
- GridResolvedPosition initialResolvedPosition = GridResolvedPosition(std::max<int>(0, resolvedOppositePosition.toInt() - positionOffset)); |
- return GridSpan::create(initialResolvedPosition, resolvedOppositePosition); |
- } |
- |
- return GridSpan::create(resolvedOppositePosition, GridResolvedPosition(resolvedOppositePosition.toInt() + positionOffset)); |
- } |
- |
- static PassOwnPtr<GridSpan> createWithNamedSpanAgainstOpposite(const GridResolvedPosition& resolvedOppositePosition, const GridPosition& position, GridPositionSide side, const Vector<size_t>& gridLines) |
- { |
- if (side == RowStartSide || side == ColumnStartSide) |
- return createWithInitialNamedSpanAgainstOpposite(resolvedOppositePosition, position, gridLines); |
- |
- return createWithFinalNamedSpanAgainstOpposite(resolvedOppositePosition, position, gridLines); |
- } |
- |
- static PassOwnPtr<GridSpan> createWithInitialNamedSpanAgainstOpposite(const GridResolvedPosition& resolvedOppositePosition, const GridPosition& position, const Vector<size_t>& gridLines) |
- { |
- // The grid line inequality needs to be strict (which doesn't match the after / end case) because |resolvedOppositePosition| |
- // is already converted to an index in our grid representation (ie one was removed from the grid line to account for the side). |
- size_t firstLineBeforeOppositePositionIndex = 0; |
- const size_t* firstLineBeforeOppositePosition = std::lower_bound(gridLines.begin(), gridLines.end(), resolvedOppositePosition.toInt()); |
- if (firstLineBeforeOppositePosition != gridLines.end()) { |
- if (*firstLineBeforeOppositePosition > resolvedOppositePosition.toInt() && firstLineBeforeOppositePosition != gridLines.begin()) |
- --firstLineBeforeOppositePosition; |
- |
- firstLineBeforeOppositePositionIndex = firstLineBeforeOppositePosition - gridLines.begin(); |
- } |
- |
- size_t gridLineIndex = std::max<int>(0, firstLineBeforeOppositePositionIndex - position.spanPosition() + 1); |
- GridResolvedPosition resolvedGridLinePosition = GridResolvedPosition(gridLines[gridLineIndex]); |
- if (resolvedGridLinePosition > resolvedOppositePosition) |
- resolvedGridLinePosition = resolvedOppositePosition; |
- return GridSpan::create(resolvedGridLinePosition, resolvedOppositePosition); |
- } |
- |
- static PassOwnPtr<GridSpan> createWithFinalNamedSpanAgainstOpposite(const GridResolvedPosition& resolvedOppositePosition, const GridPosition& position, const Vector<size_t>& gridLines) |
- { |
- size_t firstLineAfterOppositePositionIndex = gridLines.size() - 1; |
- const size_t* firstLineAfterOppositePosition = std::upper_bound(gridLines.begin(), gridLines.end(), resolvedOppositePosition.toInt()); |
- if (firstLineAfterOppositePosition != gridLines.end()) |
- firstLineAfterOppositePositionIndex = firstLineAfterOppositePosition - gridLines.begin(); |
- |
- size_t gridLineIndex = std::min(gridLines.size() - 1, firstLineAfterOppositePositionIndex + position.spanPosition() - 1); |
- GridResolvedPosition resolvedGridLinePosition = GridResolvedPosition::adjustGridPositionForAfterEndSide(gridLines[gridLineIndex]); |
- if (resolvedGridLinePosition < resolvedOppositePosition) |
- resolvedGridLinePosition = resolvedOppositePosition; |
- return GridSpan::create(resolvedOppositePosition, resolvedGridLinePosition); |
- } |
GridSpan(const GridResolvedPosition& resolvedInitialPosition, const GridResolvedPosition& resolvedFinalPosition) |
: resolvedInitialPosition(std::min(resolvedInitialPosition.toInt(), kGridMaxTracks - 1)) |