Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: e3ece76059110c8d76f28c9e8c143bf20a3051e3
https://github.com/WebKit/WebKit/commit/e3ece76059110c8d76f28c9e8c143bf20a3051e3
Author: Tim Horton <[email protected]>
Date: 2025-04-07 (Mon, 07 Apr 2025)
Changed paths:
M Source/WebCore/PAL/pal/spi/mac/NSEventSPI.h
M Source/WebCore/platform/mac/PlatformEventFactoryMac.h
M Source/WebCore/platform/mac/PlatformEventFactoryMac.mm
M Source/WebKit/Shared/WebEventConversion.cpp
M Source/WebKit/Shared/WebEventConversion.h
M Source/WebKit/Shared/WebMouseEvent.cpp
M Source/WebKit/Shared/mac/WebEventFactory.h
M Source/WebKit/Shared/mac/WebEventFactory.mm
M Source/WebKit/UIProcess/Automation/mac/WebAutomationSessionMac.mm
Log Message:
-----------
Deduplicate some copied event conversion code between WebCore and WebKit2
https://bugs.webkit.org/show_bug.cgi?id=291097
rdar://148613835
Reviewed by Abrar Rahman Protyasha.
A long time ago, a bunch of event conversion code (especially code to read
properties off of NSEvent) was copied from WebCore to WebKit.
De-duplicate that copy-pasting, propagating changes that were made in only
one place since the divergence.
Add some helpers for converting between WebCore and WebKit enums to make
this sharing easier (mostly factored out of existing places).
Adopt the new helpers in a few other random places that had duplicative code.
* Source/WebCore/PAL/pal/spi/mac/NSEventSPI.h:
* Source/WebCore/platform/mac/PlatformEventFactoryMac.h:
* Source/WebCore/platform/mac/PlatformEventFactoryMac.mm:
(WebCore::globalPointForEvent):
(WebCore::pointForEvent):
(WebCore::currentMouseButton):
(WebCore::mouseButtonForEvent):
(WebCore::currentlyPressedMouseButtons):
(WebCore::mouseEventTypeForEvent):
(WebCore::clickCountForEvent):
(WebCore::textFromEvent):
(WebCore::unmodifiedTextFromEvent):
(WebCore::isKeypadEvent):
(WebCore::isKeyUpEvent):
(WebCore::modifiersForEvent):
(WebCore::modifiersForModifierFlags):
* Source/WebKit/Shared/WebEventConversion.cpp:
(WebKit::platform):
(WebKit::kit):
(WebKit::forceForEvent):
(WebKit::WebKit2PlatformMouseEvent::WebKit2PlatformMouseEvent):
(WebKit::WebKit2PlatformWheelEvent::WebKit2PlatformWheelEvent):
(WebKit::WebKit2PlatformKeyboardEvent::WebKit2PlatformKeyboardEvent):
(WebKit::WebKit2PlatformTouchEvent::WebKit2PlatformTouchEvent):
(WebKit::WebKit2PlatformGestureEvent::WebKit2PlatformGestureEvent):
* Source/WebKit/Shared/WebEventConversion.h:
* Source/WebKit/Shared/WebMouseEvent.cpp:
(WebKit::mouseButton):
* Source/WebKit/Shared/mac/WebEventFactory.h:
* Source/WebKit/Shared/mac/WebEventFactory.mm:
(WebKit::WebEventFactory::createWebMouseEvent):
(WebKit::WebEventFactory::createWebWheelEvent):
(WebKit::WebEventFactory::createWebKeyboardEvent):
(WebKit::currentMouseButton): Deleted.
(WebKit::mouseButtonForEvent): Deleted.
(WebKit::currentlyPressedMouseButtons): Deleted.
(WebKit::mouseEventTypeForEvent): Deleted.
(WebKit::clickCountForEvent): Deleted.
(WebKit::globalPointForEvent): Deleted.
(WebKit::pointForEvent): Deleted.
(WebKit::textFromEvent): Deleted.
(WebKit::unmodifiedTextFromEvent): Deleted.
(WebKit::isKeypadEvent): Deleted.
(WebKit::isKeyUpEvent): Deleted.
(WebKit::WebEventFactory::webEventModifiersForNSEventModifierFlags): Deleted.
* Source/WebKit/UIProcess/Automation/mac/WebAutomationSessionMac.mm:
(WebKit::WebAutomationSession::platformSimulateMouseInteraction):
(WebKit::WebAutomationSession::platformWebModifiersFromRaw):
Canonical link: https://commits.webkit.org/293379@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes