Cause: the routing view redraws every second (setInterval → render →
header). header() set chip.textContent and goTo() re-set data-go, tabindex,
role and title each time, even when nothing changed. Setting textContent
swaps the chip's text node. In WebKit, a press whose mousedown and mouseup
straddle that swap gets no click, so goRouting never ran and
routing-mode-goes timed out waiting for .rt-found (webkit zh 420 on CI).
A reader pressing the chip for a moment could miss it the same way.
Reproduced by injecting a delay: SIGSTOP/SIGCONT duty-cycling of WebKit's
UI process. At 10ms on / 490ms off, a MutationObserver on .rt-hub plus
pointer logging showed pointerdown at 2407ms, the hub's childList swap at
2869ms, pointerup at 2904ms, and no click. At 50/450, 1 of 30 runs timed
out at the rt-found wait on the old code; 0 of 30 do with this change.
Fix: header() and hubText() go through setText (write only if different),
and goTo() sets each attribute only when it differs. The activity list's
heading chips already keep equal nodes through patch().
Test: routing-mode-goes now holds a press over one redraw. It counts the
routing interval's ticks through a wrapped setInterval, then does
mouse.down, waits for a tick, does mouse.up and expects .rt-found. On the
old routing.js this fails in all 10 WebKit cases at that wait (chromium
passes, since it clicks the common ancestor); with the fix it passes.
Run (playwright 1.62.0, chromium + webkit):
- routing-mode-goes: 40/40, en zh zh-TW ja de at 1100 and 420.
- group-switch-add-many, group-share, routing-key-windows,
routing-weight-chip, view-scrollbar-drag, routing-steady,
routing-idle-frame and routing-shape all pass.
- routing-live-patch failed one folded subtest only with 9 files run at
once. It passes 2/2 alone with and without this change: a fixed 400ms
sample, filed as #2174.
Not tried: the desktop app's WKWebView by hand. At 2% CPU (10/490) the
chip now clicks, but the view's scroll guard can still refuse or put back
the scroll when the click is handled more than 1s late. I left that
alone; it doesn't appear at 10%.