Repository navigation
Description
Current behavior 🐛
On WebAssembly (Skia) with accessibility enabled, a programmatic ScrollViewer scroll (ChangeView, BringIntoView, InputPane occlusion scroll, manipulation) is dragged back to a smaller offset shortly after it is applied.
UpdateNativeScrollOffsets mirrors the XAML offset into scrollTop/scrollLeft of the ScrollContentPresenter's semantic <div overflow:scroll>. That element's DOM scroll range comes from its semantic children, not from the XAML extent, so the browser clamps or rounds the value and raises a scroll event. The listener in Accessibility.ts forwards every scroll event to WebAssemblyAccessibility.OnScroll, which applies the clamped DOM value back to the ScrollContentPresenter, and the ScrollViewer ends up at the wrong offset.
This is also the cause of the most frequent WebAssembly runtime-test flakes on master. Once any Given_Accessible* test enables accessibility, it stays on for the rest of the shard, and later scroll tests fail. The tests fail in the full shard and pass in isolation on the CI retry:
Given_InputPane.When_OccludedRect_Set_Then_Focused_TextBox_Scrolled_Into_View: 16 of the last 30 master buildsGiven_FrameworkElement_EffectiveViewport.EVP_When_NestedSV: 12/30Given_InputManager.When_DirectManipulationMixedWithUIElementManipulation_Then_TopMostWinsAndChainingWorks: 10/30
Expected behavior 🎯
The ScrollViewer keeps the offset it was asked to scroll to. Only user- or assistive-technology-initiated DOM scrolls are forwarded to the ScrollViewer.
How to reproduce it (as minimally and precisely as possible) 🔬
- On Skia WebAssembly, enable accessibility (e.g.
WasmSemanticDomHelper.EnableAccessibilityThroughDom()in runtime tests). - Put a list of focusable/semantic elements in a ScrollViewer whose extent is much larger than the semantic children's DOM extent.
sv.ChangeView(null, 900, null, disableAnimation: true)and wait for idle.sv.VerticalOffsetreads back ~507 instead of 900.
Runtime-test repro: run Given_AccessibleScrollViewer.When_ScrollViewer_Not_Scrollable_Then_No_Region followed by EVP_When_NestedSV; the latter fails 3/3 locally. It passes when run alone.
Workaround 🛠️
None for apps with accessibility enabled.
Renderer 🎨
- Skia
- Native
Affected platforms 📱💻🖥️
WebAssembly
Uno.Sdk version (and other relevant versions) 📦
master (7.0), net11.0-browserwasm
IDE version 🧑💻
No response
Anything else we need to know? 💬
Filtering the echoes fixes the revert. There is also a deeper geometry mismatch, which should be a follow-up: semantic children are positioned with TotalMatrix, which already includes the scroll offset, so scrolled content is shifted twice, and the DOM scroll range doesn't match the XAML extent. As a result, an AT-initiated DOM scroll still maps to an imprecise XAML offset.
Activity