Double-tap an editable word with touch input. The DOM sees
pointerdown(touch), pointerup(touch) twice, then a
contextmenu event. The inherited code synthesizes that menu event
with a mouse pointer type; the patch uses touch for touch-originated menu
sources. The menu event still fires.
The screenshots below capture actual input through Chromium's touch
pipeline: two Input.dispatchTouchEvent taps into the same
locally built content_shell, before with the kill switch disabled,
after with it enabled. They are not JS-created DOM events.
On a touchscreen, double-tap the editable text below and read the event sequence. On Android, dragging a selection handle can issue another menu request. The live result reflects your browser, not the captures above. Mouse-only devices will not exercise this case.
EventHandler::ShowNonLocatedContextMenu
creates a synthetic WebMouseEvent. Touch menu sources get
pointerType=touch with the feature on; disabling
ContextMenuPointerTypeForTouch restores mouse.
The captured pointerId is still 1 for the menu event,
while the second tap is 3: this change addresses pointerType only,
not the spec's pointerId requirement.
To recapture: xvfb-run -a python3 capture_screenshots.py from
~/lab/samplers/i-41487195 with Pillow and websocket-client
installed. No physical touchscreen was exposed on this build machine;
the captures use Chromium's DevTools touch input.