Skip to content

fix(wasm): Chain BrowserHtmlElement scrolling to the enclosing ScrollViewer - #24138

Merged
ajpinedam merged 18 commits into
unoplatform:masterfrom
ajpinedam:dev/anpi/fix.wasm.native.html.scroll.chaining
Aug 26, 2026
Merged

ajpinedam merged 18 commits into
unoplatform:masterfrom
ajpinedam:dev/anpi/fix.wasm.native.html.scroll.chaining

Conversation

@ajpinedam

Copy link
Copy Markdown
Contributor

GitHub Issue: related to #24134

PR Type:

🐞 Bugfix

What changed? 🚀

Current behavior. On Skia WebAssembly, a touch gesture that begins inside a BrowserHtmlElement does not participate in the enclosing Uno ScrollViewer. A scrollable native child consumes the whole gesture and dead-stops at its own boundary, and a drag that starts over non-scrollable native HTML does not scroll the enclosing ScrollViewer at all. This is most visible on tablets, where an embedded editor or grid can occupy most of the viewport and effectively traps the page.

There are two independent causes:

  1. The Uno ScrollViewer is painted onto the canvas and is not a DOM scroll container, so overscroll-behavior and the browser's own scroll chaining have nothing to chain into.
  2. BrowserPointerInputSource.onPointerEventReceived early-returns for any event targeting #uno-native-element-host, so Uno never observes the gesture.

This PR adds an opt-in BrowserHtmlElement.InputPolicy:

var element = BrowserHtmlElement.CreateHtmlElement("div");
element.InputPolicy = BrowserHtmlElementInputPolicy.Negotiated; // default is NativeOnly

With Negotiated, a scrollable native child scrolls first and transfers only what it could not consume at its boundary to the enclosing ScrollViewer, chaining outwards; a gesture over non-scrollable native content goes to the ScrollViewer directly. Taps, focus, text selection and native control interaction stay native. The default (NativeOnly) preserves today's behavior exactly.

Managed side

