mirror of
https://github.com/lightpanda-io/browser.git
synced 2026-10-10 13:22:09 -04:00
actions.click() previously dispatched a single untrusted-shaped "click" MouseEvent directly on the target node, skipping pointerdown, mousedown, pointerup, and mouseup entirely. Many real-world widgets — custom autocomplete/combobox components in particular — open or otherwise react on mousedown, not click alone, so this made them unreachable through the click tool even though the element was correctly focused and targeted. WebDriver.zig's own click() already implements the correct sequence (pointerdown, mousedown, pointerup, mouseup, click) for testdriver's click, with a comment explicitly contrasting it against a lone untrusted click event. This change ports that same sequence into actions.click() so the MCP/CDP "click" action produces the same event sequence a real user click would. Adds a mousedown assertion to the existing MCP Actions test (mcp_actions.html + tools.zig) to catch a regression here; confirmed the new assertion fails against the old implementation and passes against this one. Full test suite (1339 tests) and zig fmt --check both pass. Reproduced against a real, previously-untested production site (a Wix-built autocomplete branch-selector widget) where click could focus the input but never open its option list; a minimal local reproduction (a mousedown-only widget) confirms the fix.