Skip to content

Fix macOS WebKit failures in Playwright keyboard tests - #15127

Merged
cderv merged 2 commits into
mainfrom
fix/webkit-focus-tests-macos-nightly
Oct 20, 2026
Merged

cderv merged 2 commits into
mainfrom
fix/webkit-focus-tests-macos-nightly

Conversation

@cderv

@cderv cderv commented Oct 20, 2026

Copy link
Copy Markdown
Member

The Playwright macOS job of the nightly "Smoke Tests (Built Version)" has been failing on WebKit since early October. Pull request CI checks Playwright assertions on Linux only, so these tests never ran on macOS before they merged. None of the failures is a Quarto regression. They come from how WebKit on macOS handles keyboard input.

Tab skips buttons on macOS WebKit

WebKit on macOS follows Safari's default for "Press Tab to highlight each item on a webpage", which is off: Tab moves only between form fields and elements with an explicit tabindex, and skips buttons and links. Option+Tab visits every focusable element. Linux WebKit, Chromium and Firefox all Tab to buttons.

The tabset keyboard test (#15007) and the off-screen slide tests (#15010) press Tab to reach plain <button> elements, so they failed on macOS from the first nightly after each one merged. The test added with #15089 has the same pattern and would fail there too once the macOS job runs again.

These tests now press tabKey(browserName), the helper from #15094 that sends Alt+Tab on WebKit. It also gives the second Tab in the off-screen slide tests a real meaning on macOS: with a plain Tab, buttons on other slides were skipped whether or not they were inert.

ArrowDown on a focused scroll region is unreliable on macOS WebKit

The axe report overlay test "focused overlay scrolls on ArrowDown" (#14713) has failed, or passed only on retry, on every macOS run since that job started. On macOS, WebKit ignores about half of ArrowDown presses on a focused scrollable element. The keydown reaches the element and is not prevented, but nothing scrolls. A plain HTML page with a fixed, focusable overflow box and no Quarto code behaves the same way, so the overlay is not the cause. PageDown scrolled every time on both pages.

The ArrowDown variant is now skipped for WebKit on macOS only. PageDown still covers the overlay keyboard scrolling there, and Linux WebKit, Chromium and Firefox keep the ArrowDown check. The scrollable code block test from #14816 already skips its arrow-key scroll assertion on WebKit for a similar reason.

Test plan

Pull request CI does not run Playwright on macOS, so these were checked with a one-off macOS run on my fork:

  • Specs before this change, WebKit on macOS: the 8 Tab tests fail
  • Specs after this change, WebKit on macOS: the same tests pass, 3 repeats each
  • ArrowDown and PageDown on the axe overlay and on a plain HTML control page, WebKit on macOS, 5 repeats each
  • Changed specs on Chromium and Firefox locally (Windows)
  • Next macOS nightly is green on these tests

Checklist

I have (if applicable):

  • referenced the GitHub issue this PR closes
  • updated the appropriate changelog in the PR
  • ensured the present test suite passes
  • added new tests
  • created a separate documentation PR in Quarto's website repo and linked it to this PR
AI-assisted PR
  • AI tool used: Claude Code
  • Codebase grounding: local clone, DeepWiki MCP, nightly CI logs, a macOS CI run on a fork
  • Human review: I have reviewed, tested, and verified the AI-generated content before submitting.

Note: autonomous AI agents submitting PRs without human oversight are not permitted — see the Code of Conduct.

cderv added 2 commits October 20, 2026 12:22
WebKit on macOS follows Safari's default "Press Tab to highlight each
item" setting, so a plain Tab skips buttons and links. The tabset (#730)
and off-screen slide (#14795) tests tab to plain buttons, so they failed
in the macOS Playwright job of the built-version nightly from the first
run after each landed. Linux WebKit, Chromium and Firefox Tab to
buttons, which is why pull request CI stayed green.

Press tabKey(browserName), which sends Alt+Tab on WebKit. The second
Tab in the off-screen slide tests now also means something on macOS:
with plain Tab, buttons on other slides were skipped regardless of
inert. The #15078 test gets the same change; it has not run on macOS
yet.
The axe report overlay ArrowDown test has failed or needed a retry on
every macOS Playwright run since that job started. On macOS, WebKit
ignores about half of the ArrowDown presses on a focused scroll region:
the keydown reaches the element and is not prevented, but nothing
scrolls. A plain HTML page with a fixed, focusable overflow box and no
Quarto code shows the same rate, so the overlay is not the cause.
PageDown scrolled every time on both pages.

Skip only the ArrowDown variant, only for WebKit on macOS. PageDown
still guards the overlay's keyboard scrolling there, and Linux WebKit,
Chromium and Firefox keep the ArrowDown check. The scrollable code
block test already skips its arrow-key assertion on WebKit for a
similar reason.
@posit-snyk-bot

posit-snyk-bot commented Oct 20, 2026 •

Copy link
Copy Markdown
Collaborator

✅ Snyk checks have passed. No issues have been found so far.

Status Scan Engine Critical High Medium Low Total (0)
✅ Open Source Security 0 0 0 0 0 issues
✅ Licenses 0 0 0 0 0 issues

💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse.

@cderv
cderv merged commit d6d4c07 into main Oct 20, 2026
51 checks passed
@cderv
cderv deleted the fix/webkit-focus-tests-macos-nightly branch October 20, 2026 13:03
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.

2 participants