Repository navigation
Conversation
There was a problem hiding this comment.
Pull request overview
Adds Skia-only runtime regression tests to ensure ContextRequested bubbling stops after the first ContextFlyout is shown (preventing both child and ancestor context menus from opening), covering multiple visual-tree shapes matching issue #23440.
Changes:
- Added input-injection-based bubbling tests for right-click and touch-hold scenarios.
- Validated that only the innermost element’s
ContextFlyoutopens across Borders, panels, ListView items, and ScrollViewer cases.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
🤖 Your WebAssembly Skia Sample App stage site is ready! Visit it here: https://unowasmprstaging.z20.web.core.windows.net/pr-23520/wasm-skia-net9/index.html |
|
|
Co-authored-by: Copilot Autofix powered by AI <[email protected]>
|
🤖 Your WebAssembly Skia Sample App stage site is ready! Visit it here: https://unowasmprstaging.z20.web.core.windows.net/pr-23520/wasm-skia-net9/index.html |
|
|
Co-authored-by: Copilot Autofix powered by AI <[email protected]>
|
🤖 Your WebAssembly Skia Sample App stage site is ready! Visit it here: https://unowasmprstaging.z20.web.core.windows.net/pr-23520/wasm-skia-net9/index.html |
GitHub Issue: closes #23440
PR Type:
🧪 Tests (regression coverage)
What changed? 🚀
Issue #23440 reports that on Skia, right-clicking a child whose
ContextFlyoutis set — when an ancestor also has aContextFlyout— opens both the child's and the ancestor's context menus, becauseContextRequesteddoes not stop bubbling once a flyout is shown.This was reproduced on the reported 6.5.36 and confirmed fixed on
masterusing one minimal Skia-desktop app, flipping only theUno.Sdkversion inglobal.jsonand injecting a real right-click on the child:childOpened=1 parentOpened=1→ both menus open 🐞childOpened=1 parentOpened=0→ only the child menu opens ✅The fix is the recent context-menu rework (notably
455368f5 fix: Invoke default ContextRequested handlers during bubbling, plus1c8aa1e1,16645ce4,50a0244, all 2026-01-18), which postdates the 6.5.x line and already aligns the implementation with the WinUI C++ sources. A runtime trace confirms the WinUICControl::Delegates/FireEventbehavior:ContextRequestedis raised from the source element. The per-element gesture-recognizer dedup (PreventEventsduring theRightTapped/Holdingbubble) suppresses ancestors' recognizers, so the event is raised exactly once.OnContextRequestedCore) runs at each element up the tree during the bubble; the first element with aContextFlyoutshows it and setsHandled = true; every ancestor then bails on theHandledcheck.The reported versions (6.5.31 / 6.5.36) predate this rework, which explains the discrepancy.
This PR adds regression coverage (no production code change required) that exercises the real input path (gesture recognizer →
ContextRequested) across the tree shapes implied by the issue — which the existing direct-RaiseEventtests did not cover:When_RightClick_Child_Border_In_Border_Only_Child_Opens— both parent and child are non-Controlelements.When_RightClick_Child_Through_Intermediate_Panel_Only_Child_Opens— ancestor flyout separated by a no-flyout panel.When_RightClick_ListViewItem_With_Flyout_ListView_Flyout_Not_Shown— the "file explorer" item-vs-container shape.When_RightClick_Child_In_ScrollViewer_Only_Child_Opens— child inside a pointer-capturingScrollViewer.When_TouchHold_Child_In_Parent_Only_Child_Opens— touch long-press variant (mirrors linked [WASM Skia] Long press clicks before opening context menu #22229).Each test asserts the child's flyout opens exactly once and no ancestor flyout opens. All 47 context-menu runtime tests pass on Skia Desktop.
PR Checklist ✅
Screenshots Compare Test Runresults.