From bcb1918d1066b978545e2cd8d276e7f78ac0793b Mon Sep 17 00:00:00 2001 From: "fizzy-linux[bot]" <346940526+fizzy-linux[bot]@users.noreply.github.com> Date: Wed, 28 Oct 2026 01:39:16 -0500 Subject: [PATCH] linux: work-562 (codex) Agent-Team: linux Worker: codex --- .github/workflows/ci.yml | 6 +++--- scripts/test-web-text-input.sh | 3 ++- web/tests/embed.test.mjs | 9 ++++++--- 3 files changed, 11 insertions(+), 7 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 4fbcfec97..21d9f9310 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -275,10 +275,10 @@ jobs: if: matrix.name != 'Windows' shell: bash run: | - bash scripts/ci-retry.sh zig build check-web - scripts/test-web-text-input.sh --embed-only + bash scripts/ci-retry.sh zig build web + scripts/test-web-text-input.sh - # `check-web` sets no `-Dapp-layout`, so the web build's layout wiring is a no-op there; this + # The build above sets no `-Dapp-layout`, so its layout wiring is a no-op there; this # builds wasm with an app-owned `.zon` and `.zig` layout, and fails if that wiring is gone. - name: Compile web (wasm) build with a custom layout if: matrix.name != 'Windows' diff --git a/scripts/test-web-text-input.sh b/scripts/test-web-text-input.sh index 5079e7b92..6ba3733ce 100755 --- a/scripts/test-web-text-input.sh +++ b/scripts/test-web-text-input.sh @@ -1,7 +1,8 @@ #!/bin/sh # The hidden input's tests (web/tests/text-input.test.js) against the web.js the web build # writes: `zig build web` first. Node also runs the two-copy embed check. -# Use --embed-only for the build-independent Node check; hidden-input tests also support jsc. +# CI builds the web assets and runs both suites. Use --embed-only for the build-independent +# Node check; hidden-input tests also support jsc. set -eu cd "$(dirname "$0")/.." if [ "${1:-}" = --embed-only ]; then diff --git a/web/tests/embed.test.mjs b/web/tests/embed.test.mjs index 5246d9663..d07ccc659 100644 --- a/web/tests/embed.test.mjs +++ b/web/tests/embed.test.mjs @@ -40,19 +40,20 @@ class Element extends Target { setAttribute() {} focus() {} getBoundingClientRect() { return { left: 0, top: 0, right: 100, bottom: 100 }; } - requestFullscreen() { document.fullscreenElement = this; this.fullscreen++; document.dispatch("fullscreenchange", {}); return Promise.resolve(); } + requestFullscreen() { fullscreenStack.push(this); document.fullscreenElement = this; this.fullscreen++; document.dispatch("fullscreenchange", {}); return Promise.resolve(); } } class Canvas extends Element { constructor() { super(); this.clientWidth = 100; this.clientHeight = 100; } getContext() { return {}; } } +const fullscreenStack = []; const document = Object.assign(new Target(), { fullscreenElement: null, baseURI: "http://localhost/", body: new Element(), documentElement: new Element(), createElement: (tag) => (tag === "canvas" ? new Canvas() : new Element()), - exitFullscreen() { document.fullscreenElement = null; document.dispatch("fullscreenchange", {}); return Promise.resolve(); }, + exitFullscreen() { fullscreenStack.pop(); document.fullscreenElement = fullscreenStack.at(-1) ?? null; document.dispatch("fullscreenchange", {}); return Promise.resolve(); }, }); const window = Object.assign(new Target(), { devicePixelRatio: 1, scrollX: 0, scrollY: 0, localStorage: new Map(), parent: null, @@ -132,5 +133,7 @@ assert.equal(document.documentElement.fullscreen, 0); toggles[1](); assert.equal(document.fullscreenElement, parentB, "the other copy takes full screen for itself"); toggles[1](); -assert.equal(document.fullscreenElement, null, "and a second toggle leaves it"); +assert.equal(document.fullscreenElement, parentA, "leaving the second embed reveals the first"); +toggles[0](); +assert.equal(document.fullscreenElement, null, "leaving the first embed exits full screen"); console.log("embed.test: ok");