WebKit Bugzilla
Attachment 350029 Details for
Bug 189621
: It should be possible to get the mouse event modifiers from an injected bundle.
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-189621-20180918100810.patch (text/plain), 9.59 KB, created by
Per Arne Vollan
on 2018-09-18 10:08:11 PDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Per Arne Vollan
Created:
2018-09-18 10:08:11 PDT
Size:
9.59 KB
patch
obsolete
>Index: Source/WebKit/ChangeLog >=================================================================== >--- Source/WebKit/ChangeLog (revision 236143) >+++ Source/WebKit/ChangeLog (working copy) >@@ -1,3 +1,17 @@ >+2018-09-18 Per Arne Vollan <pvollan@apple.com> >+ >+ It should be possible to get the mouse event modifiers for a page overlay client. >+ https://bugs.webkit.org/show_bug.cgi?id=189621 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Add mouse client callbacks that include modifiers. >+ >+ * Shared/API/c/WKSharedAPICast.h: >+ (WebKit::toAPI): >+ * WebProcess/InjectedBundle/API/c/WKBundlePageOverlay.cpp: >+ * WebProcess/InjectedBundle/API/c/WKBundlePageOverlay.h: >+ > 2018-09-18 Antti Koivisto <antti@apple.com> > > REGRESSION (PSON): White or Black flash occurs when process swapping on navigation on Mac >Index: Source/WebKit/Shared/API/c/WKSharedAPICast.h >=================================================================== >--- Source/WebKit/Shared/API/c/WKSharedAPICast.h (revision 236082) >+++ Source/WebKit/Shared/API/c/WKSharedAPICast.h (working copy) >@@ -55,6 +55,7 @@ > #include <WebCore/FrameLoaderTypes.h> > #include <WebCore/IntRect.h> > #include <WebCore/LayoutMilestones.h> >+#include <WebCore/PlatformEvent.h> > #include <WebCore/SecurityOrigin.h> > #include <WebCore/UserContentTypes.h> > #include <WebCore/UserScriptTypes.h> >@@ -297,6 +298,22 @@ inline WKEventModifiers toAPI(WebEvent:: > return wkModifiers; > } > >+inline WKEventModifiers toAPI(OptionSet<WebCore::PlatformEvent::Modifier> modifiers) >+{ >+ WKEventModifiers wkModifiers = 0; >+ if (modifiers & WebCore::PlatformEvent::Modifier::ShiftKey) >+ wkModifiers |= kWKEventModifiersShiftKey; >+ if (modifiers & WebCore::PlatformEvent::Modifier::CtrlKey) >+ wkModifiers |= kWKEventModifiersControlKey; >+ if (modifiers & WebCore::PlatformEvent::Modifier::AltKey) >+ wkModifiers |= kWKEventModifiersAltKey; >+ if (modifiers & WebCore::PlatformEvent::Modifier::MetaKey) >+ wkModifiers |= kWKEventModifiersMetaKey; >+ if (modifiers & WebCore::PlatformEvent::Modifier::CapsLockKey) >+ wkModifiers |= kWKEventModifiersCapsLockKey; >+ return wkModifiers; >+} >+ > inline WKEventMouseButton toAPI(WebMouseEvent::Button mouseButton) > { > WKEventMouseButton wkMouseButton = kWKEventMouseButtonNoButton; >Index: Source/WebKit/WebProcess/InjectedBundle/API/c/WKBundlePageOverlay.cpp >=================================================================== >--- Source/WebKit/WebProcess/InjectedBundle/API/c/WKBundlePageOverlay.cpp (revision 236082) >+++ Source/WebKit/WebProcess/InjectedBundle/API/c/WKBundlePageOverlay.cpp (working copy) >@@ -44,7 +44,7 @@ > namespace API { > > template<> struct ClientTraits<WKBundlePageOverlayClientBase> { >- typedef std::tuple<WKBundlePageOverlayClientV0, WKBundlePageOverlayClientV1> Versions; >+ typedef std::tuple<WKBundlePageOverlayClientV0, WKBundlePageOverlayClientV1, WKBundlePageOverlayClientV2> Versions; > }; > > template<> struct ClientTraits<WKBundlePageOverlayAccessibilityClientBase> { >@@ -98,30 +98,42 @@ private: > { > switch (event.type()) { > case PlatformMouseEvent::Type::MousePressed: { >- if (!m_client.mouseDown) >- return false; >+ if (m_client.mouseDownWithModifiers) >+ return m_client.mouseDownWithModifiers(toAPI(&pageOverlay), toAPI(event.position()), toAPI(event.button()), toAPI(event.modifiers()), m_client.base.clientInfo); >+ >+ if (m_client.mouseDown) >+ return m_client.mouseDown(toAPI(&pageOverlay), toAPI(event.position()), toAPI(event.button()), m_client.base.clientInfo); > >- return m_client.mouseDown(toAPI(&pageOverlay), toAPI(event.position()), toAPI(event.button()), m_client.base.clientInfo); >+ return false; > } > case PlatformMouseEvent::Type::MouseReleased: { >- if (!m_client.mouseUp) >- return false; >+ if (m_client.mouseUpWithModifiers) >+ return m_client.mouseUpWithModifiers(toAPI(&pageOverlay), toAPI(event.position()), toAPI(event.button()), toAPI(event.modifiers()), m_client.base.clientInfo); >+ >+ if (m_client.mouseUp) >+ return m_client.mouseUp(toAPI(&pageOverlay), toAPI(event.position()), toAPI(event.button()), m_client.base.clientInfo); > >- return m_client.mouseUp(toAPI(&pageOverlay), toAPI(event.position()), toAPI(event.button()), m_client.base.clientInfo); >+ return false; > } > case PlatformMouseEvent::Type::MouseMoved: { > if (event.button() == MouseButton::NoButton) { >- if (!m_client.mouseMoved) >- return false; >- >- return m_client.mouseMoved(toAPI(&pageOverlay), toAPI(event.position()), m_client.base.clientInfo); >+ if (m_client.mouseMovedWithModifiers) >+ return m_client.mouseMovedWithModifiers(toAPI(&pageOverlay), toAPI(event.position()), toAPI(event.modifiers()), m_client.base.clientInfo); >+ >+ if (m_client.mouseMoved) >+ return m_client.mouseMoved(toAPI(&pageOverlay), toAPI(event.position()), m_client.base.clientInfo); >+ >+ return false; > } > > // This is a MouseMove event with a mouse button pressed. Call mouseDragged. >- if (!m_client.mouseDragged) >- return false; >+ if (m_client.mouseDraggedWithModifiers) >+ return m_client.mouseDraggedWithModifiers(toAPI(&pageOverlay), toAPI(event.position()), toAPI(event.button()), toAPI(event.modifiers()), m_client.base.clientInfo); >+ >+ if (m_client.mouseDragged) >+ return m_client.mouseDragged(toAPI(&pageOverlay), toAPI(event.position()), toAPI(event.button()), m_client.base.clientInfo); > >- return m_client.mouseDragged(toAPI(&pageOverlay), toAPI(event.position()), toAPI(event.button()), m_client.base.clientInfo); >+ return false; > } > > default: >Index: Source/WebKit/WebProcess/InjectedBundle/API/c/WKBundlePageOverlay.h >=================================================================== >--- Source/WebKit/WebProcess/InjectedBundle/API/c/WKBundlePageOverlay.h (revision 236082) >+++ Source/WebKit/WebProcess/InjectedBundle/API/c/WKBundlePageOverlay.h (working copy) >@@ -54,6 +54,11 @@ typedef void (*WKBundlePageOverlayDataDe > typedef void (*WKBundlePageOverlayDataDetectorsDidChangeUI)(WKBundlePageOverlayRef pageOverlay, const void* clientInfo); > typedef void (*WKBundlePageOverlayDataDetectorsDidHideUI)(WKBundlePageOverlayRef pageOverlay, const void* clientInfo); > >+typedef bool (*WKBundlePageOverlayMouseDownWithModifiersCallback)(WKBundlePageOverlayRef pageOverlay, WKPoint position, WKEventMouseButton mouseButton, WKEventModifiers modifiers, const void* clientInfo); >+typedef bool (*WKBundlePageOverlayMouseUpWithModifiersCallback)(WKBundlePageOverlayRef pageOverlay, WKPoint position, WKEventMouseButton mouseButton, WKEventModifiers modifiers, const void* clientInfo); >+typedef bool (*WKBundlePageOverlayMouseMovedWithModifiersCallback)(WKBundlePageOverlayRef pageOverlay, WKPoint position, WKEventModifiers modifiers, const void* clientInfo); >+typedef bool (*WKBundlePageOverlayMouseDraggedWithModifiersCallback)(WKBundlePageOverlayRef pageOverlay, WKPoint position, WKEventMouseButton mouseButton, WKEventModifiers modifiers, const void* clientInfo); >+ > typedef struct WKBundlePageOverlayClientBase { > int version; > const void * clientInfo; >@@ -88,6 +93,28 @@ typedef struct WKBundlePageOverlayClient > WKBundlePageOverlayDataDetectorsDidHideUI dataDetectorsDidHideUI; > } WKBundlePageOverlayClientV1; > >+typedef struct WKBundlePageOverlayClientV2 { >+ WKBundlePageOverlayClientBase base; >+ >+ WKBundlePageOverlayWillMoveToPageCallback willMoveToPage; >+ WKBundlePageOverlayDidMoveToPageCallback didMoveToPage; >+ WKBundlePageOverlayDrawRectCallback drawRect; >+ WKBundlePageOverlayMouseDownCallback mouseDown; >+ WKBundlePageOverlayMouseUpCallback mouseUp; >+ WKBundlePageOverlayMouseMovedCallback mouseMoved; >+ WKBundlePageOverlayMouseDraggedCallback mouseDragged; >+ >+ WKBundlePageOverlayActionContextForResultAtPointCallback actionContextForResultAtPoint; >+ WKBundlePageOverlayDataDetectorsDidPresentUI dataDetectorsDidPresentUI; >+ WKBundlePageOverlayDataDetectorsDidChangeUI dataDetectorsDidChangeUI; >+ WKBundlePageOverlayDataDetectorsDidHideUI dataDetectorsDidHideUI; >+ >+ WKBundlePageOverlayMouseDownWithModifiersCallback mouseDownWithModifiers; >+ WKBundlePageOverlayMouseUpWithModifiersCallback mouseUpWithModifiers; >+ WKBundlePageOverlayMouseMovedWithModifiersCallback mouseMovedWithModifiers; >+ WKBundlePageOverlayMouseDraggedWithModifiersCallback mouseDraggedWithModifiers; >+} WKBundlePageOverlayClientV2; >+ > typedef WKTypeRef (*WKAccessibilityAttributeValueCallback)(WKBundlePageOverlayRef pageOverlay, WKStringRef attribute, WKTypeRef parameter, const void* clientInfo); > typedef WKArrayRef (*WKAccessibilityAttributeNamesCallback)(WKBundlePageOverlayRef pageOverlay, bool parameterizedNames, const void* clientInfo); >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 189621
:
349766
|
350029
|
358441
|
362309