Title: [120881] trunk/Source/WebKit/chromium
Revision
120881
Author
[email protected]
Date
2012-06-20 16:31:17 -0700 (Wed, 20 Jun 2012)

Log Message

Perform hit-test from correct frame in isRectTopmost()
https://bugs.webkit.org/show_bug.cgi?id=89492

Patch by Raymes Khoury <[email protected]> on 2012-06-20
Reviewed by Levi Weintraub.

Hit-testing was being performed from the main frame, which gave the
incorrect result if the plugin was in a different frame.

* src/WebPluginContainerImpl.cpp:
(WebKit::WebPluginContainerImpl::isRectTopmost):

Modified Paths

Diff

Modified: trunk/Source/WebKit/chromium/ChangeLog (120880 => 120881)


--- trunk/Source/WebKit/chromium/ChangeLog	2012-06-20 23:17:22 UTC (rev 120880)
+++ trunk/Source/WebKit/chromium/ChangeLog	2012-06-20 23:31:17 UTC (rev 120881)
@@ -1,3 +1,16 @@
+2012-06-20  Raymes Khoury  <[email protected]>
+
+        Perform hit-test from correct frame in isRectTopmost()
+        https://bugs.webkit.org/show_bug.cgi?id=89492
+
+        Reviewed by Levi Weintraub.
+
+        Hit-testing was being performed from the main frame, which gave the
+        incorrect result if the plugin was in a different frame.
+
+        * src/WebPluginContainerImpl.cpp:
+        (WebKit::WebPluginContainerImpl::isRectTopmost):
+
 2012-06-20  Alexandre Elias  <[email protected]>
 
         [chromium] Support mobile device rotation resizing

Modified: trunk/Source/WebKit/chromium/src/WebPluginContainerImpl.cpp (120880 => 120881)


--- trunk/Source/WebKit/chromium/src/WebPluginContainerImpl.cpp	2012-06-20 23:17:22 UTC (rev 120880)
+++ trunk/Source/WebKit/chromium/src/WebPluginContainerImpl.cpp	2012-06-20 23:31:17 UTC (rev 120881)
@@ -461,8 +461,8 @@
 
 bool WebPluginContainerImpl::isRectTopmost(const WebRect& rect)
 {
-    Page* page = m_element->document()->page();
-    if (!page)
+    Frame* frame = m_element->document()->frame();
+    if (!frame)
         return false;
 
     // hitTestResultAtPoint() takes a padding rectangle.
@@ -471,8 +471,7 @@
     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);
-    HitTestResult result =
-        page->mainFrame()->eventHandler()->hitTestResultAtPoint(center, false, false, DontHitTestScrollbars, HitTestRequest::ReadOnly | HitTestRequest::Active, padding);
+    HitTestResult result = frame->eventHandler()->hitTestResultAtPoint(center, false, false, DontHitTestScrollbars, HitTestRequest::ReadOnly | HitTestRequest::Active, padding);
     const HitTestResult::NodeSet& nodes = result.rectBasedTestResult();
     if (nodes.size() != 1)
         return false;
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to