Skip to content

Support Drag and Drop actions #314

Description

@myabc

Problem

Cuprite has no working HTML5 native drag-and-drop. The existing Node#drag_to (browser.rb) drives real mouse events (move/down/move/up), which works for pointer-based dragging but never fires the HTML5 DnD event sequence (dragstart/dragover/drop/dragend + DataTransfer). Chrome does not synthesize those from raw mouse input.

Consequence: suites that exercise HTML5 DnD must fall back to Selenium (e.g. opf/openproject#23218).

Currently skipped

spec/spec_helper.rb force-skips ~15 Capybara shared specs from node_spec.rb #drag_to:

  • 12 under #drag_to HTML5 — native DnD, incl. clientX/Y in dragover, preserve-last-coords, scrolling, SortableJS, default-draggable elements
  • 3 under #drag_to — mouse drag with held drop_modifiers (single/multiple keys, key aliases)

Scope (first pass)

  • HTML5 drag_to + drop_modifiers on the mouse path — the 15 specs above
  • Element#drop (files/strings/pathname, 5 specs) tracked separately — different method + file-input plumbing
  • Detailed approach left to the PR

Direction (non-binding)

Port Capybara's Selenium Html5Drag JS emulation as the near-term path (parity with what downstream suites already validate against); revisit CDP-native drag (Input.setInterceptDrags + dispatchDragEvent, Playwright's approach) once Ferrum exposes a public drag API.

Part of #307.

🤖 Drafted with agent assistance.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions