From a6c3aff4ae9154087b459b7228689c9a07574213 Mon Sep 17 00:00:00 2001 From: "commit-queue@webkit.org" Date: Mon, 16 Apr 2012 17:43:23 +0000 Subject: [PATCH] Fix bug in WebPluginContainer::isRectTopmost() which gave the incorrect result for a scrolled window. https://bugs.webkit.org/show_bug.cgi?id=80606 Patch by Raymes Khoury on 2012-04-16 Reviewed by Darin Fisher. * src/WebPluginContainerImpl.cpp: (WebKit::WebPluginContainerImpl::isRectTopmost): git-svn-id: http://svn.webkit.org/repository/webkit/trunk@114275 268f45cc-cd09-0410-ab3c-d52691b4dbfc --- Source/WebKit/chromium/ChangeLog | 10 ++++++++++ Source/WebKit/chromium/src/WebPluginContainerImpl.cpp | 6 +++--- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/Source/WebKit/chromium/ChangeLog b/Source/WebKit/chromium/ChangeLog index 04ac5b9..8318df7 100644 --- a/Source/WebKit/chromium/ChangeLog +++ b/Source/WebKit/chromium/ChangeLog @@ -1,3 +1,13 @@ +2012-04-16 Raymes Khoury + + Fix bug in WebPluginContainer::isRectTopmost() which gave the incorrect result for a scrolled window. + https://bugs.webkit.org/show_bug.cgi?id=80606 + + Reviewed by Darin Fisher. + + * src/WebPluginContainerImpl.cpp: + (WebKit::WebPluginContainerImpl::isRectTopmost): + 2012-04-15 Keishi Hattori Introduce MenuItemID to autofill popup diff --git a/Source/WebKit/chromium/src/WebPluginContainerImpl.cpp b/Source/WebKit/chromium/src/WebPluginContainerImpl.cpp index f9e678d..f69ae5c 100644 --- a/Source/WebKit/chromium/src/WebPluginContainerImpl.cpp +++ b/Source/WebKit/chromium/src/WebPluginContainerImpl.cpp @@ -453,10 +453,10 @@ bool WebPluginContainerImpl::isRectTopmost(const WebRect& rect) // hitTestResultAtPoint() takes a padding rectangle. // FIXME: We'll be off by 1 when the width or height is even. - IntRect windowRect = convertToContainingWindow(static_cast(rect)); - LayoutPoint center = windowRect.center(); + 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((windowRect.width() - 1) / 2, (windowRect.height() - 1) / 2); + LayoutSize padding((documentRect.width() - 1) / 2, (documentRect.height() - 1) / 2); HitTestResult result = page->mainFrame()->eventHandler()->hitTestResultAtPoint(center, false, false, DontHitTestScrollbars, HitTestRequest::ReadOnly | HitTestRequest::Active, padding); const HitTestResult::NodeSet& nodes = result.rectBasedTestResult(); -- 2.7.4