Skip to content

Report SplitLayoutPanel splitter position with aria-valuenow - #19

Merged
gtritchie merged 2 commits into
rstudio/montauk-daisyfrom
bugfix/splitter-aria-valuenow
Oct 16, 2026
Merged

gtritchie merged 2 commits into
rstudio/montauk-daisyfrom
bugfix/splitter-aria-valuenow

Conversation

@gtritchie

Copy link
Copy Markdown
Member

Keyboard-enabled SplitLayoutPanel splitters have role="separator" and tabindex="-1". A focusable separator must have aria-valuenow, and they didn't set it, so axe reports aria-required-attr (critical) on RStudio's column splitters and screen readers can't report a splitter's position. Addresses rstudio/rstudio#19151.

Changes

  • Splitter now implements RequiresResize, and when keyboard support is on, onResize() sets aria-valuenow to 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 default aria-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 of animate() (setWidgetSize, setWidgetHidden), and parent resizes. So the value also follows sizes set programmatically, e.g. RStudio's MainSplitPanel restoring state or zooming a column.
  • The position is measured from the DOM (the splitter's layer offset within the panel's client area), so it is correct for both normal and reversed (east/south) splitters.
  • The value is clamped to 0-100, since children larger than the panel can place a splitter outside it.
  • When the panel has no size (detached or hidden), the attribute is left unset.

Testing

Eight new tests in SplitLayoutPanelTest: initial values for north, west, and east splitters; updates after a keyboard resize and after setWidgetSize(); clamping past either edge; no value without keyboard support; no value before layout.

  • SplitLayoutPanelTest and DockLayoutPanelTest pass in HtmlUnit. The two right-anchored cases are @DoNotRunWith(Platform.HtmlUnitLayout), like the existing testResize, because HtmlUnit ignores a right-anchored layer's width when computing its offsetLeft.
  • All 32 SplitLayoutPanelTest tests, including those two, pass in Chromium (-runStyle Manual:1).
  • compile.tests, checkstyle, and apicheck pass, and ant clean dist-dev builds.
  • With RStudio built against this SDK, its new e2e tests confirm aria-valuenow matches the drawn splitter position on load, after keyboard resizing, and through a column zoom, and the axe scan no longer reports aria-required-attr on the splitters.

LayoutPanelTest.testRedundantForceLayout times out in HtmlUnit on this branch with or without this change.

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
gtritchie merged commit 8ad450e into rstudio/montauk-daisy Oct 16, 2026
1 check passed
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
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.

1 participant