Repository navigation
Report SplitLayoutPanel splitter position with aria-valuenow - #19
Merged
Merged
Conversation
Keyboard-enabled splitters are focusable separators, which ARIA requires to have aria-valuenow. Each splitter now reports its position as a percentage of the distance it can travel, updated after every layout of the panel. Addresses rstudio/rstudio#19151
Children larger than the panel can place a splitter outside it, which reported positions such as 120 or -20, outside the range aria-valuemin and aria-valuemax allow. Addresses rstudio/rstudio#19151
gtritchie
added a commit
to rstudio/rstudio
that referenced
this pull request
Oct 16, 2026
* Report row splitter position with aria-valuenow The row splitter is a focusable separator, which ARIA requires to report its position. Set aria-valuenow to the splitter's position as a percentage from the top of the panel, updated after every layout. Addresses #19151 * Test pane splitter aria-valuenow The column splitter cases need the GWT build with the SplitLayoutPanel fix, so they fail until install-gwt moves to it. Addresses #19151 * Add NEWS entry for pane splitter aria-valuenow Addresses #19151 * Clamp row splitter aria-valuenow to 0-100 In a panel shorter than two splitters, setSplitterPos() puts the splitter outside its range, so a 12px panel with a 7px splitter reported 140 or -40. Addresses #19151 * Check splitter aria-valuenow after the zoom settles The zoom assertions could pass partway through the layout animation. Wait for the zoomed splitter to reach the edge, and end the zoom with the bridge's layout reset, which resolves after the relayout. Addresses #19151 * Wait for the zoomed splitter to be drawn at the edge aria-valuenow rounds to 100 once the splitter passes 99.5% of its range, so waiting on it could still sample mid-animation. Wait for the rendered position instead, then check the value. Addresses #19151 * Wait for the zoomed splitter to stop, not to reach the edge With the sidebar on the right, its splitter stays beside the middle one, so a left-column zoom stops the middle splitter at 99.4% and the wait for 100% timed out. Wait for the zoom to move the splitter and then for it to hold still across several frames. Addresses #19151 * Use GWT build 2.13.1-montauk-daisy-1 The new build adds aria-valuenow to keyboard-enabled SplitLayoutPanel splitters (rstudio/gwt#19), which the column splitter tests need. Addresses #19151
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.
Keyboard-enabled
SplitLayoutPanelsplitters haverole="separator"andtabindex="-1". A focusable separator must havearia-valuenow, and they didn't set it, so axe reportsaria-required-attr(critical) on RStudio's column splitters and screen readers can't report a splitter's position. Addresses rstudio/rstudio#19151.Changes
Splitternow implementsRequiresResize, and when keyboard support is on,onResize()setsaria-valuenowto the splitter's position: a whole-number percentage of the distance it can travel, from 0 at the panel's left or top edge to 100 at its right or bottom edge. That matches the defaultaria-valuemin/aria-valuemax, so neither is set.onResize()runs after every layout of the panel:forceLayout()(including the deferred layout that dragging and keyboard resizing schedule), the per-layer callback ofanimate()(setWidgetSize,setWidgetHidden), and parent resizes. So the value also follows sizes set programmatically, e.g. RStudio'sMainSplitPanelrestoring state or zooming a column.Testing
Eight new tests in
SplitLayoutPanelTest: initial values for north, west, and east splitters; updates after a keyboard resize and aftersetWidgetSize(); clamping past either edge; no value without keyboard support; no value before layout.SplitLayoutPanelTestandDockLayoutPanelTestpass in HtmlUnit. The two right-anchored cases are@DoNotRunWith(Platform.HtmlUnitLayout), like the existingtestResize, because HtmlUnit ignores a right-anchored layer's width when computing itsoffsetLeft.SplitLayoutPanelTesttests, including those two, pass in Chromium (-runStyle Manual:1).compile.tests,checkstyle, andapicheckpass, andant clean dist-devbuilds.aria-valuenowmatches the drawn splitter position on load, after keyboard resizing, and through a column zoom, and the axe scan no longer reportsaria-required-attron the splitters.LayoutPanelTest.testRedundantForceLayouttimes out in HtmlUnit on this branch with or without this change.