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

Unified Diff: third_party/WebKit/Source/core/layout/LayoutRubyRun.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/LayoutRubyRun.cpp
diff --git a/third_party/WebKit/Source/core/layout/LayoutRubyRun.cpp b/third_party/WebKit/Source/core/layout/LayoutRubyRun.cpp
index 7aebf40bc3ad3641ed915dfb5bf2086d4ccdc731..d5157f225a4fac2ad7115747feb64fe0f1d214f0 100644
--- a/third_party/WebKit/Source/core/layout/LayoutRubyRun.cpp
+++ b/third_party/WebKit/Source/core/layout/LayoutRubyRun.cpp
@@ -278,12 +278,12 @@ void LayoutRubyRun::getOverhang(bool firstLine, LayoutObject* startLayoutObject,
if (!rubyBase->firstRootBox())
return;
- int logicalWidth = this->logicalWidth();
+ int logicalWidth = this->logicalWidth().toInt();
int logicalLeftOverhang = std::numeric_limits<int>::max();
int logicalRightOverhang = std::numeric_limits<int>::max();
for (RootInlineBox* rootInlineBox = rubyBase->firstRootBox(); rootInlineBox; rootInlineBox = rootInlineBox->nextRootBox()) {
- logicalLeftOverhang = std::min<int>(logicalLeftOverhang, rootInlineBox->logicalLeft());
- logicalRightOverhang = std::min<int>(logicalRightOverhang, logicalWidth - rootInlineBox->logicalRight());
+ logicalLeftOverhang = std::min<int>(logicalLeftOverhang, rootInlineBox->logicalLeft().toInt());
+ logicalRightOverhang = std::min<int>(logicalRightOverhang, (logicalWidth - rootInlineBox->logicalRight()).toInt());
}
startOverhang = style()->isLeftToRightDirection() ? logicalLeftOverhang : logicalRightOverhang;
« no previous file with comments | « third_party/WebKit/Source/core/layout/LayoutRubyBase.cpp ('k') | third_party/WebKit/Source/core/layout/LayoutRubyText.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698