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

Side by Side Diff: third_party/WebKit/Source/core/page/FocusController.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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2006, 2007 Apple Inc. All rights reserved. 2 * Copyright (C) 2006, 2007 Apple Inc. All rights reserved.
3 * Copyright (C) 2008 Nuanti Ltd. 3 * Copyright (C) 2008 Nuanti Ltd.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions 6 * modification, are permitted provided that the following conditions
7 * are met: 7 * are met:
8 * 1. Redistributions of source code must retain the above copyright 8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright 10 * 2. Redistributions in binary form must reproduce the above copyright
(...skipping 1141 matching lines...) Expand 10 before | Expand all | Expand 10 after
1152 } 1152 }
1153 1153
1154 LayoutRect intersectionRect = intersection(candidate.rect, closest.rect); 1154 LayoutRect intersectionRect = intersection(candidate.rect, closest.rect);
1155 if (!intersectionRect.isEmpty() && !areElementsOnSameLine(closest, candidate ) 1155 if (!intersectionRect.isEmpty() && !areElementsOnSameLine(closest, candidate )
1156 && intersectionRect == candidate.rect) { 1156 && intersectionRect == candidate.rect) {
1157 // If 2 nodes are intersecting, do hit test to find which node in on top . 1157 // If 2 nodes are intersecting, do hit test to find which node in on top .
1158 LayoutUnit x = intersectionRect.x() + intersectionRect.width() / 2; 1158 LayoutUnit x = intersectionRect.x() + intersectionRect.width() / 2;
1159 LayoutUnit y = intersectionRect.y() + intersectionRect.height() / 2; 1159 LayoutUnit y = intersectionRect.y() + intersectionRect.height() / 2;
1160 if (!candidate.visibleNode->document().page()->mainFrame()->isLocalFrame ()) 1160 if (!candidate.visibleNode->document().page()->mainFrame()->isLocalFrame ())
1161 return; 1161 return;
1162 HitTestResult result = candidate.visibleNode->document().page()->depreca tedLocalMainFrame()->eventHandler().hitTestResultAtPoint(IntPoint(x, y), HitTest Request::ReadOnly | HitTestRequest::Active | HitTestRequest::IgnoreClipping); 1162 HitTestResult result = candidate.visibleNode->document().page()->depreca tedLocalMainFrame()->eventHandler().hitTestResultAtPoint(IntPoint(x.toInt(), y.t oInt()), HitTestRequest::ReadOnly | HitTestRequest::Active | HitTestRequest::Ign oreClipping);
1163 if (candidate.visibleNode->contains(result.innerNode())) { 1163 if (candidate.visibleNode->contains(result.innerNode())) {
1164 closest = candidate; 1164 closest = candidate;
1165 return; 1165 return;
1166 } 1166 }
1167 if (closest.visibleNode->contains(result.innerNode())) 1167 if (closest.visibleNode->contains(result.innerNode()))
1168 return; 1168 return;
1169 } 1169 }
1170 1170
1171 if (candidate.distance < closest.distance) 1171 if (candidate.distance < closest.distance)
1172 closest = candidate; 1172 closest = candidate;
(...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after
1313 return consumed; 1313 return consumed;
1314 } 1314 }
1315 1315
1316 DEFINE_TRACE(FocusController) 1316 DEFINE_TRACE(FocusController)
1317 { 1317 {
1318 visitor->trace(m_page); 1318 visitor->trace(m_page);
1319 visitor->trace(m_focusedFrame); 1319 visitor->trace(m_focusedFrame);
1320 } 1320 }
1321 1321
1322 } // namespace blink 1322 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698