RESOLVED FIXED 217819
WebDriver: add support for right variations of virtual keys
https://bugs.webkit.org/show_bug.cgi?id=217819
Summary WebDriver: add support for right variations of virtual keys
Carlos Garcia Campos
Reported 2020-10-16 05:45:59 PDT
The browser is currently receiving the virtual keys already normalized, but WebDriver expects the key code to be the actual one, not the normalized one. We need to send the raw virtual keys to the browser and do the normalization there, but use the raw one when synthesizing the events.
Attachments
Patch (31.60 KB, patch)
2020-10-16 06:00 PDT, Carlos Garcia Campos
ews-feeder: commit-queue-
Patch (31.60 KB, patch)
2020-10-16 06:12 PDT, Carlos Garcia Campos
ews-feeder: commit-queue-
Patch (34.12 KB, patch)
2020-10-16 06:58 PDT, Carlos Garcia Campos
ews-feeder: commit-queue-
Patch (34.12 KB, patch)
2020-10-16 07:06 PDT, Carlos Garcia Campos
ews-feeder: commit-queue-
Patch (34.13 KB, patch)
2020-10-19 05:42 PDT, Carlos Garcia Campos
bburg: review+
ews-feeder: commit-queue-
Patch for landing (34.15 KB, patch)
2020-10-20 01:08 PDT, Carlos Garcia Campos
no flags
Carlos Garcia Campos
Comment 1 2020-10-16 06:00:42 PDT
Carlos Garcia Campos
Comment 2 2020-10-16 06:12:41 PDT
Carlos Garcia Campos
Comment 3 2020-10-16 06:58:41 PDT
Carlos Garcia Campos
Comment 4 2020-10-16 07:06:35 PDT
Carlos Garcia Campos
Comment 5 2020-10-19 05:42:36 PDT
Created attachment 411740 [details] Patch I don't understand the wincairo failure
Darin Adler
Comment 6 2020-10-19 12:51:32 PDT
Comment on attachment 411740 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=411740&action=review > Source/WebKit/UIProcess/Automation/WebAutomationSession.cpp:1865 > +static VirtualKey normalizedVirtualKey(VirtualKey key) Isn’t the type named Inspector::Protocol::Automation::VirtualKey? What injects VirtualKey into the WebKit namespace? Why can we just write VirtualKey in the argument types but then need to write the whole type out in the function body?
Radar WebKit Bug Importer
Comment 7 2020-10-19 15:00:54 PDT
Blaze Burg
Comment 8 2020-10-19 15:03:16 PDT
(In reply to Darin Adler from comment #6) > Comment on attachment 411740 [details] > Patch > > View in context: > https://bugs.webkit.org/attachment.cgi?id=411740&action=review > > > Source/WebKit/UIProcess/Automation/WebAutomationSession.cpp:1865 > > +static VirtualKey normalizedVirtualKey(VirtualKey key) > > Isn’t the type named Inspector::Protocol::Automation::VirtualKey? What > injects VirtualKey into the WebKit namespace? Why can we just write > VirtualKey in the argument types but then need to write the whole type out > in the function body? The enum names are shortened in SimulatedInputDispatcher.h in order to make the members more readable. This file includes that header. using KeyboardInteraction = Inspector::Protocol::Automation::KeyboardInteractionType; using VirtualKey = Inspector::Protocol::Automation::VirtualKey; using VirtualKeySet = HashSet<VirtualKey, WTF::IntHash<VirtualKey>, WTF::StrongEnumHashTraits<VirtualKey>>; using MouseButton = Inspector::Protocol::Automation::MouseButton; using MouseInteraction = Inspector::Protocol::Automation::MouseInteraction; using MouseMoveOrigin = Inspector::Protocol::Automation::MouseMoveOrigin;
Blaze Burg
Comment 9 2020-10-19 15:03:34 PDT
Comment on attachment 411740 [details] Patch r=me I think this needs to be rebased again.
Fujii Hironori
Comment 10 2020-10-19 17:06:48 PDT
(In reply to Carlos Garcia Campos from comment #5) > I don't understand the wincairo failure WinCairo EWS reported: ..\..\Source\WebKit\UIProcess\Automation\WebAutomationSession.cpp(1865): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int VirtualKey is not defined, which is defined in WebKit/UIProcess/Automation/SimulatedInputDispatcher.h. But, ENABLE_WEBDRIVER_ACTIONS_API is not true for WinCairo, which is defined in Source/WebKit/config.h. WinCairo doesn't enable those features. WEBKIT_OPTION_DEFINE(ENABLE_WEBDRIVER_KEYBOARD_INTERACTIONS "Toggle WebDriver keyboard interactions" PRIVATE OFF) WEBKIT_OPTION_DEFINE(ENABLE_WEBDRIVER_MOUSE_INTERACTIONS "Toggle WebDriver mouse interactions" PRIVATE OFF) WEBKIT_OPTION_DEFINE(ENABLE_WEBDRIVER_TOUCH_INTERACTIONS "Toggle WebDriver touch interactions" PRIVATE OFF)
Fujii Hironori
Comment 11 2020-10-19 17:12:49 PDT
Comment on attachment 411740 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=411740&action=review >>> Source/WebKit/UIProcess/Automation/WebAutomationSession.cpp:1865 >>> +static VirtualKey normalizedVirtualKey(VirtualKey key) >> >> Isn’t the type named Inspector::Protocol::Automation::VirtualKey? What injects VirtualKey into the WebKit namespace? Why can we just write VirtualKey in the argument types but then need to write the whole type out in the function body? > > The enum names are shortened in SimulatedInputDispatcher.h in order to make the members more readable. This file includes that header. > > > using KeyboardInteraction = Inspector::Protocol::Automation::KeyboardInteractionType; > using VirtualKey = Inspector::Protocol::Automation::VirtualKey; > using VirtualKeySet = HashSet<VirtualKey, WTF::IntHash<VirtualKey>, WTF::StrongEnumHashTraits<VirtualKey>>; > using MouseButton = Inspector::Protocol::Automation::MouseButton; > using MouseInteraction = Inspector::Protocol::Automation::MouseInteraction; > using MouseMoveOrigin = Inspector::Protocol::Automation::MouseMoveOrigin; I don't understand this change at all. Can you put this funciton in #if ENABLE(WEBDRIVER_ACTIONS_API), KaL?
Carlos Garcia Campos
Comment 12 2020-10-20 01:08:31 PDT
Created attachment 411845 [details] Patch for landing
Carlos Garcia Campos
Comment 13 2020-10-20 02:14:43 PDT
Note You need to log in before you can comment on or make changes to this bug.