{{ message }}
Repository navigation
feat(cdp): implement Input.setInterceptDrags and Input.dragIntercepted - #1822
Open
Supersynergy wants to merge 5 commits into
Open
Supersynergy wants to merge 5 commits into
Supersynergy wants to merge 5 commits into
Conversation
Playwright drives HTML5 drag and drop on Chromium through Input.setInterceptDrags: the browser keeps the drag from running in the page and hands the client the DataTransfer content, which the client replays with Input.dispatchDragEvent. moli had the replay half but its own mouse-driven drag session never ended with dragend and could not be handed over. The renderer now reports an uncanceled dragstart as an intercepted drag (string items from setData plus the dragOperationsMask derived from effectAllowed) when the mouse command asks for interception. In that mode mouse events stop driving dragover and drop. The session remembers its source element and dispatches dragend there after drop, dragCancel or a plain mouse release. For an intercepted drag, dragenter is followed by a dragover on the same target, as in Chromium. The protocol crate still passes false for the new flag, so behaviour on the wire does not change in this commit.
Input.setInterceptDrags used to fail, which made every Playwright mouse move with a pressed button throw and left locator.dragTo timing out. The command now stores the flag per target and succeeds. While it is on, mouse events carry it to the renderer. When the renderer reports a drag start, the connection sends Input.dragIntercepted with the string items and dragOperationsMask, so the client can replay the drag through the existing Input.dispatchDragEvent. A drop or dragCancel clears the intercepted-drag state again. Files and directories in the drag data are not forwarded.
ldm0
self-requested a review
October 21, 2026 11:10
Contributor
Author
Contributor
Author
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Part of #1101.
Implements session-scoped
Input.setInterceptDragsand publishesInput.dragInterceptedwith the native DataTransfer items and operation mask. The renderer retains the source element and dispatchesdragendwhen the drag ends.v1.1.19 already has coordinate-based
Input.dispatchDragEventunder real layout. This patch connects native interception to that replay path, including the initial dragenter/dragover pair; mock geometry retains the unsupported response. Cancellation clears the intercepted protocol state.Release base: v1.1.19 (
bd0ddc3f8d8886f1bf339694ebdc89bfb4848efa). The existing topic commits are retained.Local validation on macOS arm64 refers to the combined integration tree: formatting, full workspace Clippy with all targets/features and
-D warnings, and 20,531 Nextest tests passed with 18 skipped. Test optimization was 0; the macOS helper retains full fetch-owner debug symbols for its backtrace assertion. The combined tree also includes the other topic PRs, signal shutdown, security dependency updates and test portability adjustments.The signed release candidate from that combined tree also passed 6/6 live-geometry checks and 17/17 browser checks, including native drag replay with dragend and profile restart with an open CDP connection.
CI compatibility: backported the current upstream supervisor options
--strict-full-suiteand Chromium--retries. The v1.1.19 runner otherwise exits before launching a browser under the current CI workflow. All 79 Python runner tests completed (2 skipped), including strict coverage and retry isolation.