From e526f3272c561b6ea00f792a36ef954fedacc5cb Mon Sep 17 00:00:00 2001 From: "Mark E. DeYoung" <1854350+mark-e-deyoung@users.noreply.github.com> Date: Mon, 30 Nov 2026 10:02:53 +0100 Subject: [PATCH 1/4] Qualify keyboard-only focus and presentation controls on live candidate dashboard --- .../qualification/candidate_browser_probe.py | 41 +++++++++++++++++++ 1 file changed, 41 insertions(+) diff --git a/tests/qualification/candidate_browser_probe.py b/tests/qualification/candidate_browser_probe.py index d2a38de7..185a39cd 100644 --- a/tests/qualification/candidate_browser_probe.py +++ b/tests/qualification/candidate_browser_probe.py @@ -150,6 +150,46 @@ def receive_frame(_payload): # A few caret/cursor/clock pixels may change between native and RFB capture. assert match >= 0.98 + PHASE = "keyboard_dashboard" + # Exercise the live dashboard with keyboard input only after view-only + # admission. Do not synthesize focus or dispatch events into Wine. + def tab_to(target, key="Tab"): + for _ in range(80): + page.keyboard.press(key) + if target.evaluate("element => element === document.activeElement"): + assert target.evaluate("element => element.matches(':focus-visible')") + return + raise AssertionError("keyboard_focus_unreachable") + + keyboard_settings = page.get_by_role("button", name="Toggle VNC Settings", exact=True) + presentation = page.locator("#viewer-presentation") + expect(presentation).to_be_hidden() + tab_to(keyboard_settings) + page.keyboard.press("Enter") + expect(presentation).to_be_visible() + tab_to(presentation) + # Native select keyboard interaction; derive order from the actual DOM. + def choose_presentation(value): + values = presentation.locator("option").evaluate_all( + "options => options.map(option => option.value)" + ) + assert value in values + page.keyboard.press("Home") + for _ in range(values.index(value)): + page.keyboard.press("ArrowDown") + expect(presentation).to_have_value(value) + + choose_presentation("cv") + expect(page.locator("#vnc-scale")).to_be_disabled() + choose_presentation("human") + tab_to(keyboard_settings, "Shift+Tab") + page.keyboard.press("Space") + expect(presentation).to_be_hidden() + expect(keyboard_settings).to_be_focused() + expect(page.locator("#toolbar-viewonly")).to_have_attribute("aria-pressed", "true") + expect(page.locator("#badge-vnc")).to_have_text("connected") + print(f"WINE11_CANDIDATE_KEYBOARD mode={mode} result=pass", flush=True) + PHASE = "cv_geometry" settings = page.get_by_role("button", name="Toggle VNC Settings", exact=True) settings.click() @@ -213,6 +253,7 @@ def receive_frame(_payload): "bytes": len(screenshot), "sha256": hashlib.sha256(screenshot).hexdigest(), }, + "dashboard_keyboard_focus_qualified": True, "assistive_technology_qualified": False, "wininspect_event_delivery_qualified": False, } From 6fe9536cef078253dd1e36dd89aaf772cc8946b3 Mon Sep 17 00:00:00 2001 From: "Mark E. DeYoung" <1854350+mark-e-deyoung@users.noreply.github.com> Date: Mon, 30 Nov 2026 16:37:45 +0100 Subject: [PATCH 2/4] Require and safely project exact live keyboard qualification marker --- scripts/ci/qualify-candidate-images.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/scripts/ci/qualify-candidate-images.sh b/scripts/ci/qualify-candidate-images.sh index 020890b8..922d6d8d 100755 --- a/scripts/ci/qualify-candidate-images.sh +++ b/scripts/ci/qualify-candidate-images.sh @@ -183,6 +183,9 @@ for mode in runtime instrumented; do fail "${mode}_browser" fi grep -Eq "^WINE11_CANDIDATE_BROWSER mode=$mode result=pass$" "$work/browser.log" || fail browser_result_missing + # Project only the fixed, mode-bound keyboard success marker; never emit the raw browser log. + [[ "$(grep -Ec "^WINE11_CANDIDATE_KEYBOARD mode=$mode result=pass$" "$work/browser.log")" == 1 ]] || fail keyboard_result_missing + printf 'WINE11_CANDIDATE_KEYBOARD mode=%s result=pass\n' "$mode" printf 'WINE11_CANDIDATE_BROWSER mode=%s result=pass\n' "$mode" emit_screenshot "artifacts/candidate-images/$mode-dashboard.png" "$mode-dashboard.png" # Exercise abrupt disposable runtime loss with the exact same persistent From e11ae97cb99d4afe9316decd76ac8015534ec69a Mon Sep 17 00:00:00 2001 From: "Mark E. DeYoung" <1854350+mark-e-deyoung@users.noreply.github.com> Date: Mon, 30 Nov 2026 22:20:03 +0100 Subject: [PATCH 3/4] Qualify rendered keyboard focus cues and presentation accessible name --- .../qualification/candidate_browser_probe.py | 35 +++++++++++++++++++ 1 file changed, 35 insertions(+) diff --git a/tests/qualification/candidate_browser_probe.py b/tests/qualification/candidate_browser_probe.py index 185a39cd..fc0d59a5 100644 --- a/tests/qualification/candidate_browser_probe.py +++ b/tests/qualification/candidate_browser_probe.py @@ -153,11 +153,43 @@ def receive_frame(_payload): PHASE = "keyboard_dashboard" # Exercise the live dashboard with keyboard input only after view-only # admission. Do not synthesize focus or dispatch events into Wine. + def focus_style(target): + return target.evaluate("""element => { + const style = getComputedStyle(element); + return { + outline: style.outline, + outlineStyle: style.outlineStyle, + outlineWidth: parseFloat(style.outlineWidth), + outlineColor: style.outlineColor, + boxShadow: style.boxShadow, + border: style.border, + background: style.backgroundColor, + }; + }""") + def tab_to(target, key="Tab"): + # The pseudo-class alone does not establish a rendered focus cue. + # Compare the computed unfocused and keyboard-focused styling. + expect(target).to_be_visible() + assert not target.evaluate("element => element === document.activeElement") + before = focus_style(target) for _ in range(80): page.keyboard.press(key) if target.evaluate("element => element === document.activeElement"): assert target.evaluate("element => element.matches(':focus-visible')") + after = focus_style(target) + outline = ( + after["outlineStyle"] not in {"none", "hidden"} + and after["outlineWidth"] > 0 + and after["outlineColor"] not in {"transparent", "rgba(0, 0, 0, 0)"} + and after["outline"] != before["outline"] + ) + shadow = after["boxShadow"] != "none" and after["boxShadow"] != before["boxShadow"] + changed_surface = ( + after["border"] != before["border"] + or after["background"] != before["background"] + ) + assert outline or shadow or changed_surface, "keyboard_focus_style_unchanged" return raise AssertionError("keyboard_focus_unreachable") @@ -182,6 +214,9 @@ def choose_presentation(value): choose_presentation("cv") expect(page.locator("#vnc-scale")).to_be_disabled() choose_presentation("human") + # Verify the native presentation control has a nonempty accessible + # name, in addition to the already role-named settings button. + expect(presentation).to_have_accessible_name(re.compile(r"\S")) tab_to(keyboard_settings, "Shift+Tab") page.keyboard.press("Space") expect(presentation).to_be_hidden() From 512c0bb4c7d93ed305f0c9cf630c2d7293b6c195 Mon Sep 17 00:00:00 2001 From: "Mark E. DeYoung" <1854350+mark-e-deyoung@users.noreply.github.com> Date: Tue, 1 Dec 2026 04:13:56 +0100 Subject: [PATCH 4/4] test(a11y): check focused live controls for viewport clipping and occlusion --- tests/qualification/candidate_browser_probe.py | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/tests/qualification/candidate_browser_probe.py b/tests/qualification/candidate_browser_probe.py index fc0d59a5..9dfd30b3 100644 --- a/tests/qualification/candidate_browser_probe.py +++ b/tests/qualification/candidate_browser_probe.py @@ -190,6 +190,24 @@ def tab_to(target, key="Tab"): or after["background"] != before["background"] ) assert outline or shadow or changed_surface, "keyboard_focus_style_unchanged" + # Visibility and focus-visible do not exclude an overlay or + # clipped scroll container. Probe the actual rendered + # control at five interior points without sending clicks. + assert target.evaluate("""element => { + const r = element.getBoundingClientRect(); + if (r.width <= 0 || r.height <= 0 || + r.left < 0 || r.top < 0 || + r.right > document.documentElement.clientWidth || + r.bottom > document.documentElement.clientHeight) { + return false; + } + return [[.5, .5], [.25, .25], [.75, .25], + [.25, .75], [.75, .75]].every(([x, y]) => { + const hit = document.elementFromPoint( + r.left + r.width * x, r.top + r.height * y); + return hit === element || (hit && element.contains(hit)); + }); + }"""), "keyboard_focus_control_occluded" return raise AssertionError("keyboard_focus_unreachable")