ScrollViewer.ChainScrollFromDescendant walks the ScrollViewer ancestry and hands each one the residual the previous could not take. Two details matter:

  • Deltas are applied through the user-input path (ClearOffsetIntents() + the presenter's Set), not ScrollViewer.ChangeView. ChangeView arms the ScrollViewer's offset intent, which the post-layout recompute re-applies — so overshooting at a boundary (as every fling does) parked an intent past the end of the content, and the next extent growth snapped the view to it. This is covered by a regression test that fails against the ChangeView implementation.
  • In-flight deltas are reported as IsTouch: true, IsIntermediate: true, with a single non-intermediate change when the gesture ends. Reporting every frame as terminal fired ViewChanged(IsIntermediate: false) at 60–120 Hz and restarted the snap-points timer mid-fling.

Chaining honors IsHorizontalScrollChainingEnabled / IsVerticalScrollChainingEnabled, per-axis, matching IDirectManipulationHandler.OnUpdated.

Browser side

Gesture detection, native-first scrolling and the residual bridge live in BrowserPointerInputSource.ts. Notable hardening over a naive implementation:

  • The input policy and the negotiation root are resolved from a JS-side map keyed by element reference, and by position in the tree (direct child of #uno-native-element-host) — never by reading a data- attribute off the event target. Hosted HTML is app- or third-party-supplied and must not be able to opt itself into a policy the app did not set. The managed host registry is keyed on the GCHandle, not the caller-settable ElementId string.
  • OnNativeScrollDelta is wrapped in try/catch with an IsEnabled-guarded error log and applies NativeDispatcher.Main.SynchronizationContext, matching the neighbouring OnNativeEvent. Non-finite deltas are rejected before reaching ValidateInputOffset, which throws on NaN.
  • Form controls (input, textarea, select) and contenteditable regions — and their descendants — keep full native touch behavior and never participate in chaining. The CSS and TypeScript exclusion lists are deliberately kept in sync; a mismatch produces a subtree that neither the browser nor Uno will pan.
  • touch-action: pinch-zoom rather than none, so multi-finger zoom survives. A second pointer abandons negotiation and hands the interaction back to the browser.
  • ctrl+wheel is left to the normal pipeline so browser zoom keeps working when isBrowserZoomEnabled.
  • Inertia is cancelled when the element is detached or leaves the document, and a wheel burst supersedes a running fling.

Iframes remain native-only: pointer events do not cross the frame boundary, so an embedded document's scroll residual cannot be observed.

The first commit is cherry-picked from an external contributor's branch with authorship preserved; the remainder is rework following an internal review.

Validation

Runtime tests (Skia Desktop) — 13 tests in Given_ScrollViewer_ScrollChaining, all passing, covering forward/backward chaining, boundary residual, chaining-disabled absorption, horizontal, non-finite deltas, and the intermediate/terminal ViewChanged sequence. The offset-intent regression guard was verified to fail against the pre-fix implementation and pass after.

Regression — 241/243 passing across Given_ScrollViewer, Given_ScrollViewer_Anchoring, Given_ScrollViewer_Zoom, Given_ListView* and Given_FlipView (16 skipped). The one failure, Given_ListViewBase.When_ThemeChange, was verified to fail identically on clean master on the same machine and is unrelated.

Manual, iPadOS Safari — the core scenarios pass on device: drag over non-scrollable native content scrolls the page, the native scroller hands over residual at its boundary without stalling, reverse chaining works, and flick inertia carries across the handoff.

⚠️ Not yet validated on device: the native-interaction cases (text input focus and drag-selection, pinch-zoom, multi-touch handoff, button tap delivery). These exercise the exclusion lists and the touch-action change. Marked as draft until they are covered.

PR Checklist ✅

@github-actions github-actions Bot added platform/wasm 🌐 Categorizes an issue or PR as relevant to the WebAssembly platform area/skia ✏️ Categorizes an issue or PR as relevant to Skia area/automation Categorizes an issue or PR as relevant to project automation kind/documentation labels Aug 19, 2026
@nventive-devops

Copy link
Copy Markdown
Contributor

The build 228776 found UI Test snapshots differences: skia-linux-screenshots: 57, skia-windows-screenshots: 289, wasm: 11

Details
  • skia-linux-screenshots: 57 changed over 2348

    🚨🚨 Comparison Details (first 20) 🚨🚨
    • ButtonClippingTestsControl.png-dark
    • ButtonClippingTestsControl.png
    • Buttons.png-dark
    • DisplayInformation.png-dark
    • Focus_FocusVisual_Properties.png-dark
    • Examples.png-dark
    • Examples.png
    • DropDownButtonPage.png-dark
    • DropDownButtonPage.png
    • Buttons.png
    • ElementLevelTheme.png-dark
    • ElementLevelTheme.png
    • ImageIconPage.png-dark
    • CalendarView_Theming.png-dark
    • CalendarView_Theming.png
    • ContextRequested.png-dark
    • ContextRequested.png
    • ClipboardTests.png-dark
    • ExpanderColorValidationPage.png-dark
    • ExpanderColorValidationPage.png
  • skia-windows-screenshots: 289 changed over 2348

    🚨🚨 Comparison Details (first 20) 🚨🚨
    • AuthenticationBroker_Demo.png-dark
    • AutomationPropertiesExtensions_Role.png-dark
    • DataTemplate_Update_Sample.png-dark
    • DataTemplate_Update_Sample.png
    • Gamepad_CurrentReading.png-dark
    • Gamepad_CurrentReading.png
    • Gamepad_Enumeration.png-dark
    • Gamepad_Enumeration.png
    • AutomationProperties_AutomationId.png
    • Examples.png
    • Accessibility_ScreenReader.png
    • AutomationProperties_Name.png
    • Battery.png-dark
    • CompositionPath.png-dark
    • CompositionPath.png
    • Elevation.png-dark
    • Elevation.png
    • ElevationView_Clipping.png-dark
    • ElevationView_Clipping.png
    • AutomationProperties_AutomationId.png-dark
  • wasm: 11 changed over 1076

    🚨🚨 Comparison Details (first 20) 🚨🚨
    • UITests.Shared.Windows_UI_Xaml_Controls.MediaPlayerElement.MediaPlayerElement_Minimal
    • UITests.Shared.Microsoft_UI_Xaml_Controls.ExpanderTests.WinUIExpanderPage
    • UITests.Uno_Web.Http.CookieManagerTests
    • UITests.Shared.Windows_UI_Xaml_Controls.MediaPlayerElement.MediaPlayerElement_Ogg_Extension
    • UITests.Windows_UI_Xaml_Media_Animation.ColorAnimation_Background
    • Uno.UI.Samples.Content.UITests.WebView.WebView_AnchorNavigation
    • UITests.Microsoft_UI_Xaml_Controls.WebView2Tests.WebView2_NavigationProperties
    • SamplesApp.Wasm.Windows_UI_Xaml_Controls.ListView.ListView_IsSelected
    • SamplesApp.Microsoft_UI_Xaml_Controls.WebView2Tests.WebView2_EnableDevTools
    • SamplesApp.Windows_UI_Xaml_Controls.ListView.ListViewSelectedItems
    • UITests.Windows_UI_Xaml_Controls.CalendarView.CalendarView_Theming

@ajpinedam
ajpinedam force-pushed the dev/anpi/fix.wasm.native.html.scroll.chaining branch from f9bc43e to 03733fa Compare August 21, 2026 01:58
@ajpinedam
ajpinedam marked this pull request as ready for review August 21, 2026 01:58
Copilot AI lite review requested due to automatic review settings August 21, 2026 01:58

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds opt-in negotiated scrolling for BrowserHtmlElement on Skia WebAssembly, chaining native scroll residuals through managed ScrollViewers.

Changes:

  • Adds managed scroll chaining and runtime coverage.
  • Implements browser gesture negotiation, residual handoff, and inertia.
  • Adds policy APIs, CSS behavior, documentation, and a manual sample.

Reviewed changes

Copilot reviewed 15 out of 15 changed files in this pull request and generated 2 comments.

Show a summary per file
File Summary / review note
src/Uno.UI/UI/Xaml/Controls/ScrollViewer/ScrollViewer.ScrollChaining.cs Managed ancestry-based residual scroll chaining.
src/Uno.UI/UI/Xaml/Controls/ScrollContentPresenter/ScrollContentPresenter.Managed.cs Touch-aware presenter scrolling and inertia configuration.
src/Uno.UI/NativeElementHosting/BrowserHtmlElement.wasm.cs WebAssembly input-policy behavior.
src/Uno.UI/NativeElementHosting/BrowserHtmlElement.skia.cs Skia input-policy bridge.
src/Uno.UI/NativeElementHosting/BrowserHtmlElement.reference.cs Reference platform implementation.
src/Uno.UI/NativeElementHosting/BrowserHtmlElement.cs Public InputPolicy API.
src/Uno.UI.RuntimeTests/Tests/Windows_UI_Xaml_Controls/ScrollViewerTests/Given_ScrollViewer_ScrollChaining.cs Scroll-chaining regression coverage.
src/Uno.UI.Runtime.Skia.WebAssembly.Browser/WasmCSS/uno.css Negotiated touch behavior. Moderate finding (2 votes): excluded native subtrees can inherit the negotiated root’s touch-action: pinch-zoom, potentially blocking native selection or scrolling.
src/Uno.UI.Runtime.Skia.WebAssembly.Browser/ts/Runtime/BrowserPointerInputSource.ts Browser gesture negotiation, residual handoff, and inertia. Moderate finding (2 votes): custom native fling starts regardless of the ancestor ScrollViewer’s inertia setting.
src/Uno.UI.Runtime.Skia.WebAssembly.Browser/ts/Runtime/BrowserNativeElementHostingExtension.ts Policy registration and host lifecycle handling.
src/Uno.UI.Runtime.Skia.WebAssembly.Browser/Native/BrowserNativeElementHostingExtension.cs Managed host registry and bridge.
src/Uno.UI.Runtime.Skia.WebAssembly.Browser/Devices/Input/BrowserPointerInputSource.cs JavaScript-to-managed scroll bridge.
src/SamplesApp/SamplesApp.Samples/Windows_UI_Xaml_Controls/BrowserHtmlElementTests/BrowserHtmlElement_NativeScrollNegotiation.xaml.cs Manual sample behavior.
src/SamplesApp/SamplesApp.Samples/Windows_UI_Xaml_Controls/BrowserHtmlElementTests/BrowserHtmlElement_NativeScrollNegotiation.xaml Manual sample UI.
doc/articles/features/using-skia-hosting-native-controls.md Feature documentation.
Suppressed comments (12)

src/Uno.UI.Runtime.Skia.WebAssembly.Browser/WasmCSS/uno.css:112

  • touch-action is intersected with the values of its ancestors, and html, body above still set touch-action: none. This descendant declaration cannot re-enable pinch-zoom for negotiated content (especially when there is no inner DOM scroll container), so the documented pinch-zoom behavior is not actually available. The ancestor touch-action policy needs to permit this gesture or the implementation needs a different arbitration mechanism.
#uno-native-element-host > [data-uno-native-input-policy="1"],
#uno-native-element-host > [data-uno-native-input-policy="1"] *:not(:is(input, textarea, select, [contenteditable])):not(:is(input, textarea, select, [contenteditable]) *) {
	touch-action: pinch-zoom !important;
	overscroll-behavior: none !important;

src/Uno.UI.Runtime.Skia.WebAssembly.Browser/ts/Runtime/BrowserNativeElementHostingExtension.ts:195

  • The JS policy lookup is map-backed, but the CSS gate still trusts the caller-settable data-uno-native-input-policy attribute written here. A root can receive value 1 through the public SetHtmlAttribute API (or hosted script) without a WeakMap registration; CSS then disables native panning while getInputPolicy returns null, so neither Uno chaining nor browser panning handles the gesture. The CSS marker must not be independently spoofable, or the managed registration and CSS state must be enforced together.
		public static setInputPolicy(elementId: string, unoElementId: number, value: number) {
			const element = this.getElementOrThrow(elementId);
			BrowserHtmlElement.inputPolicies.set(element, { policy: value, unoElementId: unoElementId });
			element.dataset.unoNativeInputPolicy = value.toString();
		}

src/Uno.UI.Runtime.Skia.WebAssembly.Browser/ts/Runtime/BrowserNativeElementHostingExtension.ts:194

  • Changing the policy only updates the registry and CSS attribute; it does not cancel _nativeScrollGesture or _nativeScrollInertiaGesture. If InputPolicy is changed from Negotiated to NativeOnly while a drag/fling is active, subsequent events take the native-only early return, leaving the old state alive (and allowing the fling to continue); the next pointer-down can then be misclassified as a second pointer. Cancel the active negotiated state when disabling the policy.
		public static setInputPolicy(elementId: string, unoElementId: number, value: number) {
			const element = this.getElementOrThrow(elementId);
			BrowserHtmlElement.inputPolicies.set(element, { policy: value, unoElementId: unoElementId });
			element.dataset.unoNativeInputPolicy = value.toString();

src/Uno.UI.Runtime.Skia.WebAssembly.Browser/ts/Runtime/BrowserPointerInputSource.ts:431

  • Wheel events use the default isIntermediate: true here, but this branch never calls completeNativeScroll afterward. When a wheel over native content is handed to a ScrollViewer, every ViewChanged remains intermediate and the snap-points timer is stopped, so consumers never observe the end of the wheel scroll. Match the existing PointerWheelScroll path by reporting each wheel delta as terminal (or explicitly completing it).
				const didScroll = this.applyNativeScrollDelta(gesture, evt.deltaX, evt.deltaY);

src/Uno.UI.Runtime.Skia.WebAssembly.Browser/ts/Runtime/BrowserPointerInputSource.ts:431

  • This path consumes WheelEvent.deltaX/deltaY before the normal pipeline's deltaMode conversion below. Firefox line-mode and page-mode wheel events therefore reach the native scroller and Uno parent as line/page units interpreted as pixels, producing incorrect scroll distances. Normalize the deltas using the same DOM_DELTA_LINE/DOM_DELTA_PAGE handling before applying them.
				const didScroll = this.applyNativeScrollDelta(gesture, evt.deltaX, evt.deltaY);

src/Uno.UI.Runtime.Skia.WebAssembly.Browser/ts/Runtime/BrowserPointerInputSource.ts:409

  • When browser zoom is disabled, Ctrl+wheel should still reach the normal managed pipeline, where ScrollContentPresenter.PointerWheelScroll uses Ctrl+wheel for ScrollViewer zoom. This condition instead negotiates it as a scroll and prevents that managed zoom path. Leave all Ctrl+wheel events to the normal pipeline; that pipeline already suppresses browser default behavior when browser zoom is disabled.
				if (evt.ctrlKey && BrowserInputHelper.isBrowserZoomEnabled) {
					return false;
				}

src/Uno.UI.Runtime.Skia.WebAssembly.Browser/ts/Runtime/BrowserPointerInputSource.ts:449

  • The second-pointer escape is only checked after getNativeInputHost succeeds. If the second finger lands on an Uno surface or outside this native root, tryHandleNegotiatedNativeInput is never called for that pointerdown; the first gesture remains active and subsequent moves continue to be prevented, so the browser cannot take over the multi-touch/pinch gesture as documented. Track a new pointer globally while a negotiated gesture is active, before target-policy filtering.
			if (evt.type === "pointerdown") {
				if (this._nativeScrollGesture !== null && this._nativeScrollGesture.pointerId !== evt.pointerId) {
					// A second finger means a multi-touch gesture (pinch/zoom) which this negotiation does not
					// arbitrate. Drop our single-pointer gesture and leave the whole interaction to the browser,
					// which still has pinch-zoom available (see the touch-action rule in uno.css).
					this.completeNativeScroll(this._nativeScrollGesture);
					this._nativeScrollGesture = null;
					return false;

src/Uno.UI.Runtime.Skia.WebAssembly.Browser/ts/Runtime/BrowserPointerInputSource.ts:389

  • Active gestures are looked up from the current event target. Because explicit pointer capture is disabled in this source, a pen gesture that leaves the native root is no longer recognized here; its later pointerup/pointercancel goes through the normal path, leaving _nativeScrollGesture without inertia or completion. Once a pointer ID is tracked, route its move/up/cancel by that state regardless of the current target, or capture it explicitly.
		private tryHandleNegotiatedNativeInput(evt: PointerEvent | WheelEvent): boolean {
			const host = this.getNativeInputHost(evt.target);
			if (host === null || host.policy === NativeElementInputPolicy.NativeOnly) {
				return false;

src/Uno.UI.Runtime.Skia.WebAssembly.Browser/ts/Runtime/BrowserPointerInputSource.ts:427

  • Wheel deltas are incorrectly given a touch-style primary-axis lock here. applyNativeScrollDelta then zeroes the smaller component, so diagonal trackpad wheel input drops one axis; the existing normal pipeline dispatches horizontal and vertical wheel components independently. Wheel gestures should bypass this axis lock.
					primaryAxis: Math.abs(evt.deltaX) > Math.abs(evt.deltaY) ? "horizontal" : "vertical",

src/Uno.UI.Runtime.Skia.WebAssembly.Browser/ts/Runtime/BrowserPointerInputSource.ts:279

  • Once any boundary residual is observed, this boolean permanently bypasses scrollTarget for the rest of the pointer sequence. If the user reverses direction before lifting, the native scroller has available range again but every delta is still sent to Uno, so chaining is not actually negotiated per delta. Re-evaluate native consumption when direction changes (ideally per axis) instead of making ownership sticky.
				if (Math.abs(remainingHorizontalDelta) > 0.01 || Math.abs(remainingVerticalDelta) > 0.01) {
					gesture.unoOwnsGesture = true;
				}

src/Uno.UI.Runtime.Skia.WebAssembly.Browser/ts/Runtime/BrowserPointerInputSource.ts:540

  • Native inertia is only canceled from inside tryHandleNegotiatedNativeInput (the wheel/pointerdown cases below). A new pointerdown on the canvas, a NativeOnly host, or an excluded control follows the early-return path here and leaves the old requestAnimationFrame fling running. That fling can continue calling OnNativeScrollDelta while the new interaction is scrolling the same ancestor; cancel the JS fling whenever a new input sequence supersedes it.
			if (this.isEventFromNativeElementHost(evt.target)) {
				if (this.tryHandleNegotiatedNativeInput(evt)) {
					return;
				}

src/Uno.UI.RuntimeTests/Tests/Windows_UI_Xaml_Controls/ScrollViewerTests/Given_ScrollViewer_ScrollChaining.cs:288

  • This test's comment says completion must produce exactly one terminal notification, but the assertion only checks that at least one false exists. A regression that raises multiple terminal ViewChanged events for the same viewer would still pass. Assert that the count of non-intermediate states is exactly one to lock the contract described by the new implementation.
			Assert.IsTrue(intermediateStates.Contains(false), "Completing the gesture must raise a non-intermediate ViewChanged.");

💡 Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.

@nventive-devops

Copy link
Copy Markdown
Contributor

The build 229071 found UI Test snapshots differences: skia-linux-screenshots: 57, skia-windows-screenshots: 289, wasm: 11

Details
  • skia-linux-screenshots: 57 changed over 2348

    🚨🚨 Comparison Details (first 20) 🚨🚨
    • Examples.png-dark
    • Examples.png
    • ExpanderColorValidationPage.png-dark
    • ExpanderColorValidationPage.png
    • Buttons.png-dark
    • Buttons.png
    • ButtonClippingTestsControl.png-dark
    • ButtonClippingTestsControl.png
    • Focus_FocusVisual_Properties.png-dark
    • DropDownButtonPage.png-dark
    • DropDownButtonPage.png
    • CalendarView_Theming.png-dark
    • CalendarView_Theming.png
    • Gamepad_CurrentReading.png-dark
    • Gamepad_CurrentReading.png
    • Gamepad_Enumeration.png-dark
    • Gamepad_Enumeration.png
    • ClipboardTests.png-dark
    • ImageIconPage.png-dark
    • ContextRequested.png-dark
  • skia-windows-screenshots: 289 changed over 2348

    🚨🚨 Comparison Details (first 20) 🚨🚨
    • ElevatedView_BorderThickness.png-dark
    • ElevatedView_BorderThickness.png
    • ElevatedView_CornerRadius.png-dark
    • ElevatedView_CornerRadius.png
    • Expander_ScrollView.png-dark
    • Expander_ScrollView.png
    • Haptics.VibrationDevice.png-dark
    • Haptics.VibrationDevice.png
    • AutomationPropertiesExtensions_Role.png-dark
    • ButtonClippingTestsControl.png-dark
    • ButtonClippingTestsControl.png
    • CalendarView_Theming.png-dark
    • CalendarView_Theming.png
    • ElevatedView_Corners.png-dark
    • ElevatedView_Corners.png
    • ElevatedView_Dimensions.png-dark
    • ElevatedView_Dimensions.png
    • Battery.png
    • Gamepad_CurrentReading.png-dark
    • Gamepad_CurrentReading.png
  • wasm: 11 changed over 1076

    🚨🚨 Comparison Details (first 20) 🚨🚨
    • UITests.Shared.Microsoft_UI_Xaml_Controls.ExpanderTests.WinUIExpanderPage
    • UITests.Windows_UI_Xaml_Media_Animation.ColorAnimation_Background
    • UITests.Windows_UI_Xaml_Controls.CalendarView.CalendarView_Theming
    • SamplesApp.Windows_UI_Xaml_Controls.ListView.ListViewSelectedItems
    • UITests.Microsoft_UI_Xaml_Controls.WebView2Tests.WebView2_NavigationProperties
    • UITests.Uno_Web.Http.CookieManagerTests
    • SamplesApp.Wasm.Windows_UI_Xaml_Controls.ListView.ListView_IsSelected
    • UITests.Shared.Windows_UI_Xaml_Controls.MediaPlayerElement.MediaPlayerElement_Minimal
    • UITests.Shared.Windows_UI_Xaml_Controls.MediaPlayerElement.MediaPlayerElement_Ogg_Extension
    • Uno.UI.Samples.Content.UITests.WebView.WebView_AnchorNavigation
    • SamplesApp.Microsoft_UI_Xaml_Controls.WebView2Tests.WebView2_EnableDevTools

Copilot AI review requested due to automatic review settings August 21, 2026 05:27

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 15 out of 15 changed files in this pull request and generated no new comments.

Suppressed comments (13)

src/SamplesApp/SamplesApp.Samples/Windows_UI_Xaml_Controls/BrowserHtmlElementTests/BrowserHtmlElement_NativeScrollNegotiation.xaml.cs:37

  • The sample's native HTML surface hardcodes a white background and black foreground, so it becomes a light, potentially low-contrast box when the SamplesApp is in dark theme while the surrounding XAML uses ThemeResource brushes. Use theme-aware CSS/custom properties (or otherwise derive these colors from the current theme) for the native content.
					("border", "2px solid #0078d4"),
					("padding", "12px"),
					("background", "white"),
					("color", "black"));

src/SamplesApp/SamplesApp.Samples/Windows_UI_Xaml_Controls/BrowserHtmlElementTests/BrowserHtmlElement_NativeScrollNegotiation.xaml.cs:31

  • The sample creates an owned DOM element but never disposes it. Leaving the page only detaches/hides the element; it does not remove it from #uno-native-element-host, so each visit leaves another hidden native node and associated managed/JS policy state behind. Dispose the element from the page's unload lifecycle (and clear the reference) after detaching it.
				_nativeElement = BrowserHtmlElement.CreateHtmlElement("div");
				_nativeElement.InputPolicy = EnableNegotiatedInput.IsChecked is true
					? BrowserHtmlElementInputPolicy.Negotiated
					: BrowserHtmlElementInputPolicy.NativeOnly;
				NativeHost.Content = _nativeElement;

src/Uno.UI.Runtime.Skia.WebAssembly.Browser/Native/BrowserNativeElementHostingExtension.cs:60

  • The guard protects the host registry, but this unconditional detach still hides the DOM element. If the same BrowserHtmlElement is attached to a new ContentPresenter before the old presenter detaches (the scenario described by the comment above), the old detach hides the element and breaks the new host's rendering and negotiation. Only call the native detach when the registry is absent/dead or still points to this extension.
		NativeMethods.DetachNativeElement(element.ElementId);

src/Uno.UI.Runtime.Skia.WebAssembly.Browser/WasmCSS/uno.css:112

  • The TypeScript path explicitly treats iframes as native-only, but this selector still applies touch-action: pinch-zoom and overscroll-behavior: none to an iframe (and a nested iframe element). Pointer events from the embedded document do not reach this handler, so a single-finger iframe scroll can be disabled with no native or Uno consumer. Exclude iframes from the CSS selector as well as the TypeScript path.
#uno-native-element-host > [data-uno-native-input-policy="1"],
#uno-native-element-host > [data-uno-native-input-policy="1"] *:not(:is(input, textarea, select, [contenteditable])):not(:is(input, textarea, select, [contenteditable]) *) {
	touch-action: pinch-zoom !important;
	overscroll-behavior: none !important;

src/Uno.UI.Runtime.Skia.WebAssembly.Browser/WasmCSS/uno.css:110

  • The root selector is not subject to the form/contenteditable exclusions applied to descendants. If the BrowserHtmlElement itself is an input, textarea, select, or contenteditable root, the TypeScript path correctly leaves it native, but this rule still forces touch-action: pinch-zoom and overscroll-behavior: none, disabling the native panning/selection behavior promised by the API and potentially leaving no handler to pan. Apply the same :not(:is(input, textarea, select, [contenteditable])) filter to the root selector.
#uno-native-element-host > [data-uno-native-input-policy="1"],
#uno-native-element-host > [data-uno-native-input-policy="1"] *:not(:is(input, textarea, select, [contenteditable])):not(:is(input, textarea, select, [contenteditable]) *) {

src/Uno.UI.Runtime.Skia.WebAssembly.Browser/WasmCSS/uno.css:112

  • The form/contenteditable exclusions only remove the rule from the excluded element and its descendants; the negotiated root itself still forces touch-action: pinch-zoom. Browsers compute the effective touch action by intersecting the touched element with its ancestors, so native controls or a non-scrollable contenteditable subtree can still lose single-finger native selection/scroll behavior despite the JS closest() exclusion. The policy needs a way to leave a native subtree outside the negotiated touch-action boundary, rather than only excluding its descendants from this selector.
#uno-native-element-host > [data-uno-native-input-policy="1"],
#uno-native-element-host > [data-uno-native-input-policy="1"] *:not(:is(input, textarea, select, [contenteditable])):not(:is(input, textarea, select, [contenteditable]) *) {
	touch-action: pinch-zoom !important;
	overscroll-behavior: none !important;

src/Uno.UI.Runtime.Skia.WebAssembly.Browser/ts/Runtime/BrowserNativeElementHostingExtension.ts:195

  • Changing InputPolicy to NativeOnly only updates the policy map and attribute; it does not cancel an already scheduled inertia RAF. If the sample or an app toggles the policy while a fling is running, the stored gesture continues invoking OnNativeScrollDelta and can keep scrolling the ancestor ScrollViewer after negotiation has been disabled. Cancel the matching active/inertial gesture when switching away from Negotiated.
		public static setInputPolicy(elementId: string, unoElementId: number, value: number) {
			const element = this.getElementOrThrow(elementId);
			BrowserHtmlElement.inputPolicies.set(element, { policy: value, unoElementId: unoElementId });
			element.dataset.unoNativeInputPolicy = value.toString();
		}

src/Uno.UI.Runtime.Skia.WebAssembly.Browser/ts/Runtime/BrowserPointerInputSource.ts:540

  • Once a negotiated gesture is active, this path is still gated by the current event target. With pointer capture disabled, a normal drag can leave the native root (or enter an excluded input/contenteditable subtree), after which the pointer-up/cancel bypasses this handler and _nativeScrollGesture is never cleared or completed. The managed ScrollViewer can therefore miss its terminal ViewChanged and the stale gesture can interfere with the next pointer sequence; route the active pointer by its stored id or explicitly cancel/complete it when the target leaves the negotiated surface.
			if (this.isEventFromNativeElementHost(evt.target)) {
				if (this.tryHandleNegotiatedNativeInput(evt)) {
					return;
				}

src/Uno.UI.Runtime.Skia.WebAssembly.Browser/ts/Runtime/BrowserPointerInputSource.ts:435

  • Wheel events use the default isIntermediate: true here, but this path never calls OnNativeScrollCompleted for the local wheel gesture. Consequently any residual handed to a ScrollViewer is reported as intermediate forever: consumers never receive the terminal ViewChanged, and snap-point scheduling that runs on a non-intermediate update is skipped. Wheel updates should be reported as terminal (or the burst needs an explicit completion).
				const didScroll = this.applyNativeScrollDelta(gesture, evt.deltaX, evt.deltaY);
				if (didScroll) {
					evt.preventDefault();
				}
				return true;

src/Uno.UI.Runtime.Skia.WebAssembly.Browser/ts/Runtime/BrowserPointerInputSource.ts:518

  • Every negotiated touch ends by starting the custom JavaScript fling, without checking ScrollViewer.IsScrollInertiaEnabled. The managed direct-manipulation path explicitly stops when that property is false (ScrollContentPresenter.Managed.cs:679-683), so an app that disables inertia still receives extra native/ancestor scrolling after lifting the pointer. The native bridge needs to query/gate this setting or delegate inertia to the managed path.
				if (gesture.started) {
					this.startNativeScrollInertia(gesture);
					if (this._nativeScrollInertiaGesture === null) {

src/Uno.UI.RuntimeTests/Tests/Windows_UI_Xaml_Controls/ScrollViewerTests/Given_ScrollViewer_ScrollChaining.cs:70

  • Each test calls UITestHelper.Load, which assigns WindowHelper.WindowContent, but the class never clears that shared visual tree. A failed assertion or the next test can therefore inherit the previous ScrollViewer and its event handlers/state; wrap each test's loaded content in a try/finally that restores WindowHelper.WindowContent = null.
		await UITestHelper.Load(outer);

src/Uno.UI.RuntimeTests/Tests/Windows_UI_Xaml_Controls/ScrollViewerTests/Given_ScrollViewer_ScrollChaining.cs:22

  • These tests directly cover issue #24134, but the runtime-test convention requires issue-covering tests to carry a GitHubWorkItem URL for traceability. Add the attribute for issue 24134 at the class (or test) level.
[TestClass]
[RunsOnUIThread]
public class Given_ScrollViewer_ScrollChaining

src/Uno.UI.Runtime.Skia.WebAssembly.Browser/ts/Runtime/BrowserPointerInputSource.ts:434

  • The negotiated wheel path passes raw deltaX/deltaY to the scroller. Unlike the normal path below, it does not convert DOM_DELTA_LINE or DOM_DELTA_PAGE to pixels, so Firefox and other line/page-mode wheel sources scroll by the wrong amount and hand an incorrectly sized residual to Uno. Normalize the deltas before selecting the primary axis and applying the native/managed scroll.

This issue also appears in the following locations of the same file:

  • line 431
  • line 537
				const didScroll = this.applyNativeScrollDelta(gesture, evt.deltaX, evt.deltaY);
				if (didScroll) {
					evt.preventDefault();
				}

@unodevops

Copy link
Copy Markdown
Contributor

@unodevops

Copy link
Copy Markdown
Contributor

@nventive-devops

Copy link
Copy Markdown
Contributor

The build 229088 found UI Test snapshots differences: skia-linux-screenshots: 57, skia-windows-screenshots: 2348, wasm: 11

Details
  • skia-linux-screenshots: 57 changed over 2348

    🚨🚨 Comparison Details (first 20) 🚨🚨
    • Gamepad_CurrentReading.png-dark
    • Gamepad_CurrentReading.png
    • Gamepad_Enumeration.png-dark
    • Gamepad_Enumeration.png
    • ButtonClippingTestsControl.png
    • Buttons.png-dark
    • ButtonClippingTestsControl.png-dark
    • CalendarView_Theming.png-dark
    • CalendarView_Theming.png
    • ElementLevelTheme.png-dark
    • DisplayInformation.png-dark
    • ContextRequested.png-dark
    • ElementLevelTheme.png
    • ContextRequested.png
    • Buttons.png
    • ClipboardTests.png-dark
    • DropDownButtonPage.png-dark
    • Examples.png-dark
    • DropDownButtonPage.png
    • Examples.png
  • skia-windows-screenshots: 2348 changed over 2396

    🚨🚨 Comparison Details (first 20) 🚨🚨
    • AnimatedIconPage.png-dark
    • AppWindowClosing.png-dark
    • AppWindowPresenters.png-dark
    • Arrange_Performance01.png-dark
    • AutoBorderStretchwithleftmargin.png
    • AutoSizedPathCentered.png
    • AutoSuggestBox_SoftKeboard.png-dark
    • Basics_Automated.png
    • BezierSegment.png
    • BindableDrawerLayout_ChangePane.png-dark
    • BorderLeftwithmargins.png-dark
    • BorderLeftwithmargins.png
    • Border_CornerRadius_Alignments.png-dark
    • Border_CornerRadius_Alignments.png
    • Border_Simple_No_Background_With_Content_Border_With_Background.png-dark
    • Border_Simple_No_Background_With_Content_Border_With_Background.png
    • Buttons_Native.png-dark
    • Buttons_Native.png
    • Capture with overlap.png-dark
    • Capture with overlap.png
  • wasm: 11 changed over 1076

    🚨🚨 Comparison Details (first 20) 🚨🚨
    • SamplesApp.Windows_UI_Xaml_Controls.ListView.ListViewSelectedItems
    • UITests.Shared.Windows_UI_Xaml_Controls.MediaPlayerElement.MediaPlayerElement_Ogg_Extension
    • UITests.Windows_UI_Xaml_Media_Animation.ColorAnimation_Background
    • UITests.Uno_Web.Http.CookieManagerTests
    • UITests.Microsoft_UI_Xaml_Controls.WebView2Tests.WebView2_NavigationProperties
    • UITests.Shared.Windows_UI_Xaml_Controls.MediaPlayerElement.MediaPlayerElement_Minimal
    • SamplesApp.Wasm.Windows_UI_Xaml_Controls.ListView.ListView_IsSelected
    • UITests.Shared.Microsoft_UI_Xaml_Controls.ExpanderTests.WinUIExpanderPage
    • SamplesApp.Microsoft_UI_Xaml_Controls.WebView2Tests.WebView2_EnableDevTools
    • UITests.Windows_UI_Xaml_Controls.CalendarView.CalendarView_Theming
    • Uno.UI.Samples.Content.UITests.WebView.WebView_AnchorNavigation

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 15 out of 15 changed files in this pull request and generated no new comments.

Suppressed comments (14)

Previously missed (4) — in code that hasn't changed since the last review.

src/Uno.UI.Runtime.Skia.WebAssembly.Browser/WasmCSS/uno.css:116

  • The CSS side trusts a caller-mutable data attribute as the marker for negotiated input. Hosted code can set data-uno-native-input-policy="1" on the root even when the managed policy is NativeOnly; the TypeScript map will still return NativeOnly, but this rule will disable native panning with touch-action: pinch-zoom/overscroll-behavior: none, leaving the gesture with no consumer. The CSS marker must not be writable by hosted content, or the CSS state must be protected/reconciled from managed state.
#uno-native-element-host > [data-uno-native-input-policy="1"]:not(:is(input, textarea, select, iframe, [contenteditable])),
#uno-native-element-host > [data-uno-native-input-policy="1"] *:not(:is(input, textarea, select, iframe, [contenteditable])):not(:is(input, textarea, select, iframe, [contenteditable]) *) {
	touch-action: pinch-zoom !important;

src/Uno.UI.Runtime.Skia.WebAssembly.Browser/ts/Runtime/BrowserPointerInputSource.ts:430

  • The normal wheel pipeline converts DOM_DELTA_LINE and DOM_DELTA_PAGE before handing deltas to managed scrolling, but this path passes the raw values directly to scrollTop/scrollLeft and the residual bridge. On browsers that report line/page units, a wheel tick will move by a few pixels or one pixel instead of the intended line/page distance. Normalize evt.deltaMode before this call, preferably through a shared helper with the normal path.
				const didScroll = this.applyNativeScrollDelta(gesture, evt.deltaX, evt.deltaY);

src/Uno.UI.Runtime.Skia.WebAssembly.Browser/ts/Runtime/BrowserPointerInputSource.ts:430

  • This is a one-shot wheel gesture, but the call leaves isIntermediate at its default true and the wheel branch never calls completeNativeScroll. When a wheel delta reaches the Uno parent, every Set is therefore intermediate and no terminal ViewChanged(IsIntermediate: false) is raised. Treat each wheel event as terminal (or explicitly complete a coalesced burst), matching the existing PointerWheelScroll path.
				const didScroll = this.applyNativeScrollDelta(gesture, evt.deltaX, evt.deltaY);

src/Uno.UI.RuntimeTests/Tests/Windows_UI_Xaml_Controls/ScrollViewerTests/Given_ScrollViewer_ScrollChaining.cs:335

  • The comment says completion must produce exactly one terminal ViewChanged, but this assertion only checks that at least one false value exists. A regression that emits multiple terminal notifications would pass; assert the count of non-intermediate entries is exactly one.
			Assert.IsTrue(intermediateStates.Contains(false), "Completing the gesture must raise a non-intermediate ViewChanged.");

src/Uno.UI.Runtime.Skia.WebAssembly.Browser/Native/BrowserNativeElementHostingExtension.cs:60

  • The registration is removed before NativeMethods.DetachNativeElement runs, but the JS detach implementation first cancels an active fling and synchronously calls OnNativeScrollCompleted. That callback then cannot find this host in _hosts, so a fling that had handed off to Uno never receives its terminal ViewChanged(IsIntermediate: false) when the native element is detached. Complete the gesture before unregistering, or defer removal while preserving the recycled-host identity check.
		if (_hosts.TryGetValue(element.UnoElementId, out var registered)
			&& (!registered.TryGetTarget(out var host) || ReferenceEquals(host, this)))
		{
			_hosts.Remove(element.UnoElementId);
		}

		NativeMethods.DetachNativeElement(element.ElementId);

src/Uno.UI.Runtime.Skia.WebAssembly.Browser/Native/BrowserNativeElementHostingExtension.cs:56

  • The ownership guard protects only _hosts: if a new presenter attaches the same BrowserHtmlElement before the old presenter detaches, this condition leaves the map pointing at the new presenter, but line 60 still calls detachNativeElement and hides the DOM element. The new presenter then has a registered but hidden host. Only detach the DOM element when this instance still owns the registration.
		// Only drop the registration if it is still ours: when an element is recycled, the new host can
		// attach before the old one detaches, and unregistering then would silently kill its chaining.
		if (_hosts.TryGetValue(element.UnoElementId, out var registered)
			&& (!registered.TryGetTarget(out var host) || ReferenceEquals(host, this)))
		{

src/Uno.UI.Runtime.Skia.WebAssembly.Browser/ts/Runtime/BrowserNativeElementHostingExtension.ts:194

  • Updating the policy map does not cancel _nativeScrollInertiaGesture. If InputPolicy changes from Negotiated to NativeOnly while a fling is running (the sample exposes this toggle), the existing requestAnimationFrame loop continues to call OnNativeScrollDelta and scroll the ancestor even though opt-in is now off. Cancel the active gesture/inertia when disabling or changing the policy before updating the map.
		public static setInputPolicy(elementId: string, unoElementId: number, value: number) {
			const element = this.getElementOrThrow(elementId);
			BrowserHtmlElement.inputPolicies.set(element, { policy: value, unoElementId: unoElementId });
			element.dataset.unoNativeInputPolicy = value.toString();

src/Uno.UI.Runtime.Skia.WebAssembly.Browser/ts/Runtime/BrowserPointerInputSource.ts:506

  • After the touch/pen threshold, this unconditional preventDefault() also runs for ordinary selectable text; only form controls and contenteditable subtrees are excluded. A touch selection drag in a static paragraph is therefore canceled and routed as scrolling, contrary to the new BrowserHtmlElementInputPolicy documentation and PR behavior claim that text selection remains native. Preserve that selection path or narrow the public contract.
				this.applyNativeScrollDelta(gesture, horizontalDelta, verticalDelta);
				evt.preventDefault();

src/Uno.UI.Runtime.Skia.WebAssembly.Browser/ts/Runtime/BrowserPointerInputSource.ts:539

  • This branch only invokes tryHandleNegotiatedNativeInput while the current event target is still under #uno-native-element-host. Pointer capture is disabled above and pen pointers are not guaranteed implicit capture, so a pen drag that leaves the hosted element sends subsequent pointermove/pointerup events through the normal path; _nativeScrollGesture is then never cleared or completed, and a handed-off gesture misses its terminal update. Handle an active negotiated pointer by pointerId before requiring the current target to be a native host, and cancel/finalize it when it leaves.
			if (this.isEventFromNativeElementHost(evt.target)) {
				if (this.tryHandleNegotiatedNativeInput(evt)) {
					return;
				}

src/Uno.UI.Runtime.Skia.WebAssembly.Browser/ts/Runtime/BrowserPointerInputSource.ts:281

  • Once any residual is detected, unoOwnsGesture is latched and the native target is never visited again. If the user reverses direction before lifting, the native scroller may be able to consume the new delta again, but this code continues routing all movement to the outer ScrollViewer, leaving the inner surface stuck for the rest of the drag. Re-evaluate native consumption for each delta (or explicitly return ownership when the direction becomes consumable) instead of making handoff permanent.
				if (Math.abs(remainingHorizontalDelta) > 0.01 || Math.abs(remainingVerticalDelta) > 0.01) {
					gesture.unoOwnsGesture = true;
				}

src/Uno.UI.RuntimeTests/Tests/Windows_UI_Xaml_Controls/ScrollViewerTests/Given_ScrollViewer_ScrollChaining.cs:22

  • These tests cover the behavior tracked by issue #24134 but do not carry the repository's required issue-traceability attribute. Add GitHubWorkItem at the class level so the regression tests remain linked to the issue they guard.
[TestClass]
[RunsOnUIThread]
public class Given_ScrollViewer_ScrollChaining

src/Uno.UI/UI/Xaml/Controls/ScrollViewer/ScrollViewer.ScrollChaining.cs:75

  • This absorption does not match the existing direct-manipulation contract: when ScrollContentPresenter has no local inertia (IsScrollInertiaEnabled == false), OnUpdated leaves the inertial delta unhandled so an outer ScrollViewer can consume it (ScrollContentPresenter.Managed.cs:628-635). Zeroing the residual here stops the fling at the inner viewer instead, and the following chaining-disabled logic reinforces that behavior. Preserve the residual for outer viewers when local inertia is refused if this bridge is to mirror the managed pipeline.
			if (isInertial && !scrollViewer.IsScrollInertiaEnabled)
			{
				// Mirrors IDirectManipulationHandler.OnInertiaStarting: with inertia opted out, this ScrollViewer
				// neither moves during the inertial phase nor lets the fling continue past it on the axes it takes
				// part in - an outer ScrollViewer flinging while this one stands still would look broken.
				if (scrollsHorizontally)
				{
					remainingHorizontalDelta = 0;
				}

				if (scrollsVertically)
				{
					remainingVerticalDelta = 0;
				}

src/Uno.UI/UI/Xaml/Controls/ScrollViewer/ScrollViewer.ScrollChaining.cs:92

  • ChainScrollFromDescendant always passes isTouch: true to the presenter, but the browser also routes WheelEvents through this method. ScrollContentPresenter.Set uses IsTouch to skip completing _touchInertia, so a managed fling already running when the user wheels over a negotiated native element can continue fighting the wheel movement. Distinguish wheel input from touch/inertia or complete the managed inertia before applying the wheel delta.
					isTouch: true);

src/Uno.UI/UI/Xaml/Controls/ScrollViewer/ScrollViewer.ScrollChaining.cs:113

  • When CanHorizontallyScroll is false, scrollsHorizontally is false, so this condition never absorbs a residual even when IsHorizontalScrollChainingEnabled is false. The delta can then reach an outer ScrollViewer, unlike IDirectManipulationHandler.OnUpdated, which clears the axis whenever the chaining flag is disabled. Apply the chaining flag to the remaining axis delta independently of CanHorizontallyScroll (and likewise for the vertical axis).
			if (scrollsHorizontally && !scrollViewer.IsHorizontalScrollChainingEnabled)
			{
				remainingHorizontalDelta = 0;
			}

@unodevops

Copy link
Copy Markdown
Contributor

@unodevops

Copy link
Copy Markdown
Contributor

@nventive-devops

Copy link
Copy Markdown
Contributor

The build 229255 found UI Test snapshots differences: skia-linux-screenshots: 57, skia-windows-screenshots: 2348, wasm: 11

Details
  • skia-linux-screenshots: 57 changed over 2348

    🚨🚨 Comparison Details (first 20) 🚨🚨
    • ImageIconPage.png-dark
    • ButtonClippingTestsControl.png-dark
    • ButtonClippingTestsControl.png
    • Buttons.png-dark
    • Buttons.png
    • ClipboardTests.png-dark
    • DropDownButtonPage.png-dark
    • DropDownButtonPage.png
    • Gamepad_CurrentReading.png-dark
    • Gamepad_CurrentReading.png
    • Gamepad_Enumeration.png-dark
    • Gamepad_Enumeration.png
    • CalendarView_Theming.png-dark
    • CalendarView_Theming.png
    • DisplayInformation.png-dark
    • Examples.png-dark
    • Examples.png
    • ElementLevelTheme.png-dark
    • ExpanderColorValidationPage.png-dark
    • ElementLevelTheme.png
  • skia-windows-screenshots: 2348 changed over 2396

    🚨🚨 Comparison Details (first 20) 🚨🚨
    • ApplicationViewMode.png
    • Accessibility_ScreenReader.png-dark
    • AppBar_KeyBoard.png
    • AuthenticationBroker_Demo.png
    • ApplicationViewSizing.png-dark
    • AppXamlDefinedResources.png
    • AutomationProperties_Name.png
    • Attributed_text_FontSize_Changing.png
    • AutomationProperties_AutomationId.png-dark
    • AutoSuggestBox_Reason.png
    • AutomationProperties_AutomationId.png
    • AutoSuggestBox_Keyboard.png-dark
    • BasicAcrylicBrushTest2.png-dark
    • AutoSuggestBox_Reason.png-dark
    • BasicEnability.png
    • Border_CornerRadius.png-dark
    • Battery.png-dark
    • BindableDrawerLayout_ChangePane.png
    • Border_CornerRadius_Clipping2.png
    • BenchmarkDotNet.png
  • wasm: 11 changed over 1076

    🚨🚨 Comparison Details (first 20) 🚨🚨
    • SamplesApp.Windows_UI_Xaml_Controls.ListView.ListViewSelectedItems
    • UITests.Shared.Microsoft_UI_Xaml_Controls.ExpanderTests.WinUIExpanderPage
    • SamplesApp.Wasm.Windows_UI_Xaml_Controls.ListView.ListView_IsSelected
    • UITests.Shared.Windows_UI_Xaml_Controls.MediaPlayerElement.MediaPlayerElement_Ogg_Extension
    • UITests.Microsoft_UI_Xaml_Controls.WebView2Tests.WebView2_NavigationProperties
    • UITests.Shared.Windows_UI_Xaml_Controls.MediaPlayerElement.MediaPlayerElement_Minimal
    • UITests.Windows_UI_Xaml_Controls.CalendarView.CalendarView_Theming
    • Uno.UI.Samples.Content.UITests.WebView.WebView_AnchorNavigation
    • SamplesApp.Microsoft_UI_Xaml_Controls.WebView2Tests.WebView2_EnableDevTools
    • UITests.Uno_Web.Http.CookieManagerTests
    • UITests.Windows_UI_Xaml_Media_Animation.ColorAnimation_Background

Copilot AI review requested due to automatic review settings August 26, 2026 14:37

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 15 out of 15 changed files in this pull request and generated 1 comment.

Suppressed comments (1)

Previously missed (1) — in code that hasn't changed since the last review.

src/Uno.UI.Runtime.Skia.WebAssembly.Browser/ts/Runtime/BrowserPointerInputSource.ts:294

  • applyNativeScrollDelta() returns only the managed OnNativeScrollDelta result once gesture.unoOwnsGesture becomes true. When the native scrollTarget consumed part of the delta (hit its boundary) but no ScrollViewer could scroll, this returns false and the WheelEvent path will not call preventDefault(), allowing the browser to also process the wheel (which can cause double-scroll/overscroll). Return true if either the native scrollTarget moved or Uno consumed any delta.
				return BrowserPointerInputSource._exports.OnNativeScrollDelta(
					gesture.unoElementId,
					remainingHorizontalDelta,
					remainingVerticalDelta,
					isIntermediate,
					isInertial) !== 0;

@unodevops

Copy link
Copy Markdown
Contributor

@unodevops

Copy link
Copy Markdown
Contributor

@nventive-devops

Copy link
Copy Markdown
Contributor

The build 230360 found UI Test snapshots differences: skia-linux-screenshots: 57, skia-windows-screenshots: 2348, wasm: 11

Details
  • skia-linux-screenshots: 57 changed over 2348

    🚨🚨 Comparison Details (first 20) 🚨🚨
    • DisplayInformation.png-dark
    • Focus_FocusVisual_Properties.png-dark
    • Gamepad_CurrentReading.png-dark
    • Gamepad_CurrentReading.png
    • Gamepad_Enumeration.png-dark
    • Gamepad_Enumeration.png
    • DropDownButtonPage.png-dark
    • DropDownButtonPage.png
    • Buttons.png-dark
    • Buttons.png
    • ButtonClippingTestsControl.png-dark
    • ButtonClippingTestsControl.png
    • ImageIconPage.png-dark
    • ElementLevelTheme.png-dark
    • ElementLevelTheme.png
    • ClipboardTests.png-dark
    • ContextRequested.png-dark
    • ContextRequested.png
    • CalendarView_Theming.png-dark
    • CalendarView_Theming.png
  • skia-windows-screenshots: 2348 changed over 2396

    🚨🚨 Comparison Details (first 20) 🚨🚨
    • ApplicationViewMode.png-dark
    • Arrange_Performance01.png
    • AutoBorderStretchwithleftmargin.png
    • AutoSizedTopLeft.png-dark
    • AutoSuggestBox_SoftKeboard.png-dark
    • Basics Pivot Test.png-dark
    • Battery.png
    • BezierSegment.png
    • BitmapImage_vs_SvgImageSource.png
    • BorderBottomwithmargins.png-dark
    • BorderWithNullBrushAndNonZeroThickness.png
    • Border_AntiAlias.png-dark
    • Border_CornerRadius_Toggle.png
    • Border_CornerRadius_with_Opacity.png-dark
    • Border_With_RotateTransform.png-dark
    • Border_With_RotateTransform.png
    • Button_Inside_Border.png-dark
    • Button_Inside_Border.png
    • Capture.png-dark
    • Capture.png
  • wasm: 11 changed over 1076

    🚨🚨 Comparison Details (first 20) 🚨🚨
    • UITests.Shared.Microsoft_UI_Xaml_Controls.ExpanderTests.WinUIExpanderPage
    • UITests.Microsoft_UI_Xaml_Controls.WebView2Tests.WebView2_NavigationProperties
    • UITests.Shared.Windows_UI_Xaml_Controls.MediaPlayerElement.MediaPlayerElement_Minimal
    • UITests.Windows_UI_Xaml_Media_Animation.ColorAnimation_Background
    • SamplesApp.Wasm.Windows_UI_Xaml_Controls.ListView.ListView_IsSelected
    • UITests.Uno_Web.Http.CookieManagerTests
    • SamplesApp.Windows_UI_Xaml_Controls.ListView.ListViewSelectedItems
    • Uno.UI.Samples.Content.UITests.WebView.WebView_AnchorNavigation
    • SamplesApp.Microsoft_UI_Xaml_Controls.WebView2Tests.WebView2_EnableDevTools
    • UITests.Shared.Windows_UI_Xaml_Controls.MediaPlayerElement.MediaPlayerElement_Ogg_Extension
    • UITests.Windows_UI_Xaml_Controls.CalendarView.CalendarView_Theming

Copilot AI review requested due to automatic review settings August 26, 2026 16:35

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 16 out of 16 changed files in this pull request and generated no new comments.

Suppressed comments (1)

Previously missed (1) — in code that hasn't changed since the last review.

src/Uno.UI/UI/Xaml/Controls/ScrollViewer/ScrollViewer.ScrollChaining.cs:141

  • CompleteChainedScrollFromDescendant calls presenter.Set(...) for every ScrollViewer ancestor, which will raise ViewChanged(IsIntermediate: false) even for ScrollViewers that never participated in the chained scroll (e.g., a ScrollViewer in the ancestry with both axes disabled, where ChainScrollFromDescendant never called presenter.Set). This can introduce unexpected terminal ViewChanged events on unrelated/disabled scrollers.
			if (ancestor is ScrollViewer { Presenter: { } presenter })
			{
				// No offset is passed: this only re-reports the offsets already in place, with
				// IsIntermediate false to close the sequence of intermediate deltas.
				presenter.Set(disableAnimation: true, isIntermediate: false, isTouch: true);

@unodevops

Copy link
Copy Markdown
Contributor

@unodevops

Copy link
Copy Markdown
Contributor

@nventive-devops

Copy link
Copy Markdown
Contributor

The build 230396 found UI Test snapshots differences: skia-linux-screenshots: 57, skia-windows-screenshots: 289, wasm: 11

Details
  • skia-linux-screenshots: 57 changed over 2348

    🚨🚨 Comparison Details (first 20) 🚨🚨
    • Focus_FocusVisual_Properties.png-dark
    • DisplayInformation.png-dark
    • Buttons.png-dark
    • Buttons.png
    • ImageIconPage.png-dark
    • Examples.png-dark
    • Examples.png
    • ExpanderColorValidationPage.png-dark
    • ExpanderColorValidationPage.png
    • CalendarView_Theming.png-dark
    • CalendarView_Theming.png
    • ClipboardTests.png-dark
    • Gamepad_CurrentReading.png-dark
    • Gamepad_CurrentReading.png
    • Gamepad_Enumeration.png-dark
    • Gamepad_Enumeration.png
    • ButtonClippingTestsControl.png-dark
    • ButtonClippingTestsControl.png
    • ContextRequested.png-dark
    • ContextRequested.png
  • skia-windows-screenshots: 289 changed over 2348

    🚨🚨 Comparison Details (first 20) 🚨🚨
    • Accessibility_ScreenReader.png-dark
    • FileSavePickerTests.png-dark
    • FileSavePickerTests.png
    • Focus_FocusVisual_Properties.png-dark
    • AuthenticationBroker_Demo.png-dark
    • AutomationPropertiesExtensions_Role.png
    • CameraCaptureUISample.png-dark
    • CameraCaptureUISample.png
    • ElevatedView_Corners.png-dark
    • ElevatedView_Corners.png
    • ElevatedView_Dimensions.png-dark
    • ElevatedView_Dimensions.png
    • FluentStyle_NavigationViewSample.png-dark
    • FluentStyle_NavigationViewSample.png
    • AutomationPropertiesExtensions_Role.png-dark
    • Battery.png
    • CompositionPath.png-dark
    • CompositionPath.png
    • ElevatedView_Levels.png-dark
    • ElevatedView_Levels.png
  • wasm: 11 changed over 1076

    🚨🚨 Comparison Details (first 20) 🚨🚨
    • UITests.Windows_UI_Xaml_Media_Animation.ColorAnimation_Background
    • UITests.Shared.Microsoft_UI_Xaml_Controls.ExpanderTests.WinUIExpanderPage
    • SamplesApp.Windows_UI_Xaml_Controls.ListView.ListViewSelectedItems
    • SamplesApp.Wasm.Windows_UI_Xaml_Controls.ListView.ListView_IsSelected
    • UITests.Uno_Web.Http.CookieManagerTests
    • UITests.Microsoft_UI_Xaml_Controls.WebView2Tests.WebView2_NavigationProperties
    • UITests.Windows_UI_Xaml_Controls.CalendarView.CalendarView_Theming
    • UITests.Shared.Windows_UI_Xaml_Controls.MediaPlayerElement.MediaPlayerElement_Minimal
    • UITests.Shared.Windows_UI_Xaml_Controls.MediaPlayerElement.MediaPlayerElement_Ogg_Extension
    • Uno.UI.Samples.Content.UITests.WebView.WebView_AnchorNavigation
    • SamplesApp.Microsoft_UI_Xaml_Controls.WebView2Tests.WebView2_EnableDevTools

@unodevops

Copy link
Copy Markdown
Contributor

⚠️⚠️ The build 230396 has failed on Uno.UI - CI.

@mergify

mergify Bot commented Aug 26, 2026

Copy link
Copy Markdown
Contributor

Tick the box to add this pull request to the merge queue (same as @mergifyio queue).

  • Queue this pull request

@ajpinedam
ajpinedam merged commit aef195f into unoplatform:master Aug 26, 2026
51 checks passed
@ajpinedam
ajpinedam deleted the dev/anpi/fix.wasm.native.html.scroll.chaining branch August 26, 2026 19:12
@ajpinedam

Copy link
Copy Markdown
Contributor Author

@Mergifyio backport release/stable/6.7

@mergify

mergify Bot commented Aug 27, 2026 •

Copy link
Copy Markdown
Contributor

backport release/stable/6.7

✅ Backports have been created

Details

kazo0 added a commit that referenced this pull request Aug 28, 2026
…6.7/pr-24138

fix(wasm): Chain BrowserHtmlElement scrolling to the enclosing ScrollViewer (backport #24138)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/automation Categorizes an issue or PR as relevant to project automation area/skia ✏️ Categorizes an issue or PR as relevant to Skia kind/documentation platform/wasm 🌐 Categorizes an issue or PR as relevant to the WebAssembly platform

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants