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

Unified Diff: third_party/WebKit/Source/core/inspector/InspectorCSSAgent.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/inspector/InspectorCSSAgent.cpp
diff --git a/third_party/WebKit/Source/core/inspector/InspectorCSSAgent.cpp b/third_party/WebKit/Source/core/inspector/InspectorCSSAgent.cpp
index a4578bdecd6e0430371e019c9acabd237af5e90f..fbd395b0546bb4c75aa89484aaad029e6ba84b8a 100644
--- a/third_party/WebKit/Source/core/inspector/InspectorCSSAgent.cpp
+++ b/third_party/WebKit/Source/core/inspector/InspectorCSSAgent.cpp
@@ -134,8 +134,8 @@ HeapVector<Member<Element>> elementsFromRect(LayoutRect rect, Document& document
LayoutPoint center = rect.center();
unsigned leftPadding, rightPadding, topPadding, bottomPadding;
- leftPadding = rightPadding = rect.width() / 2;
- topPadding = bottomPadding = rect.height() / 2;
+ leftPadding = rightPadding = (rect.width() / 2).toUnsigned();
+ topPadding = bottomPadding = (rect.height() / 2).toUnsigned();
HitTestResult result(request, center, topPadding, rightPadding, bottomPadding, leftPadding);
document.frame()->contentLayoutItem().hitTest(result);
return document.elementsFromHitTestResult(result);
« no previous file with comments | « third_party/WebKit/Source/core/input/EventHandler.cpp ('k') | third_party/WebKit/Source/core/layout/LayoutBlock.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698