Title: [172512] trunk/Source/WebKit2
Revision
172512
Author
[email protected]
Date
2014-08-12 20:02:35 -0700 (Tue, 12 Aug 2014)

Log Message

Document-relative page overlays drop some mouse events with non-zero top content inset
https://bugs.webkit.org/show_bug.cgi?id=135871
<rdar://problem/17982275>

Reviewed by Beth Dakin.

* WebProcess/WebPage/PageOverlay.cpp:
(WebKit::PageOverlay::mouseEvent):
Convert the mouse position into document-relative coordinates; the bounds()
already are! This way, we can actually compare them without being wrong sometimes.

Modified Paths

Diff

Modified: trunk/Source/WebKit2/ChangeLog (172511 => 172512)


--- trunk/Source/WebKit2/ChangeLog	2014-08-13 02:35:29 UTC (rev 172511)
+++ trunk/Source/WebKit2/ChangeLog	2014-08-13 03:02:35 UTC (rev 172512)
@@ -1,3 +1,16 @@
+2014-08-12  Tim Horton  <[email protected]>
+
+        Document-relative page overlays drop some mouse events with non-zero top content inset
+        https://bugs.webkit.org/show_bug.cgi?id=135871
+        <rdar://problem/17982275>
+
+        Reviewed by Beth Dakin.
+
+        * WebProcess/WebPage/PageOverlay.cpp:
+        (WebKit::PageOverlay::mouseEvent):
+        Convert the mouse position into document-relative coordinates; the bounds()
+        already are! This way, we can actually compare them without being wrong sometimes.
+
 2014-08-12  Peyton Randolph  <[email protected]>
 
         Runtime switch for long mouse press gesture. Part of 135257 - Add long mouse press gesture

Modified: trunk/Source/WebKit2/WebProcess/WebPage/PageOverlay.cpp (172511 => 172512)


--- trunk/Source/WebKit2/WebProcess/WebPage/PageOverlay.cpp	2014-08-13 02:35:29 UTC (rev 172511)
+++ trunk/Source/WebKit2/WebProcess/WebPage/PageOverlay.cpp	2014-08-13 03:02:35 UTC (rev 172512)
@@ -158,8 +158,13 @@
     
 bool PageOverlay::mouseEvent(const WebMouseEvent& mouseEvent)
 {
+    IntPoint mousePositionInOverlayCoordinates(mouseEvent.position());
+
+    if (m_overlayType == PageOverlay::OverlayType::Document)
+        mousePositionInOverlayCoordinates = m_webPage->corePage()->mainFrame().view()->rootViewToContents(mousePositionInOverlayCoordinates);
+
     // Ignore events outside the bounds.
-    if (!bounds().contains(mouseEvent.position()))
+    if (!bounds().contains(mousePositionInOverlayCoordinates))
         return false;
 
     return m_client->mouseEvent(this, mouseEvent);
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to