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.
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@172512
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
+2014-08-12 Tim Horton <timothy_horton@apple.com>
+
+ 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 <prandolph@apple.com>
Runtime switch for long mouse press gesture. Part of 135257 - Add long mouse press gesture
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);