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

Unified Diff: third_party/WebKit/Source/core/layout/line/InlineFlowBox.cpp

Issue 2261663002: Disallow cast/implicit conversion from LayoutUnit to int/unsigned (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: - Created 4 years, 4 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/line/InlineFlowBox.cpp
diff --git a/third_party/WebKit/Source/core/layout/line/InlineFlowBox.cpp b/third_party/WebKit/Source/core/layout/line/InlineFlowBox.cpp
index 13a0d462fe1326b501def784c38fc932d3ae4cb6..5e92b80a77193376c0294c85199a66a6695ff63d 100644
--- a/third_party/WebKit/Source/core/layout/line/InlineFlowBox.cpp
+++ b/third_party/WebKit/Source/core/layout/line/InlineFlowBox.cpp
@@ -1116,12 +1116,12 @@ LayoutUnit InlineFlowBox::placeEllipsisBox(bool ltr, LayoutUnit blockLeftEdge, L
InlineBox* box = ltr ? firstChild() : lastChild();
// NOTE: these will cross after foundBox = true.
- int visibleLeftEdge = blockLeftEdge;
- int visibleRightEdge = blockRightEdge;
+ int visibleLeftEdge = blockLeftEdge.toInt();
+ int visibleRightEdge = blockRightEdge.toInt();
while (box) {
int currResult = box->placeEllipsisBox(ltr, LayoutUnit(visibleLeftEdge), LayoutUnit(visibleRightEdge),
- ellipsisWidth, truncatedWidth, foundBox);
+ ellipsisWidth, truncatedWidth, foundBox).toInt();
if (currResult != -1 && result == -1)
result = LayoutUnit(currResult);
@@ -1178,10 +1178,10 @@ LayoutUnit InlineFlowBox::computeOverAnnotationAdjustment(LayoutUnit allowedPosi
TextEmphasisPosition emphasisMarkPosition;
if (style.getTextEmphasisMark() != TextEmphasisMarkNone && toInlineTextBox(curr)->getEmphasisMarkPosition(style, emphasisMarkPosition) && emphasisMarkPosition == TextEmphasisPositionOver) {
if (!style.isFlippedLinesWritingMode()) {
- int topOfEmphasisMark = curr->logicalTop() - style.font().emphasisMarkHeight(style.textEmphasisMarkString());
+ int topOfEmphasisMark = (curr->logicalTop() - style.font().emphasisMarkHeight(style.textEmphasisMarkString())).toInt();
result = std::max(result, allowedPosition - topOfEmphasisMark);
} else {
- int bottomOfEmphasisMark = curr->logicalBottom() + style.font().emphasisMarkHeight(style.textEmphasisMarkString());
+ int bottomOfEmphasisMark = (curr->logicalBottom() + style.font().emphasisMarkHeight(style.textEmphasisMarkString())).toInt();
result = std::max(result, bottomOfEmphasisMark - allowedPosition);
}
}

Powered by Google App Engine
This is Rietveld 408576698