Skip to content

Engine: a shared-mode pointer into a background Firefox page is element-routed, focused by its press or refused, as on Chromium (#315) - #327

Merged
SSFSKIM merged 7 commits into
mainfrom
fix/315-gecko-routes
Nov 8, 2026

Conversation

@SSFSKIM

@SSFSKIM SSFSKIM commented Nov 8, 2026 •

Copy link
Copy Markdown
Owner

Corrected 2026-11-08, after the merge. This body first said that main's posted set_value and select_text fallback raised Firefox, and Safari, visibly after the screen hold: 26–30 ms after it, 6 of 11 tries. That was a misread in this PR's kit. On main, focusingClick drops the fallback click's delivery record, so the kit judged those raises against no hold. In fact the fallback click gets #321's hold until the order reads back, and the reorder falls inside it, hidden. #324's spike timed the screen freeze directly and found 0 visible raises on main: #324 (comment). This PR's change stands, with no posted click and no reorder at all. The evidence folder and the Decision Log are corrected in #324's PR.

Summary

In shared mode, clicks into a background Firefox page were lost: Gecko's page view refuses the first mouse, so the posted click never reached it (34 of 34 coordinate clicks, and 18 of 18 /fixedtail rows by token). Now a pointer into a Firefox page is carried through Accessibility, as on Chromium:

  • a button or link is pressed through the element route;
  • a text field is focused by its own press, with the focus read back;
  • anything else is refused, with nothing posted.

set_value and select_text now focus an unfocused Firefox field the same way. Before, they posted a click, which reordered Firefox above the person's window inside the screen hold, where it was hidden, and put a pointerdown on the page.

Closes #315

The rule (design session rulings cb252e88, 99e45959, 1cd6ed32 and 80a11b9a; the spec's #315 Decision Log entry)

Error text changes (models see these)

  • On a Firefox page, backgroundClickRefused adds what still works: "A text field on the page still works in the background: click the field by its element ID, which focuses it through accessibility, then type or set its value".
    • It is added on Gecko refusals only (drag, double click, a click with no action).
    • It is left off where the field's own press can't focus it, since an element click would fail the same way.
  • The alternatives point at the person, never at the model raising a window (ruling 80a11b9a). "bring forward or use a dedicated desktop" becomes "use a dedicated desktop, or ask the person to bring forward". This changes Chromium's macOS engine: a left click into a background Chrome page is swallowed as the window's activating click, and cua reports success #282 text too.
  • When the fallback can't focus the field, there are two new texts:
    • No action on the field: backgroundClickRefused, "…so nothing was changed".
    • Focus never reads back: clickUnconfirmed, "…so the requested value or selection was not written", followed by "observe before any retry".
  • docs/cua-api/agent-cursor.md's background-click paragraph now names Firefox. That paragraph, carried in the docs oracle and the surface inventory, is repl-parity's whole expected diff.

Live proof (GitHub-hosted macOS, main fc3b080 against the branch, behind a frontmost TextEdit, window order watched every 5 ms)

The evidence is in docs/evidence/2026-11-08-gecko-routes/.

Firefox, shared Main Branch
Coordinate click: button, checkbox, radio, link lost, 0/3 pressed, effect 3/3
Coordinate click into a text field, textarea or password field lost; type_text lands 0/3 focused by press; type_text lands 3/3
/fixedtail row below the top, by token 0/18 18/18
Plain-text click, drag, double click clickUnconfirmed; a double click leaks 2 pointer events refused, nothing reaches the page
set_value / select_text, unfocused field succeeds through a posted click; Firefox reorders above TextEdit inside the screen hold (hidden), and a pointerdown reaches the page succeeds 3/3, no raise, no pointerdown
Raises in any shared cell as above none

Runs:

The kit is probe/315-ab, off main.

Limits

  • The press is visible to the page. On an unfocused field, the page sees trusted mousedown, mouseup and click events (no pointerdown), as for any Gecko AXPress.
  • set_value and select_text record nothing in their meta about the focus fallback. That is logged as debt.
  • Firefox's toolbar still answers clickUnconfirmed although it works (Stated limits from #287: Firefox toolbar Reload unconfirmed, VS Code release no-op, VS Code Toggle Panel unresolved #318).
  • Gecko is recognised by Firefox 159's principal class only. That other Gecko builds carry it too is an assumption.
  • The new glue in ElementInput.swift reads live Accessibility, so it is covered by the hosted check rather than by unit tests.

Tests and review

Sminos-Session: cursor235#b93055dd (cua on macbook)

…nt-routed, focused by its press or refused, as on Chromium (refs #315)

Gecko (principal class GeckoNSApplication) gets #282's web-area rule: pointerView takes the page engine, a Gecko hit
inside an AXWebArea is a web area, and its chrome (toolbar, tabs) stays unknown, since Gecko's own click-through check
refuses only inside a XUL browser or tree. A Gecko text field is focused by its own action with its focus read back
(#313's readingFocus), never #283's AXFocused write. #288's establishment stays Chromium's. Dedicated mode, Chromium,
Safari and native apps are unchanged. GeckoPointerTests, 10.

Sminos-Session: cursor235#b93055dd (cua on macbook)
…und-click paragraph, plugin 0.27.7 (refs #315)

The entry records how Gecko is recognised, why the rule covers only Firefox's web area (Gecko's source and #287's
toolbar Reload cell), the focus route by press, drags, and what the hosted check must verify. The paragraph's new text
is carried by the docs test, repl-parity's docs oracle and the surface inventory's Table 3 addition (2026-11-07, #315).

Sminos-Session: cursor235#b93055dd (cua on macbook)
The plugin version stays 0.27.7, over #326's 0.27.6.

Sminos-Session: cursor235#b93055dd (cua on macbook)
…ks on its text fields (refs #315)

The design session's ruling 99e45959: on a Gecko page, backgroundClickRefused and its observe-first form add that a
text field still works by an element click on it, which focuses it through accessibility, then typing or set_value.
Keyed on the page engine the pointer carries (PointerTarget.engine), reaching set_value's and select_text's fallback
click, a drag, and a click on something with no action. Chromium's and every other engine's wording is unchanged.

Sminos-Session: cursor235#b93055dd (cua on macbook)
…Firefox page focuses the field by its press (refs #315)

The hosted A/B (run 42457001051, confirmations 42459610340 and 42460845888) found main's posted fallback setting the
value 3 of 3, which acb88f7's refusal lost. The design session's ruling 1cd6ed32: where #282 refuses the fallback's
pointer on a Gecko page, the field's own AXPick/AXPress goes, its focus is read back within 300 ms, and the method
proceeds; nothing writes AXFocused or a selection on that path. A field with no action is refused, one whose focus never
reads back answers clickUnconfirmed, each naming only Firefox brought forward and a dedicated desktop. Chromium, other
engines and dedicated mode are unchanged.

Sminos-Session: cursor235#b93055dd (cua on macbook)
…son bringing the app forward, Chromium's too (refs #315)

The design session's ruling 80a11b9a: no refusal may read as telling the model to raise the app, which in shared mode
puts a window over the person's. #282's shared template and every sentence #315 adds now say "use a dedicated desktop,
or ask the person to bring <App> forward"; Chromium's text changes with it. The review of acb88f7..146b76a (one P2):
the fallback's unconfirmed answer claims only that the requested value or selection was not written, since the field's
action went. The JS service tests, the first-call paragraph, its docs test, the parity docs oracle and the surface
inventory carry the new clause.

Sminos-Session: cursor235#b93055dd (cua on macbook)
…k logged as debt (refs #315)

Sminos-Session: cursor235#b93055dd (cua on macbook)
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 8, 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-08T09:15:23.216620Z 2423b8c 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: 2423b8c125

ℹ️ 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".

While you act in an app, a cursor labelled with this session's name shows the user where each action lands, unless the user has turned it off, and fades a few seconds after your last action. Your actions do not wait for it, it is not the user's pointer, and your screenshots do not show it.

A web page in a Chromium-based app (Chrome, Electron apps) that is in the background does not take a pointer: unless this Mac is a dedicated desktop, a left click, double click or drag there is refused with "<App>'s web page does not accept a background click; bring <App> forward or use a dedicated desktop", and nothing is sent. A plain click there on a button, checkbox, radio button, link, pop-up button or menu item goes through the accessibility action of that element instead, and one on a checkbox or radio button whose state does not change fails with `clickUnconfirmed`. A plain click there into a text field, text area or editable region gives it keyboard focus through accessibility instead, with no mouse event, so the page sees no click; the result's text says whether the caret was put at the point, and when it was not, typing goes to the field's existing selection or its start, so use select_text or set_value first if the position matters. A field that does not report focus fails with `clickUnconfirmed`. A click or drag that fails with `clickUnconfirmed` was sent but may only have activated the window: observe the app before any retry.
A web page in a Chromium-based app (Chrome, Electron apps) or in Firefox that is in the background does not take a pointer: unless this Mac is a dedicated desktop, a left click, double click or drag there is refused with "<App>'s web page does not accept a background click; use a dedicated desktop, or ask the person to bring <App> forward", and nothing is sent. A plain click there on a button, checkbox, radio button, link, pop-up button or menu item goes through the accessibility action of that element instead, and one on a checkbox or radio button whose state does not change fails with `clickUnconfirmed`. A plain click there into a text field, text area or editable region gives it keyboard focus through accessibility instead, with no mouse event, so the page sees no click; the result's text says whether the caret was put at the point, and when it was not, typing goes to the field's existing selection or its start, so use select_text or set_value first if the position matters. In Firefox the field is focused by its own accessibility action instead, which does not put the caret at the point. A field that does not report focus fails with `clickUnconfirmed`. A click or drag that fails with `clickUnconfirmed` was sent but may only have activated the window: observe the app before any retry.

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 Limit the no-click-event guarantee to Chromium

For a background Firefox text field, the expanded paragraph now promises “no mouse event, so the page sees no click,” but the new route invokes the field's AXPress. The committed evidence in docs/evidence/2026-11-08-gecko-routes/README.md explicitly reports trusted mousedown, mouseup, and click events from that press. Because this document is supplied to the model, the incorrect guarantee can cause it to treat focusing a Firefox field as free of click-handler side effects. Scope that guarantee to Chromium and describe Firefox's page-visible events, updating the matching docs oracle too.

Useful? React with 👍 / 👎.

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.

Gecko: shared-mode page clicks take #282's element route and #283's focus route, since Firefox refuses first mouse

1 participant