Repository navigation
Engine: a Chromium click writes the caret before any focus, and answers placed only when the reference box held still (#341) - #349
Merged
Conversation
…, then x, the linear scan deciding only what the search cannot (refs #290) A bisection in reading order finds the point's line and its place on it, and #283's linear scan over the few characters there places the caret; any other answer is the linear scan's over the whole value (within 5,000 characters) or over 5,000 around where the search ended, so no field is refused for its length. Unusable boxes are stepped past, never inferred across; boxes out of reading order and right-to-left text are not searched. Sminos-Session: cursor235#b93055dd (cua on macbook)
…sal, nothing read, as no search gives a window near the point (refs #290) Sminos-Session: cursor235#b93055dd (cua on macbook)
Sminos-Session: cursor235#b93055dd (cua on macbook)
…ed evidence, and 0.27.17 (refs #290) Sminos-Session: cursor235#b93055dd (cua on macbook)
…efused, not answered from a window near where the search stopped (refs #290) Sminos-Session: cursor235#b93055dd (cua on macbook)
… precondition, in the entry and the evidence (refs #290) Sminos-Session: cursor235#b93055dd (cua on macbook)
…aracters, and checks the boxes it read on every way out (refs #290) Sminos-Session: cursor235#b93055dd (cua on macbook)
…ed, an unknown direction authorizing no offset (refs #290) Sminos-Session: cursor235#b93055dd (cua on macbook)
…y write and places it by AXSelectedTextRange, AXFocused only the fallback, placed only where the field did not scroll (refs #341) AXFocused scrolls Chromium's textarea to its existing caret, so the boxes read after focus described a layout the screenshot never showed (46 of 60 placed claims wrong, run 42568677106). The offset, its fresh wait for boxes included, now comes first; the caret's write focuses the field; a reference character's box read before and after must not move more than a point. #296's guard after the wait now refuses with nothing written. Sminos-Session: cursor235#b93055dd (cua on macbook)
…t (refs #341) Sminos-Session: cursor235#b93055dd (cua on macbook)
…ite first and AXFocused its fallback (refs #341) Sminos-Session: cursor235#b93055dd (cua on macbook)
…t (refs #341) Sminos-Session: cursor235#b93055dd (cua on macbook)
…he fallback, placed only where the field did not move) and the hosted A/B's evidence, run 42578081142 (refs #341) Sminos-Session: cursor235#b93055dd (cua on macbook)
…ed at read-back, so a field a focus handler fills is not placed (refs #341) The review of round 1 (P2): the exemption was fixed before the writes, so a textarea filled and scrolled while taking focus, its caret still at {0, 0}, answered placed with its scroll unproven. It is now layoutMoved. Sminos-Session: cursor235#b93055dd (cua on macbook)
… writes and at read-back, so a field a focus handler clears is not placed either (refs #341) The review of round 2: a field with text, offset 0, cleared by its focus handler read empty at read-back and was waived the proof with its box unreadable after the writes. Both emptiness reads are now required. Sminos-Session: cursor235#b93055dd (cua on macbook)
… main merged (refs #341) Sminos-Session: cursor235#b93055dd (cua on macbook)
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #341
What changed
focusPlacingCaret(WebAreaFocus.swift), the Chromium click into a text field, now works in this order (the design session's ruling 1ea561bc:544):webAreaRereadDeadline, 2 s, or up to 3 s just after an enablement write.AXSelectedTextRange {offset,0}is written. On Chromium that write focuses the field without scrolling it.There is a fallback in two other cases. With no offset found, or for a password field, AXFocused works as before and the click answers the same reason.
"Placed" only when proven (condition 1). The box of the character beside the caret is read before the writes and again after the read-back, and may move at most 1 pt. Otherwise the click answers
focusedNotPlacedwith a new reason,layoutMoved, and a note asking for a new screenshot.An offset found by a re-read during the wait needs the same element and the same value length; focus is no longer a condition, since the field is not focused yet.
#296's check after the wait now runs before any write. A screen change found there refuses
screenChangedSinceScreenshotwith nothing written, so the caret reasonscreenChangedis gone. The design session approved this amendment (ruling 1ea561bc:550), and #296's entry cross-references it.The record also changes:
elementClick.actionandfocusStepname the write that focused the field;caretMarkShiftgives the reference box's move.WebKit (#313/#324) and Gecko never reach
focusPlacingCaret, and are unchanged.Spec: the #341 Decision Log entry, which amends #283's order. Evidence:
docs/evidence/2026-11-08-scrolled-caret/. Version 0.27.22, set at its merge turn (main is at 0.27.21 after #347).Why
Writing AXFocused scrolls a scrolled Chromium textarea to its old caret within 0–8 ms. Main then read the boxes of the top-scrolled layout and claimed "placed" for a caret on the wrong line. Typing then went somewhere other than where the model clicked, while the engine answered success.
Measurement first
Run https://github.com/SSFSKIM/cua/actions/runs/42568677106 (kit probe/341-measure; Chrome late and fresh, Safari, Firefox; 2 runners × 3).
A/B (hosted macOS)
Run https://github.com/SSFSKIM/cua/actions/runs/42578081142 (kit probe/341-ab e91c1e6): main 4cb51b3 against the branch, 2 runners × 3, shared mode with TextEdit frontmost.
layoutMoved+ 2 placed / 6 of 6 / 650→655layoutMoved+ 1 placed / 6 of 6Limits
layoutMovedwith the caret right. That is never wrong, only conservative. The finer proof, re-running the box search at the point after the writes (about 30 reads), is Engine: a caret placed on a partly clipped textarea line answers not placed (layoutMoved); prove it by re-running the box search at the point #348.Tests and review
WebAreaFocusTests(48, 9 of them new):layoutMovednote;swift testpasses: 1,091 tests, with main 95ed66e merged.plugin,test,engine-swift,parity-browseris GREEN on d335289, the head merged with main 95ed66e at 0.27.22: https://github.com/SSFSKIM/cua/actions/runs/42592550254. parity-browser passed on a rerun of its failed job; the first attempt hit only the known racy cellapi/browser-playwrightlocator/waitforlocator-contract-diagnostics-no-matches(tech-debt-tracker.md, 2026-10-18).Residue
Sminos-Session: cursor235#b93055dd (cua on macbook)