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

Unified Diff: third_party/WebKit/Source/core/page/SpatialNavigation.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/page/SpatialNavigation.cpp
diff --git a/third_party/WebKit/Source/core/page/SpatialNavigation.cpp b/third_party/WebKit/Source/core/page/SpatialNavigation.cpp
index 52c1a5b4674369b304d0d63f7a446d859a596f30..ac287f78df832b9dd1af804a633af619106d17ef 100644
--- a/third_party/WebKit/Source/core/page/SpatialNavigation.cpp
+++ b/third_party/WebKit/Source/core/page/SpatialNavigation.cpp
@@ -555,14 +555,14 @@ void distanceDataForNode(WebFocusType type, const FocusCandidate& current, Focus
case WebFocusTypeRight:
navigationAxisDistance = xAxis;
if (!rectsIntersectOnOrthogonalAxis(type, currentRect, nodeRect))
- orthogonalBias = currentRect.height() / 2;
+ orthogonalBias = (currentRect.height() / 2).toInt();
weightedOrthogonalAxisDistance = (yAxis + orthogonalBias) * orthogonalWeightForLeftRight;
break;
case WebFocusTypeUp:
case WebFocusTypeDown:
navigationAxisDistance = yAxis;
if (!rectsIntersectOnOrthogonalAxis(type, currentRect, nodeRect))
- orthogonalBias = currentRect.width() / 2;
+ orthogonalBias = (currentRect.width() / 2).toInt();
weightedOrthogonalAxisDistance = (xAxis + orthogonalBias) * orthogonalWeightForUpDown;
break;
default:

Powered by Google App Engine
This is Rietveld 408576698