Skip to content

The scroll is a mouse wheel whose effect is read back; the coordinates flake and its races fixed (#168, #141) - #382

Merged
SSFSKIM merged 21 commits into
mainfrom
fix/168-drag
Nov 15, 2026
Merged

SSFSKIM merged 21 commits into
mainfrom
fix/168-drag

Conversation

@SSFSKIM

@SSFSKIM SSFSKIM commented Nov 15, 2026 •

Copy link
Copy Markdown
Owner

#168's step 2 asked about the drag cell. The cause turned out to be cua's scroll: a synthesized gesture that stalls whenever Chrome is short of rendered frames. That stall is #141. This PR replaces the scroll with a mouse wheel whose effect is read back. It also fixes three smaller races the hunt surfaced, and it makes a red parity-browser log say which cell failed and why.

What the failures were

parity-browser's public lines already named each failed case (the indented failed assertion: lines). Across every failed run, the assertion failures outside the waitfor race (#381) all came from one scenario, input/coordinates. The failures were spread over all six of its member cases, five on each host. Each member runs the scenario's five cells, so the member's name never said which cell failed. Idle runners hid the cause (CI-opt: 10/10 green on 862429e). Under load it showed:

  • scroll: Input.synthesizeScrollGesture ran past the host's 10 s. A gesture answers only after Chrome has rendered it frame by frame.
  • drag, once at cpu:1: a slow dispatch, then the cell's 1.5 s wait for ended ran out.
  • No detach cascade from a locator wait was seen. But a real-host test shows the detach, and the old gesture's own timeout causes the same cascade on Linux (below).

Commits

Every fix was tested first: RED, then GREEN.

  • 862429e, 51d6cef: parity-browser's public lines say why a case failed, in fixture data only (ruling 719). For each failed case they give the kind of its assertion reason, and each cell's outcome, ms, and its labelled value or its error's code. For an error they also say whether it timed out, which CDP command it names, whether the debugger was detached, and whether the selector's deadline ran out. An other reason names the cells it mentions. Every string is a fixture word or <withheld>, and no error text appears.

  • 863c7ec, 8b96ecd, d988641, d5960d3: the parity-browser-stress gate (diagnosis only; on: [dispatch], so a plain ci-gate never selects it). PARITY_STRESS=cpu:<n> adds n yes burners per core while the api suite runs. PARITY_CHROME_FLAGS=anti-throttling exists for diagnosis but is off the run line. The new gate is ci-kit.yml's only change; parity-browser's own entry is untouched.

  • 261622d: the drag cell waits for the fixture's recorded dragEnd (html[data-recorded-dragend]) for the scenario's 3 s, as the type and double cells do. Its test runs the real fixture page and the real cell with every POST taking 900 ms. It is RED on the old 1.5 s.

  • 19e1c11: the no-matches waitFor cell (Fix two flaky tests: the settle clock test and parity-browser's waitfor cell (#168) #381) splits its error at the context line. On a loaded runner the vendor host's deadline wording ran over several lines (stress run 43675966194).

  • 22494ed: a locator's CDP commands keep the tab's debugger when their budget runs out (preserveOnTimeout, as waits, evaluate and downloads already did; ruling 726). Before, a wait that ran out with its Runtime.evaluate in flight made src/chrome/host.mjs detach the tab, and the next action met a detached debugger. A real-host test shows the detach before and none after.

  • cecbaa7: the coordinate and DOM-CUA scroll is a mouse wheel at the point, with its effect read back (src/browser-service/wheel-scroll.mjs; rulings 726, 727). Before the wheel, the page names the first scroller outward from the point with room in the asked direction, through same-origin frames, as Chrome chains a wheel. Then:

    • No room anywhere: the wheel is sent and the scroll answers ok at once, as before.
    • Room, and it moves within 3 s: ok.
    • Room, but nothing moves within 3 s: code timeout, "Timed out after 3000ms waiting for the scroll to take effect: the wheel was sent, but nothing was seen to scroll; the page may handle the wheel itself, so observe the page before retrying."
    • A cross-origin frame at the point: can't be observed, so it answers ok, as before.

    Tests, all RED against the gesture: moved; no room; room but no movement; a page that calls preventDefault and moves its own content; an inner scroller at its edge chaining to the page; overflow:hidden; a same-origin frame; a cross-origin frame; page reads keep the debugger. The Decision Log entry is in the browser-service spec.

  • 9ca99f3: the Linux proof (below). 4909d0b: cua-linux VM Chrome: Input.synthesizeScrollGesture stalls after an ssh-launched Chrome; browser scroll cases pending-environment in #116 M4 #141's pending declaration retired. bcf80db: tracker.

Review fix wave (5711371)

reviewer-medium found five defects in wheel-scroll.mjs at bcf80db, each reproduced in a clean headless Chrome. The coordinator checked all five against rulings 726 and 727. All five are fixed, tested first in real Chrome: test/browser-service/wheel-scroll-chrome.test.mjs runs a headless Chrome with a scratch HOME and no display, and skips without one. At bcf80db the five finding tests failed and the four baseline behaviours passed (docs/evidence/2026-11-15-wheel-scroll-linux/review-fix/red-at-bcf80db7.txt). Now all 9 pass (green-real-chrome.txt).

  1. [P1] A failed probe counted as "unobservable", so the scroll sent the wheel and answered ok unconfirmed. The design session's ruling: a probe the page does not answer (busy, navigating, failing) sends no wheel and answers code timeout, "Timed out after 3000ms: the page did not answer the scroll's probe, so no wheel was sent; nothing was scrolled, so it is safe to retry." A clean failure with no side effect is retry-safe; a wheel queued into a stalled renderer would land later, unconfirmed. Only a frame the page can't read still skips confirmation.
  2. [P2] The scroller's identity was a child-index path, so a sibling the page inserted could stand in for it. It is now the element itself, a remote object in an object group the scroll releases, read with Runtime.callFunctionOn. A disconnected element reads as gone.
  3. [P2] Open shadow roots weren't searched. The probe now descends through shadowRoot.elementFromPoint and walks the composed tree outward (slot, parent, shadow host). Decision on closed roots: a closed root is its host's content, which the page can't read. Its room is the host's and its ancestors', so a scroll that only something inside it could take gets the honest no-movement answer, never an ok.
  4. [P2] RTL scrollLeft. Horizontal room now follows the scroller's direction: an RTL scroller runs from 0 at its right edge into negative offsets. Both directions are tested, in LTR and RTL.
  5. [P2] overflow:hidden on the root. The document scrolls only when the viewport's overflow (html's, else body's when html's is visible) is neither hidden nor clip. A scroll-locked page therefore has no room and answers ok at once.

wheel-scroll.test.mjs now covers the protocol itself, which needs no Chrome: the probe's object, the wheel only after the probe, the held scroller read until it moves, release, and no wheel on a failed probe. The Decision Log entry carries the new rules.

Review fix wave 2 (98c7761)

The re-review at daa74a5 found that the five fixes held, plus two new defects and one test issue. All three are fixed, tested first in real Chrome (review-fix/red-at-daa74a58.txt: both new tests failed there):

  1. [P2] A shared remote-object group. Every scroll released the module-wide group, so overlapping scrolls in a tab (browser commands aren't serialized) released each other's scroller. Each scroll now has its own group and releases only that. Test: two overlapping scrolls, the reviewer's case.
  2. [P2] Closed shadow roots answered ok. A closed root's host read as a leaf. I took the CDP route: the probe starts from Chrome's own hit test (DOM.getNodeForLocation, which sees into closed trees), resolves the node (DOM.resolveNode), and walks outward from it in the page; from inside a closed tree, getRootNode().host reaches the host. No DOM domain toggle was added: the service's frame-boundary hit test (actions.mjs) already calls getNodeForLocation without one, and this works the same way. Tests: a closed root's scroller is found and watched, and the honest answer when its wheel is taken.
  3. [Minor] The shared test table. Each Chrome now gets its own page table, and the cross-origin test asserts its frame actually loaded the cross-origin page.

On daa74a5, the test gate with the bounded harness failed instead of hanging, which showed the cause. A cold Chrome's first wheel on hosted macOS took over 1 s, past the tests' 1 s bound, and teardown's rm raced Chrome's helpers (ENOTEMPTY). The tests now use the production 3 s bound, and teardown retries and tolerates the race.

Review fix wave 3 (35b5eee)

The re-review at 0906b5f found one defect. [P2] Same-site cross-origin frames read as observable. Chrome can keep a same-site, cross-origin frame (the same host on another port) in the page's renderer. There, the CDP hit test returned a node inside the frame, and a frame that took the wheel then answered the no-movement timeout. The design session's ruling: any cross-origin frame is unobservable, whatever renderer Chrome puts it in. Whether Chrome shares a renderer depends on its process model (Origin-Agent-Cluster, site isolation, memory pressure), and an answer that varies with process allocation would differ from one machine to the next. Observing such frames through their own debugger sessions is a much larger change and outside this PR. So the probe walks from the hit node's window up to the top, and any cross-origin level (a parent read that throws, or a null frameElement) answers unobservable: the wheel and ok, as the gesture did. Test first, in real Chrome: a 127.0.0.1 frame on a second port inside a 127.0.0.1 page answers the wheel and ok, whether it scrolls or takes the wheel (review-fix/red-at-0906b5fc.txt). The localhost frame test stays, and a same-origin frame is still observed. The Linux probe was not rerun: its pages have no cross-origin frame, and the walk answers immediately for a top-level page, so the change can't reach its conditions.

The type cell's evidence (0473d00)

When input/coordinates' type cell isn't acknowledged, its error now says what it saw: whether #input had the focus, what had it (tag and id), and the input's value. parity-browser's public lines print that as fixture data. On success its value is unchanged ('pointer'). Tests first: the cell's error carries the fields, and the public line prints them with paths withheld. With browser-parity included, the covering suites give 758 tests, 756 pass, 0 fail, 2 skipped.

#141's proof, and what it is not

#141's proof is an isolated Linux probe on the #171 VM (9ca99f3, docs/evidence/2026-11-15-wheel-scroll-linux/), not a full repl-parity Linux run. It ran cua's browser service on the VM's Chrome through cua serve over MCP. The corpus's own input/coordinates and input/dom scroll cells ran verbatim. It used a scratch HOME, Chrome for Testing with cua's extension unpacked, and a private Xvfb display; nothing of the VM's own Chrome or profiles was touched. The old gesture (d988641) and the wheel (d5960d3) ran side by side on the same Chrome:

route load front dom front behind another tab front, unfocused
gesture idle 10/10 10/10 0/10, 10 s synthesizeScrollGesture timeout 0/10, Debugger unattached (the timeout before it detached the tab)
gesture cpu:2 10/10 10/10 0/10, the same 0/10, the same
wheel idle 10/10, ~85 ms 10/10 10/10 10/10
wheel cpu:2 10/10, ~110 ms 10/10 10/10 10/10

Rerun on the fix waves' code (5711371, then 98c7761 with the CDP hit test), the same harness and the same table: the wheel moved 80/80 again (median 80–137 ms; front, behind, unfocused and dom, idle and cpu:2). The gesture reproduced its 0/10 behind and its 0/10 detach cascade (388db18, trials-5711371c.jsonl; 0906b5f, trials-98c77619.jsonl, 80/80 again).

cua's agent tab opens behind the window's first tab, which is #141's stall. Under the service's focus emulation such a tab reads visibilityState: visible, so the probe took the front tab from the window title. That is why #141's pending declaration is retired (4909d0b), not deleted: a new repl-parity run --pending-cell input/coordinates#scroll now refuses with the reason. The scopes stay only to validate the M5 Linux runs recorded with them, which the M5 evidence tests read again.

macOS:

  • Hosted parity-browser on d5960d3 (the ci-gate run below), which runs both scroll cells on a visible tab.
  • CI-opt's cpu:2 batch p168p on d5960d3 (no flags), 10 runs:
    • cdp Input.synthesizeScrollGesture appears 0 times. The wheel removed the 10 s gesture stall, and it never answered ok without movement.

    • The scroll still failed in 3 of 10 runs, all on cua's host. Each failure is the honest no-movement answer at about 3 s, and each came right after an earlier cell in the same case had stalled:

      • 43687751271 cuaapi/drag: drag 4170 ms on Runtime.evaluate.
      • 43687754678 tab/cua: double 5624 ms on Runtime.evaluate, then drag 10021 ms on Input.dispatchMouseEvent.
      • 43687771666 tab/dom-cua: double 4375 ms on Runtime.evaluate.

      That is the contract working as ruling 727 intends, inside a renderer that had already stalled. It is not a scroll defect.

    • The drag's remaining 2 of 10 are CDP stalls (Runtime.evaluate, Input.dispatchMouseEvent), not the dragEnd wait.

    • Every one of the 10 runs is red from the download family (Residue). The stress gate stays diagnostic.

  • The unstressed parity-browser batch p168u on bcf80db, the normal gate's proof for parity-browser hosted gate: fix the two racy parity cells (waitfor deadline race, drag ended wait), then run it on PRs #168 step 3: 10/10 GREEN (43694549262, 43694551599, 43694552675, 43694552933, 43694555954, 43694560569, 43694564270, 43694569310, 43694573202, 43694577217).
  • CI-opt's 5-run unstressed batch p168v on 0906b5f: 4 GREEN, 1 RED (43704322197, vendor host: an unacknowledged type, then a cascade; see Residue). cua's host passed 290/290 in that run.
  • No macOS background-tab run was made. The wheel route is plain CDP with no platform branch, and the Linux probe's tab behind another tab is the same hidden-renderer state macOS occlusion produces.

p168f's dom-scroll ok: false after 5664 ms (43686810388, on the gesture path at d988641) cannot come from the wheel scroll itself. With room to move, the scroll answers ok only after it has read the scroller's position change in the asked direction. Otherwise it answers the timeout error above, about 3 s after the wheel. So a cell's own scrollY read always follows a confirmed move.

Gates

Residue

  • The download and file-chooser cases fail under load on both hosts. That is tech-debt-tracker.md's new 2026-11-15 entry, a ticket candidate. At cpu:2, the vendor host failed 10/10 on download/path, filechooser/ismultiple, filechooser/setfiles, locator/downloadmedia and waitforevent. cua's host also failed 10/10; with the anti-throttling flags it fell to 4–7 of 10, but waitforevent stayed at 10. Locator-contract cells also timed out in attach setup under load.
  • Under cpu:2, cua's browser host stalls CDP commands for 4–10 s, while the vendor host passes them in the same runs. The stalled commands are Runtime.evaluate and Input.dispatchMouseEvent, in the coordinates and locator families (p168p: locator click and check at 4.1–5.8 s in 43687775105 and 43687779366; one run's stall spanned several cells). The cause is unknown. Candidates are the extension's service worker, or the debugger transport starved under load. This is a separate product finding and a ticket candidate.
  • What's left for parity-browser hosted gate: fix the two racy parity cells (waitfor deadline race, drag ended wait), then run it on PRs #168: the vendor host's unacknowledged type. In 15 unstressed hosted runs (p168u 10/10, p168v 4/5), one red came from input/coordinates' type cell on the vendor host. Its click and type raised nothing, but the fixture never acknowledged pointer. The next cell's END then scrolled the unfocused page to its bottom, which explains end-key 0/0, the missed double click and drag, and the scroll's before: 1970 with no room. Scroll restoration was ruled out: every case gets a fresh tab. The cause is unproven; a first click that doesn't focus an inactive window (macOS "first mouse") is one candidate. 0473d00 makes the next one name its cause: the cell's error, and parity-browser's public line, now carry seen {focused, active: {tag, id}, value}.
  • parity-browser hosted gate: fix the two racy parity cells (waitfor deadline race, drag ended wait), then run it on PRs #168 step 3 (adding pr to parity-browser's on:) stays with CI-opt.

Refs #168
Closes #141

Sminos-Session: linux171#3c5ca588 (cua on dc-linux171-1e68)

…168, ruling 719)

