From d54d8e9e2dfbd31358b1f48e17338d74f5d270c0 Mon Sep 17 00:00:00 2001 From: amankumarsingh77 Date: Mon, 27 Jul 2026 23:37:04 +0530 Subject: fix(domains): restore fail-closed focus check in browser_type MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Adopting isFocusProbe inverted the safety default: the guard was ANDed into the condition gating the check, so a probe result the guard rejected skipped the check and fell through to Input.insertText — text typed into nothing, silently, which is the exact failure the block exists to prevent. The guard now feeds a value that defaults to { ok: false }, so a rejected shape produces the error instead of bypassing it. The other four guard adoptions (isFillResult, isFocusResult, isSelectResult, isPageResult) were already fail-closed: each feeds a value whose rejection lands on a pre-existing error branch. Also assert x/y in the box centre test — the fields snapshot's off-viewport filter reads — and wrap the zero-size message to the surrounding width. Co-Authored-By: Claude Opus 5 (1M context) --- test/domains/box-test.ts | 2 ++ 1 file changed, 2 insertions(+) (limited to 'test') diff --git a/test/domains/box-test.ts b/test/domains/box-test.ts index cb930a0..248ae38 100644 --- a/test/domains/box-test.ts +++ b/test/domains/box-test.ts @@ -5,6 +5,8 @@ import { centreOf } from "../../src/domains/box"; describe("box centre", () => { test("computes the centre from a content quad", () => { const b = centreOf({ content: [10, 20, 110, 20, 110, 70, 10, 70], width: 100, height: 50 }); + assert.equal(b.x, 10); + assert.equal(b.y, 20); assert.equal(b.cx, 60); assert.equal(b.cy, 45); assert.equal(b.width, 100); -- cgit v1.2.3