Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(460)

Side by Side Diff: third_party/WebKit/Source/core/layout/LayoutGrid.cpp

Issue 1653673002: Even more explicit LayoutUnit conversion (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@moarConstructors
Patch Set: address comments Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 1541 matching lines...) Expand 10 before | Expand all | Expand 10 after
1552 1552
1553 GridSpan LayoutGrid::cachedGridSpan(const LayoutBox& gridItem, GridTrackSizingDi rection direction) const 1553 GridSpan LayoutGrid::cachedGridSpan(const LayoutBox& gridItem, GridTrackSizingDi rection direction) const
1554 { 1554 {
1555 GridCoordinate coordinate = cachedGridCoordinate(gridItem); 1555 GridCoordinate coordinate = cachedGridCoordinate(gridItem);
1556 return direction == ForColumns ? coordinate.columns : coordinate.rows; 1556 return direction == ForColumns ? coordinate.columns : coordinate.rows;
1557 } 1557 }
1558 1558
1559 LayoutUnit LayoutGrid::gridAreaBreadthForChild(const LayoutBox& child, GridTrack SizingDirection direction, const Vector<GridTrack>& tracks) const 1559 LayoutUnit LayoutGrid::gridAreaBreadthForChild(const LayoutBox& child, GridTrack SizingDirection direction, const Vector<GridTrack>& tracks) const
1560 { 1560 {
1561 const GridSpan& span = cachedGridSpan(child, direction); 1561 const GridSpan& span = cachedGridSpan(child, direction);
1562 LayoutUnit gridAreaBreadth = 0; 1562 LayoutUnit gridAreaBreadth;
1563 for (const auto& trackPosition : span) 1563 for (const auto& trackPosition : span)
1564 gridAreaBreadth += tracks[trackPosition].baseSize(); 1564 gridAreaBreadth += tracks[trackPosition].baseSize();
1565 1565
1566 gridAreaBreadth += guttersSize(direction, span.integerSpan()); 1566 gridAreaBreadth += guttersSize(direction, span.integerSpan());
1567 1567
1568 return gridAreaBreadth; 1568 return gridAreaBreadth;
1569 } 1569 }
1570 1570
1571 LayoutUnit LayoutGrid::gridAreaBreadthForChildIncludingAlignmentOffsets(const La youtBox& child, GridTrackSizingDirection direction, const GridSizingData& sizing Data) const 1571 LayoutUnit LayoutGrid::gridAreaBreadthForChildIncludingAlignmentOffsets(const La youtBox& child, GridTrackSizingDirection direction, const GridSizingData& sizing Data) const
1572 { 1572 {
(...skipping 499 matching lines...) Expand 10 before | Expand all | Expand 10 after
2072 2072
2073 return LayoutPoint(rowAxisOffset, columnAxisOffsetForChild(child)); 2073 return LayoutPoint(rowAxisOffset, columnAxisOffsetForChild(child));
2074 } 2074 }
2075 2075
2076 void LayoutGrid::paintChildren(const PaintInfo& paintInfo, const LayoutPoint& pa intOffset) const 2076 void LayoutGrid::paintChildren(const PaintInfo& paintInfo, const LayoutPoint& pa intOffset) const
2077 { 2077 {
2078 GridPainter(*this).paintChildren(paintInfo, paintOffset); 2078 GridPainter(*this).paintChildren(paintInfo, paintOffset);
2079 } 2079 }
2080 2080
2081 } // namespace blink 2081 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/layout/LayoutFrameSet.cpp ('k') | third_party/WebKit/Source/core/layout/LayoutListItem.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698