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

Unified Diff: Source/web/WebPluginContainerImpl.cpp

Issue 1168173002: WebPluginContainerImpl::isRectTopmost: Clip query rect to frame. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 6 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/web/WebPluginContainerImpl.cpp
diff --git a/Source/web/WebPluginContainerImpl.cpp b/Source/web/WebPluginContainerImpl.cpp
index 9effa08e238c7d79e562c14c648f9cc8b613eca1..e5c0cf6b2de18c878c6e93251574c2ba41e8d822 100644
--- a/Source/web/WebPluginContainerImpl.cpp
+++ b/Source/web/WebPluginContainerImpl.cpp
@@ -528,9 +528,13 @@ bool WebPluginContainerImpl::isRectTopmost(const WebRect& rect)
if (!frame)
return false;
+ IntRect documentRect(x() + rect.x, y() + rect.y, rect.width, rect.height);
+ // Clip to the frame's visible area.
+ documentRect.intersect(frame->view()->frameRect());
+ if (documentRect.isEmpty())
+ return false;
// hitTestResultAtPoint() takes a padding rectangle.
// FIXME: We'll be off by 1 when the width or height is even.
- IntRect documentRect(x() + rect.x, y() + rect.y, rect.width, rect.height);
LayoutPoint center = documentRect.center();
// Make the rect we're checking (the point surrounded by padding rects) contained inside the requested rect. (Note that -1/2 is 0.)
LayoutSize padding((documentRect.width() - 1) / 2, (documentRect.height() - 1) / 2);
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698