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

Unified Diff: third_party/WebKit/Source/core/layout/LayoutReplaced.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/LayoutReplaced.cpp
diff --git a/third_party/WebKit/Source/core/layout/LayoutReplaced.cpp b/third_party/WebKit/Source/core/layout/LayoutReplaced.cpp
index 016707b546a4683afd0955029dc7a8ce243a5dd9..6c708a0e36b89e1aaa46fc1b9f7cd74b91dc39dc 100644
--- a/third_party/WebKit/Source/core/layout/LayoutReplaced.cpp
+++ b/third_party/WebKit/Source/core/layout/LayoutReplaced.cpp
@@ -584,7 +584,7 @@ LayoutUnit LayoutReplaced::computeReplacedLogicalWidth(ShouldComputePreferred sh
// This solves above equation for 'width' (== logicalWidth).
LayoutUnit marginStart = minimumValueForLength(style()->marginStart(), logicalWidth);
LayoutUnit marginEnd = minimumValueForLength(style()->marginEnd(), logicalWidth);
- logicalWidth = std::max<LayoutUnit>(0, logicalWidth - (marginStart + marginEnd + (size().width() - clientWidth())));
+ logicalWidth = (logicalWidth - (marginStart + marginEnd + (size().width() - clientWidth()))).clampNegativeToZero();
return computeReplacedLogicalWidthRespectingMinMaxWidth(logicalWidth, shouldComputePreferred);
}
}
@@ -730,8 +730,8 @@ LayoutRect LayoutReplaced::localSelectionRect() const
RootInlineBox& root = inlineBoxWrapper()->root();
LayoutUnit newLogicalTop = root.block().style()->isFlippedBlocksWritingMode() ? inlineBoxWrapper()->logicalBottom() - root.selectionBottom() : root.selectionTop() - inlineBoxWrapper()->logicalTop();
if (root.block().style()->isHorizontalWritingMode())
- return LayoutRect(0, newLogicalTop, size().width(), root.selectionHeight());
- return LayoutRect(newLogicalTop, 0, root.selectionHeight(), size().height());
+ return LayoutRect(LayoutUnit(), newLogicalTop, size().width(), root.selectionHeight());
+ return LayoutRect(newLogicalTop, LayoutUnit(), root.selectionHeight(), size().height());
}
void LayoutReplaced::setSelectionState(SelectionState state)

Powered by Google App Engine
This is Rietveld 408576698