diff options
author | Simon Hausmann <simon.hausmann@nokia.com> | 2012-02-24 16:36:50 +0100 |
---|---|---|
committer | Simon Hausmann <simon.hausmann@nokia.com> | 2012-02-24 16:36:50 +0100 |
commit | ad0d549d4cc13433f77c1ac8f0ab379c83d93f28 (patch) | |
tree | b34b0daceb7c8e7fdde4b4ec43650ab7caadb0a9 /Source/WebKit/chromium/src/WebPluginContainerImpl.cpp | |
parent | 03e12282df9aa1e1fb05a8b90f1cfc2e08764cec (diff) | |
download | qtwebkit-ad0d549d4cc13433f77c1ac8f0ab379c83d93f28.tar.gz |
Imported WebKit commit bb52bf3c0119e8a128cd93afe5572413a8617de9 (http://svn.webkit.org/repository/webkit/trunk@108790)
Diffstat (limited to 'Source/WebKit/chromium/src/WebPluginContainerImpl.cpp')
-rw-r--r-- | Source/WebKit/chromium/src/WebPluginContainerImpl.cpp | 32 |
1 files changed, 21 insertions, 11 deletions
diff --git a/Source/WebKit/chromium/src/WebPluginContainerImpl.cpp b/Source/WebKit/chromium/src/WebPluginContainerImpl.cpp index 129088ef4..10c3e2e4b 100644 --- a/Source/WebKit/chromium/src/WebPluginContainerImpl.cpp +++ b/Source/WebKit/chromium/src/WebPluginContainerImpl.cpp @@ -60,6 +60,7 @@ #include "FrameLoadRequest.h" #include "FrameView.h" #include "GraphicsContext.h" +#include "HitTestResult.h" #include "HostWindow.h" #include "HTMLFormElement.h" #include "HTMLNames.h" @@ -433,6 +434,26 @@ void WebPluginContainerImpl::zoomLevelChanged(double zoomLevel) WebViewImpl* view = WebViewImpl::fromPage(m_element->document()->frame()->page()); view->fullFramePluginZoomLevelChanged(zoomLevel); } + +bool WebPluginContainerImpl::isRectTopmost(const WebRect& rect) +{ + Page* page = m_element->document()->page(); + if (!page) + return false; + + // hitTestResultAtPoint() takes a padding rectangle. + // FIXME: We'll be off by 1 when the width or height is even. + IntRect windowRect = convertToContainingWindow(static_cast<IntRect>(rect)); + LayoutPoint center = windowRect.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); + HitTestResult result = + page->mainFrame()->eventHandler()->hitTestResultAtPoint(center, false, false, DontHitTestScrollbars, HitTestRequest::ReadOnly | HitTestRequest::Active, padding); + const HitTestResult::NodeSet& nodes = result.rectBasedTestResult(); + if (nodes.size() != 1) + return false; + return (nodes.first().get() == m_element); +} void WebPluginContainerImpl::didReceiveResponse(const ResourceResponse& response) { @@ -519,17 +540,6 @@ bool WebPluginContainerImpl::paintCustomOverhangArea(GraphicsContext* context, c return true; } -#if ENABLE(GESTURE_EVENTS) -bool WebPluginContainerImpl::handleGestureEvent(const WebCore::PlatformGestureEvent& gestureEvent) -{ - if (m_scrollbarGroup) { - m_scrollbarGroup->handleGestureEvent(gestureEvent); - return true; - } - return false; -} -#endif - // Private methods ------------------------------------------------------------- WebPluginContainerImpl::WebPluginContainerImpl(WebCore::HTMLPlugInElement* element, WebPlugin* webPlugin) |