Bug 212848

Summary: [WebDriver] Allow platform-dependent modifier keys conversion to WebEvent::Modifier
Product: WebKit Reporter: Lauro Moura <lmoura>
Component: WebDriverAssignee: Lauro Moura <lmoura>
Status: RESOLVED FIXED    
Severity: Normal CC: bburg, bugs-noreply, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch none

Description Lauro Moura 2020-06-05 14:41:15 PDT
Currently, WebAutomationSession::simulateMouseInteraction converts m_currentModifiers (which stores the current native platform modifiers) directly to OptionSet<WebEvent::Modifier> using OptionSet::fromRaw(m_currentModifiers).

This causes problems as the fields in the native mappings is completely different from the WebEvent ones:

|Key     | WebEvent | WPE | GTK | Mac |
|--------|----------|-----|-----|-----|
|Shift   | 0        | 1   | 0   | 17  |
|Control | 1        | 0   | 2   | 18  |
|Alt     | 2        | 2   | 28  | 19  |
|Meta    | 3        | 3   | X   | 20  |
|Caps    | 4        | X   | 1   | 16  |
|--------|----------|-----|-----|-----|

For example, the current GTK context menu tests tests failing with the ctrl key pressed.
Comment 1 Lauro Moura 2020-06-05 14:48:51 PDT
Created attachment 401202 [details]
Patch
Comment 2 BJ Burg 2020-06-05 16:08:17 PDT
Comment on attachment 401202 [details]
Patch

r=me, good catch.
Comment 3 EWS 2020-06-07 17:34:38 PDT
Committed r262703: <https://trac.webkit.org/changeset/262703>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 401202 [details].
Comment 4 Radar WebKit Bug Importer 2020-06-07 17:35:18 PDT
<rdar://problem/64098495>