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

Unified Diff: third_party/WebKit/Source/core/layout/LayoutGrid.cpp

Issue 1647313003: Continue converting to explicit LayoutUnit constructors (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@explicitContstructors
Patch Set: Add TODO Created 4 years, 11 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/core/layout/LayoutGrid.cpp
diff --git a/third_party/WebKit/Source/core/layout/LayoutGrid.cpp b/third_party/WebKit/Source/core/layout/LayoutGrid.cpp
index 5b7e4f4709551e1061a118053170a6e313dec519..1bb89ec2853bcdbdd81238332ce4aede35f5b2b1 100644
--- a/third_party/WebKit/Source/core/layout/LayoutGrid.cpp
+++ b/third_party/WebKit/Source/core/layout/LayoutGrid.cpp
@@ -455,7 +455,7 @@ LayoutUnit LayoutGrid::computeIntrinsicLogicalContentHeightUsing(const Length& l
if (m_minContentHeight == -1 || m_maxContentHeight == -1)
return -1;
LayoutUnit fillAvailableExtent = containingBlock()->availableLogicalHeight(ExcludeMarginBorderPadding);
- return std::min<LayoutUnit>(m_maxContentHeight, std::max<LayoutUnit>(m_minContentHeight, fillAvailableExtent));
+ return std::min<LayoutUnit>(m_maxContentHeight, std::max(m_minContentHeight, fillAvailableExtent));
}
if (logicalHeightLength.isFillAvailable())
@@ -1012,7 +1012,7 @@ void LayoutGrid::resolveContentBasedTrackSizingFunctionsForItems(GridTrackSizing
spanningTracksSize += guttersSize(direction, itemSpan.integerSpan());
LayoutUnit extraSpace = currentItemSizeForTrackSizeComputationPhase(phase, gridItemWithSpan.gridItem(), direction, sizingData.columnTracks) - spanningTracksSize;
- extraSpace = std::max<LayoutUnit>(extraSpace, 0);
+ extraSpace = extraSpace.clampNegativeToZero();
auto& tracksToGrowBeyondGrowthLimits = sizingData.growBeyondGrowthLimitsTracks.isEmpty() ? sizingData.filteredTracks : sizingData.growBeyondGrowthLimitsTracks;
distributeSpaceToTracks<phase>(sizingData.filteredTracks, &tracksToGrowBeyondGrowthLimits, sizingData, extraSpace);
}
@@ -1621,7 +1621,7 @@ static LayoutUnit computeOverflowAlignmentOffset(OverflowAlignment overflow, Lay
case OverflowAlignmentSafe:
// If overflow is 'safe', we have to make sure we don't overflow the 'start'
// edge (potentially cause some data loss as the overflow is unreachable).
- return std::max<LayoutUnit>(0, offset);
+ return offset.clampNegativeToZero();
case OverflowAlignmentUnsafe:
case OverflowAlignmentDefault:
// If we overflow our alignment container and overflow is 'true' (default), we
« no previous file with comments | « third_party/WebKit/Source/core/layout/LayoutFlexibleBox.cpp ('k') | third_party/WebKit/Source/core/layout/LayoutInline.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698