Repository navigation
Fix macOS WebKit failures in Playwright keyboard tests - #15127
Merged
Merged
Conversation
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.
Collaborator
✅ Snyk checks have passed. No issues have been found so far.
💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse. |
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.
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:
Checklist
I have (if applicable):
AI-assisted PR
Note: autonomous AI agents submitting PRs without human oversight are not permitted — see the Code of Conduct.