A run's public lines named a failed case and nothing more, so a red gate read only "assertions FAIL covered
289" and every reader had to hunt for the cause. Each failed case now also gets the kind of its
assertion's reason (side-effects, unexpected-result or cell-error with the cell, cell-count, other), each
cell's outcome and time, its value or its error's code and whether it timed out, and what the fixture
recorded. Every string in them is a fixture word or withheld, so no path, address, environment or stderr
leaves the runner; an error message is never printed. No artifact: these lines carry the same data.

Sminos-Session: linux171#3c5ca588 (cua on dc-linux171-1e68)
…loaded, for diagnosis only (#168)

CI-opt's 10 idle runs on 862429e were all green, and the coordinates scenario's failures look load-driven,
so hosted.sh takes PARITY_STRESS=cpu:<n>: n `yes` burners per core, run while the browser item's api suite
runs on both hosts and stopped by their own pids (and at exit). Unset, nothing changes. A new gate,
parity-browser-stress, sets cpu:1 and is dispatch only, so a ci/** ref's run never selects it; it runs by
`ci-gate --gates parity-browser-stress`. Gate parity-browser is unchanged. A bad value, or a value for the
denials item, is refused before anything starts.

Sminos-Session: linux171#3c5ca588 (cua on dc-linux171-1e68)
…er reason by the cells it names (#168)

The stressed batch's drag failure read only "timeout true", and two cases failed with every cell ok and
reason "other", so the log could not say what timed out or which check failed. A failed cell's error now
also names the CDP command it says timed out (a method name such as Runtime.evaluate), whether the tab's
debugger was gone, and whether the locator's own deadline ran out; an "other" reason names the case's
cells it mentions. Still no error text: each is a method name, a label or a boolean.

Sminos-Session: linux171#3c5ca588 (cua on dc-linux171-1e68)
cpu:1 gave one coordinates failure in 20 host-runs; the next diagnosis batch runs at cpu:2 for more.

Sminos-Session: linux171#3c5ca588 (cua on dc-linux171-1e68)
…#141's diagnosis

PARITY_CHROME_FLAGS=anti-throttling launches the harness Chrome with --disable-renderer-backgrounding,
--disable-backgrounding-occluded-windows and --disable-background-timer-throttling; any other value is
refused before anything starts. The stress gate sets it beside cpu:2 for one batch, to tell a CPU-starved
renderer from a throttled one under Input.synthesizeScrollGesture (ruling 726). Gate parity-browser is
unchanged.

Sminos-Session: linux171#3c5ca588 (cua on dc-linux171-1e68)
…he scenario's 3 s (#168)

On a loaded hosted runner the drag cell failed once (parity-browser-stress at cpu:1, run 43676007456): the
drag took about 4.8 s and then its 1.5 s wait for 'ended' ran out. The end is acknowledged only after the
records queued before it have been POSTed, so a slow fixture server alone can pass 1.5 s. The cell now
waits, as the type and double cells do, for the fixture's acknowledgement (html[data-recorded-dragend]) for
3 s. A test runs the real fixture page and the real cell with every POST taking 900 ms.

Sminos-Session: linux171#3c5ca588 (cua on dc-linux171-1e68)
…ine (#168)

On a loaded hosted runner the vendor host's deadline wording ran over several lines (parity-browser-stress
run 43675966194: six lines after the first), and the cell, which took only the first line as the deadline's,
compared the rest and failed the contract. It now splits at the context line, so any number of lines name
the deadline and only the context and diagnostics lines are compared.

Sminos-Session: linux171#3c5ca588 (cua on dc-linux171-1e68)
…n its budget runs out (#168)

A locator's commands (the selector engine's and the injected scripts') were sent bounded by the locator's
own budget but without preserveDebuggerOnTimeout, so when a wait ran out with its Runtime.evaluate still in
flight, the host's copy of that budget expired too and src/chrome/host.mjs detached the tab: the next action
in that tab met a detached debugger. The timeout is the caller's, not a stuck debugger, so every locator
command now keeps the debugger, as waits, evaluate and downloads already do (ruling 726). Tests: on the real
host, a locator evaluation that runs out mid-evaluate leaves the tab attached and the next action needs no
re-attach; every command the locator engine sends over frames, handles and a timed-out poll carries the flag.

Sminos-Session: linux171#3c5ca588 (cua on dc-linux171-1e68)
… not a synthesized gesture (#141, #168)

The coordinate and DOM-CUA scroll synthesized a gesture (Input.synthesizeScrollGesture), which answers only
once Chrome has rendered it frame by frame, so a loaded machine or a renderer starved of frames ran it past
the host's 10 s: #141 on the Linux VM, and the coordinates scenario's flake on the hosted gate under load.
It now sends a mouse wheel at the point and reads the effect back (src/browser-service/wheel-scroll.mjs;
rulings 726, 727). The page first names what the wheel would scroll, the first scroller outward from the
point with room in the asked direction, through same-origin frames, as Chrome chains it. With no room, the
wheel is sent and the scroll answers at once, as before. With room, it waits up to 3 s for that scroller to
move, else answers code timeout saying the wheel was sent, nothing was seen to scroll, and the page may
handle the wheel itself. A cross-origin frame at the point cannot be observed and answers as before. The
route change and its reason are in the browser-service spec's Decision Log.

Tests (RED against the gesture, then GREEN): one wheel at the point and ok once the page scrolled; no room
answers at once; room but no movement times out with that answer; a page that handles the wheel itself gets
it too; an inner scroller with room is watched, one at its edge chains to the page; overflow:hidden is no
scroller; same-origin frames are entered; a cross-origin one answers as before; the page reads keep the
debugger.

Sminos-Session: linux171#3c5ca588 (cua on dc-linux171-1e68)
… the wheel scroll under load (#168)

Sminos-Session: linux171#3c5ca588 (cua on dc-linux171-1e68)
… it (#141, #168)

An isolated probe on this VM: a scratch HOME and cua home, Chrome for Testing with cua's extension unpacked
on a private Xvfb display, cua serve over MCP running the corpus's own scroll cells verbatim. The gesture
stalled 0/10 idle and 0/10 at cpu:2 whenever the agent's tab was behind another (#141), each a 10 s
timeout whose detach then failed the next action; the wheel moved 80/80 (front, behind, unfocused, dom;
idle and cpu:2) in about 0.1 s. Not a full repl-parity Linux run; the README says what ran.

Sminos-Session: linux171#3c5ca588 (cua on dc-linux171-1e68)
)

#141 is fixed by the wheel scroll, so a new run can no longer declare input/coordinates#scroll or
input/dom#scroll pending on Linux (repl-parity run refuses with the reason). The scopes stay only to
validate the runs recorded with them, which the M5 evidence tests read again; deleting them would break
those. Test first: a new run's declaration is refused as retired, a recorded one still resolves.

Sminos-Session: linux171#3c5ca588 (cua on dc-linux171-1e68)
…amily under load is open (#168)

Sminos-Session: linux171#3c5ca588 (cua on dc-linux171-1e68)
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 15, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-15T08:29:13.487607Z bcf80db PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: bcf80db767

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/browser-service/wheel-scroll.mjs Outdated
Comment on lines +46 to +47
const el = doc.elementFromPoint(px, py);
if (el != null && (el.tagName === 'IFRAME' || el.tagName === 'FRAME')) {

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Follow shadow-root hit targets when selecting the scroller

When the pointer is over a scrollable element inside a shadow root, document.elementFromPoint() returns its host, so this probe skips the actual scroller. If the outer document also has room, the wheel scrolls the shadow-root content successfully but the polling loop watches the unchanged outer document and returns a timeout after 3 seconds. This affects both coordinate scrolling and DOM-CUA scrolling of shadow content, which visible-dom.mjs already traverses. Descend through accessible shadow roots and use a shadow-aware path for subsequent reads rather than treating the host as the wheel target.

Useful? React with 👍 / 👎.

Comment thread src/browser-service/wheel-scroll.mjs Outdated
const style = root ? null : doc.defaultView.getComputedStyle(el);
const scrolls = overflow => root || /^(auto|scroll|overlay)$/.test(overflow);
const roomY = dy > 0 ? el.scrollHeight - el.clientHeight - el.scrollTop : dy < 0 ? el.scrollTop : 0;
const roomX = dx > 0 ? el.scrollWidth - el.clientWidth - el.scrollLeft : dx < 0 ? el.scrollLeft : 0;

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Account for negative horizontal offsets in RTL scrollers

For a horizontal direction: rtl scroller, Chrome uses scrollLeft === 0 at the right edge and negative offsets toward the left. This calculation assumes the LTR range: a positive horizontal wheel at the right edge is incorrectly classified as having room and therefore times out instead of completing as an edge no-op. Conversely, a negative wheel can skip an RTL scroller that does have room, potentially watching an unchanged ancestor while the intended element moves. Calculate directional room using the element's actual horizontal scroll range.

Useful? React with 👍 / 👎.

…review; #141, #168)

PR #382's review found five ways the wheel scroll could answer wrongly, each reproduced in real Chrome:
1 (P1) a probe that failed or timed out became "unobservable", and the scroll sent the wheel and answered
  ok unconfirmed. Now a probe the page does not answer sends no wheel and answers code timeout, "the page
  did not answer the scroll's probe, so no wheel was sent; nothing was scrolled, so it is safe to retry"
  (the design session's ruling).
2 (P2) the scroller was found again by child-index path, so a sibling the page inserted could stand in for
  it. It is now held as the element itself (a remote object in a released group) and read by callFunctionOn.
3 (P2) open shadow roots were not searched. The probe now descends into them under the point and walks
  the composed tree; a closed root is its host's content.
4 (P2) horizontal room ignored RTL scrollers (0 at the right edge, negative offsets). It now follows the
  scroller's direction.
5 (P2) the document always counted as scrollable. The viewport's overflow (html's, else body's) now
  decides; hidden or clip means no room, so a scroll-locked page answers ok at once.

Tests first: test/browser-service/wheel-scroll-chrome.test.mjs drives a real headless Chrome (scratch
HOME, no display; skipped without one), one test per finding plus the earlier behaviours; at bcf80db the
five finding tests failed and the four others passed (review-fix/red-at-bcf80db7.txt), now 9/9
(green-real-chrome.txt). wheel-scroll.test.mjs now covers the protocol without Chrome. The Decision Log
entry carries the new rules.

Sminos-Session: linux171#3c5ca588 (cua on dc-linux171-1e68)
…141, #168)

Sminos-Session: linux171#3c5ca588 (cua on dc-linux171-1e68)
…macOS (#382)

The test gate on 388db18 ran to its 20-minute limit twice on the hosted macOS runner, where the
real-Chrome scroll tests run against Chrome for Testing (on Linux they finish in about 15 s). Chrome now
starts with Puppeteer's quiet set (--use-mock-keychain, --password-store=basic, no background fetches);
every startup step, page load and CDP command is bounded and names what stalled; each test has a
60 s bound; teardown closes the fixture server's connections and SIGKILLs a Chrome that does not exit.

Sminos-Session: linux171#3c5ca588 (cua on dc-linux171-1e68)
… own object group (#382 re-review)

The re-review at daa74a5 found two defects. (1) Every scroll used one module-wide remote-object group and
released it whole, so overlapping scrolls in a tab released each other's scroller: a no-room scroll
elsewhere made an earlier one time out after its box had moved. Each scroll now has its own group and
releases only that. (2) A closed shadow root read as a leaf (host.shadowRoot is null), so a scroll over a
scroller inside one answered ok without movement. The probe now starts from Chrome's own hit test
(DOM.getNodeForLocation, which sees into closed trees and needs no DOM domain toggle: the service's frame
boundary hit test already calls it without one), resolves that node, and walks outward from it in the
page; from inside a closed tree its host is reachable. The Decision Log entry says so.

Tests first, in real Chrome: two overlapping scrolls; a closed root's scroller found and watched, and the
honest answer when its wheel is taken. Both failed at daa74a5 (review-fix/red-at-daa74a58.txt). The test
table is no longer shared between Chromes, and the cross-origin test proves its frame loaded. The bound in
these tests is the production 3 s (a cold Chrome's first wheel on hosted macOS took over 1 s), and their
temporary profile's removal tolerates Chrome's helpers still writing. Covering suites 471/473, 2 skipped
(review-fix/covering-suites-wave2.txt).

Sminos-Session: linux171#3c5ca588 (cua on dc-linux171-1e68)
Sminos-Session: linux171#3c5ca588 (cua on dc-linux171-1e68)
… the wheel scroll (#382 re-review 2)

A same-site cross-origin frame (the same host on another port) that Chrome keeps in the page's renderer
was read as observable: the CDP hit test returned a node inside it, and a frame that took the wheel then
answered the no-movement timeout. By the design session's ruling, any cross-origin frame is unobservable,
whatever process Chrome puts it in, so the answer never depends on process allocation: the probe now
walks from the hit node's window to the top and answers unobservable at any cross-origin level (a parent
read that throws, or a frameElement that is null). Same-origin frames and closed shadow roots are as before.

Test first, in real Chrome: a 127.0.0.1 frame on a second port in a 127.0.0.1 page answers the wheel and
ok, whether it scrolls or takes the wheel (red-at-0906b5fc.txt), with the localhost frame test kept and a
same-origin frame still observed. Covering suites 472/474, 2 skipped (covering-suites-wave3.txt).

Sminos-Session: linux171#3c5ca588 (cua on dc-linux171-1e68)
…168)

One unstressed hosted run in 15 (p168v, 43704322197, the vendor host) failed input/coordinates' type cell:
its click and type raised nothing, but the fixture never acknowledged 'pointer'. The cells after it then
cascaded (END scrolled the unfocused page to its bottom). The cause could not be read. When the
acknowledgement times out, the cell's error now says what it saw: whether #input had the focus, what had it
(tag and id), and the input's value, as a `; seen {...}` tail. The value on success is unchanged
('pointer'). parity-browser's public lines print that tail as fixture data (ruling 719), the empty string
now a fixture word. Tests first: the cell's error carries those fields, and the public line prints them
with any path withheld.

Sminos-Session: linux171#3c5ca588 (cua on dc-linux171-1e68)
…#141)

The browser service's scroll (a mouse wheel whose effect is read back) and its locator commands keeping the
tab's debugger on timeout reach the plugin; 0.28.0 to 0.28.1, the next free number.

Sminos-Session: linux171#3c5ca588 (cua on dc-linux171-1e68)
@SSFSKIM
SSFSKIM merged commit b99232d into main Nov 15, 2026
10 checks passed
SSFSKIM added a commit that referenced this pull request Nov 15, 2026
Sminos-Session: linux171#3c5ca588 (cua on dc-linux171-1e68)
SSFSKIM added a commit that referenced this pull request Nov 17, 2026
Main brings #374's Show Menu confirmation, #382's scroll, #368, #381 and #171 M4. Conflicts resolved by keeping both
sides: Input.swift's meta (typeReadback, keyEffect and menu), the engine service's per-call and optional meta keys and
its header, the service test (#354's and #374's tests both), the spec's errors list (menuUnconfirmed and
typeUnconfirmed), the surface inventory's Table 3 sections (#354's, then #374's), PROVENANCE.md's agent-cursor row
(#374's fourth-paragraph sentence and #354's sixth paragraph), and repl-parity's docs oracle, rebuilt from main's
fourth and fifth paragraphs and #354's sixth so it equals agent-cursor.md byte for byte.

Sminos-Session: cursor235#b93055dd (cua on macbook)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

cua-linux VM Chrome: Input.synthesizeScrollGesture stalls after an ssh-launched Chrome; browser scroll cases pending-environment in #116 M4

1 participant