Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: eb00322868f6827b00a85d956662b7992e35f0fb
      
https://github.com/WebKit/WebKit/commit/eb00322868f6827b00a85d956662b7992e35f0fb
  Author: Razvan Caliman <[email protected]>
  Date:   2026-10-13 (Tue, 13 Oct 2026)

  Changed paths:
    M Source/WebKit/UIProcess/Automation/BidiInputAgent.cpp
    M Source/WebKit/UIProcess/Automation/BidiInputAgent.h
    M Source/WebKit/UIProcess/Automation/SimulatedInputDispatcher.cpp
    M Source/WebKit/UIProcess/Automation/SimulatedInputDispatcher.h
    M Source/WebKit/UIProcess/Automation/WebAutomationSession.cpp
    M Source/WebKit/UIProcess/Automation/WebAutomationSession.h

  Log Message:
  -----------
  [WebDriver BiDi] input.performActions: dispatch key and none sources; 
implement input.releaseActions
https://bugs.webkit.org/show_bug.cgi?id=326372
rdar://189205046

Reviewed by BJ Burg.

Dispatch validated input actions for none and key input sources through the 
existing
`SimulatedInputDispatcher`, and implement `input.releaseActions` with the 
WebDriver input
cancel list.

Each top-level browsing context now has its own WebDriver input state 
(`BidiInputState`):
input sources, the input cancel list, and an actions queue 
(`BidiInputActionsQueue`).
`input.performActions` and `input.releaseActions` for the same top-level 
context run strictly
in order through that queue. Commands for different top-level contexts don't 
block each
other. The input sources are owned by the BiDi input state, separate from the 
session-global
sources used by Classic WebDriver.

Validated ticks are translated to `SimulatedInputKeyFrames`. `keyDown` adds the 
key to the
source's pressed keys and appends a matching `keyUp` to the input cancel list; 
`keyUp` of a
key that isn't pressed dispatches nothing; pause and none sources only 
contribute to the
tick duration, which is the maximum duration in the tick. WebDriver key values 
in the
U+E000-U+E05D range map to Automation virtual keys; other values are character 
keys.
`input.releaseActions` dispatches the input cancel list in reverse order, one 
keyframe per
undo action, then resets the input state. A command queued behind a reset 
re-registers
its input sources, so it dispatches against the reset state.

Actions from pointer and wheel input sources, including pause actions, report 
"unsupported
operation", as do key sources on ports without keyboard interactions, so 
unsupported source
types never reach the input dispatcher.

If the page closes while actions are being dispatched, or before a queued 
command runs,
the command reports "no such frame". The BiDi input state of a closing page is 
dropped
before pending event callbacks are failed.

* Source/WebKit/UIProcess/Automation/BidiInputAgent.cpp:
(WebKit::Automation::simulatedSourceType):
(WebKit::Automation::BidiInputState::simulatedSource):
(WebKit::Automation::BidiInputState::reset):
Add the dispatcher input sources and the input cancel list to the input state.

(WebKit::Automation::BidiInputActionsQueue::enqueue):
(WebKit::Automation::BidiInputActionsQueue::runNextCommand):
Add the WebDriver actions queue.

(WebKit::Automation::virtualKeyForKeyValue):
(WebKit::Automation::translateTicksToKeyFrames):
(WebKit::Automation::keyFramesForActions):
(WebKit::Automation::keyFramesForUndoActions):
Translate action ticks and undo actions to simulated input keyframes.

(WebKit::dispatchKeyFrames):
(WebKit::BidiInputAgent::inputStateForTopLevelContext):
(WebKit::BidiInputAgent::willClosePage):
(WebKit::BidiInputAgent::performActions):
(WebKit::BidiInputAgent::releaseActions):
* Source/WebKit/UIProcess/Automation/BidiInputAgent.h:
Rename the `BidiInput` namespace to `Automation`, and `State` to 
`BidiInputState`.

* Source/WebKit/UIProcess/Automation/SimulatedInputDispatcher.cpp:
(WebKit::normalizedVirtualKey):
(WebKit::pressedCharKey):
Moved from WebAutomationSession.cpp so the BiDi input agent can share them.

* Source/WebKit/UIProcess/Automation/SimulatedInputDispatcher.h:
* Source/WebKit/UIProcess/Automation/WebAutomationSession.cpp:
(WebKit::WebAutomationSession::willClosePage):
Drop the page's BiDi input state.

(WebKit::WebAutomationSession::runInteractionSequence): Added.
(WebKit::WebAutomationSession::performInteractionSequence):
Factor the dispatch to SimulatedInputDispatcher out of 
performInteractionSequence so
WebDriver BiDi can share it with its own input sources.

* Source/WebKit/UIProcess/Automation/WebAutomationSession.h:
Make webFrameIDForHandle() public so the BiDi input agent can resolve frame 
handles.

Canonical link: https://commits.webkit.org/323579@main



To unsubscribe from these emails, change your notification settings at 
https://github.com/WebKit/WebKit/settings/notifications

Reply via email to