Skip to content

fix: Resolve FindName through the XAML namescope - #25307

Open
MartinZikmund wants to merge 8 commits into
masterfrom
dev/mazi/findname-namescope
Open

MartinZikmund wants to merge 8 commits into
masterfrom
dev/mazi/findname-namescope

Conversation

@MartinZikmund

@MartinZikmund MartinZikmund commented Oct 11, 2026 •

Copy link
Copy Markdown
Member

GitHub Issue: part of #21129

Note

Stacked on #23935 (base branch 005-mobile-a11y-automation, GitHub stack #24389). The diff shows only this PR's commits.

Stack, bottom to top:

  1. feat(a11y): add mobile automation support #23935 mobile automation
  2. This PR: FindName / XAML namescope fixes
  3. fix: Declare Name on DependencyObject like WinUI #25184 DependencyObject-owned NameProperty
  4. fix(a11y): Use owning flyout name for presenter AutomationId #25308 flyout owner-name AutomationId
  5. refactor: Register DependencyObject.Name without the holder #25214 DP storage independent of registration order

PR Type:

🐞 Bugfix

What changed? 🚀

FindName never returned named objects that aren't FrameworkElements, such as Run, Hyperlink, brushes, transforms and flyouts. WinUI finds all of them, for both x:Name and Name=. These commits were split out of #23935 unchanged.

  • FindName: it keeps Uno's tree walk. When that finds nothing, it looks the name up in the element's namescope, so named Runs, Hyperlinks, brushes, transforms and flyouts resolve as they do on WinUI. The walk into descendants stays a plain tree walk, so names don't cross between scopes.
  • Template parts: GetTemplateChild and the internal DescriptionPresenter / LightDismissLayer lookups search only the control's template subtree, never the inherited outer namescope. WinUI's CControl::GetTemplateChild (core/core/elements/Control.cpp) searches the template namescope only.
  • Registration: both x:Name and FrameworkElement.Name= are registered in the namescope, in compiled XAML and in XamlReader. WinUI's parser treats DependencyObject_Name as the name directive. XamlReader now builds namescopes the same way compiled XAML does: one owned by the parsed root, and one per template materialization.

Adaptation for this stack position

Three tests assert that x:Name on a non-FrameworkElement is stored in FrameworkElement.NameProperty (When_XName_On_NonFrameworkElement_Then_Name_Property_Is_Set, When_Compiled_XName_On_NonFrameworkElement_Then_Name_Property_Is_Set, When_NameProperty_Set_On_DependencyObject_Then_No_AutomationId_Side_Effect). That storage comes from #25184, so test: Move DO Name storage tests to #25184 removes them here and #25184 restores them unchanged.

Deferred to #21129

  • Lookup order: WinUI's FindName is a namescope-only lookup (TryGetElementByName). Here the tree walk still runs first. The namescope owner model in refactor(namescope): Introduce the WinUI namescope owner model #24473 should land before that port.
  • Names set from code: they are not re-registered in the namescope, and nothing registers or unregisters on Enter/Leave.
  • Standalone ResourceDictionary files: names in compiled standalone files aren't registered. Names in a page's or UserControl's .Resources are.
  • Runtime plain Name=: in XamlReader, a plain Name= on a DependencyObject type with no Name property is still dropped.

Validation

  • Compile (strict, no fast-dev flag, net10.0): Uno.UI builds with 0 errors at this head.
  • Runtime (Skia Desktop, net10.0-desktop): at this level (previous restack, same commits), the 15 FindName tests that don't need DO Name storage passed. The three DO Name storage tests failed here as expected before the adaptation commit. At the fix: Declare Name on DependencyObject like WinUI #25184 head, all 18 FindName tests pass. At the fix(a11y): Use owning flyout name for presenter AutomationId #25308 head, 80/80 pass, including FindName, Given_DependencyObject_Name, Given_VisualStateManager, Given_MenuFlyout and the Flyout presenter AutomationId tests.

PR Checklist ✅

🤖 Generated with Claude Code

https://claude.ai/code/session_017TzDba3gSK3uYpvLmmBmaa

Copilot AI balanced review requested due to automatic review settings October 11, 2026 20:20

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.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@github-actions github-actions Bot added platform/wasm 🌐 Categorizes an issue or PR as relevant to the WebAssembly platform platform/android 🤖 Categorizes an issue or PR as relevant to the Android platform platform/macos 🍏 Categorizes an issue or PR as relevant to the macOS platform platform/ios 🍎 Categorizes an issue or PR as relevant to the iOS platform area/skia ✏️ Categorizes an issue or PR as relevant to Skia area/code-generation Categorizes an issue or PR as relevant to code generation area/build Categorizes an issue or PR as relevant to build infrastructure area/automation Categorizes an issue or PR as relevant to project automation kind/documentation labels Oct 11, 2026
@github-actions

github-actions Bot commented Oct 11, 2026 •

Copy link
Copy Markdown
Contributor

Claude finished @MartinZikmund's task in 24s —— View job


Review summary

I reviewed the FindName/namescope commits after 745a2dcd043: 8 commits, 15 files. The mobile-automation commits from #23935 are out of scope, and I did not build or run anything. This was a read of the diff only.

Verdict: fix-first, minor. The approach is sound, and the template-part lookups now stay inside the template subtree as intended. I left 2 inline comments, both medium severity.

  • The FindName fallback uses the inherited namescope. This conflicts with the "names don't cross scopes" claim and has no test.
  • The runtime LoadComponent path unregisters a name before re-registering it. That hides duplicate-name errors.

Cross-cutting:

  • FrameworkElement.Name= is now registered, but names set from code are not re-registered. This is listed under "Deferred" in the PR description, which is fine.
  • The commit messages follow Conventional Commits.
  • I found no skipped or ignored tests.


// WinUI's FindName is a lookup in the element's namescope, which also holds named non-FrameworkElement
// objects (Run, brushes, MenuFlyout...). Uno's tree walk runs first so its existing results are kept.
private object FindNameInNameScope(string name)

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.

NameScope.GetNameScope(this) resolves through the inherited/parent scope, so child.FindName("x") can now return an object from an outer page or template. That contradicts the PR's "names don't cross between scopes" claim, and the new fallback has no test for this case. Either add a test that pins the intended behaviour, or document that the fallback is deliberately inherited. Note this fallback only covers the element FindName was called on, while FindNameInSubtree is used for descendants, so the two lookups behave differently.

if (nameScope == _componentNameScope)
{
// LoadComponent re-registers the names the component's generated code already registered.
nameScope.UnregisterName(name);

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.

Unregistering before re-registering hides genuine duplicate names within the component's XAML. The generated code registered the name already, so a second x:Name with the same value in the runtime XAML silently replaces the first instead of reporting a duplicate (WinUI raises a parse error). Consider unregistering only when the existing entry is the same instance, or when it came from the compiled registration, and letting RegisterName throw otherwise.

Copilot AI balanced review requested due to automatic review settings October 11, 2026 20:49
@MartinZikmund
MartinZikmund force-pushed the dev/mazi/findname-namescope branch from 0dfdfc9 to 1643999 Compare October 11, 2026 20:49

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.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@unodevops

Copy link
Copy Markdown
Contributor

Copilot AI balanced review requested due to automatic review settings October 11, 2026 21:01
@MartinZikmund
MartinZikmund force-pushed the dev/mazi/findname-namescope branch from 1643999 to bc38c4d Compare October 11, 2026 21:01

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.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@MartinZikmund
MartinZikmund changed the base branch from master to 005-mobile-a11y-automation October 11, 2026 21:01
@github-actions

github-actions Bot commented Oct 11, 2026 •

Copy link
Copy Markdown
Contributor

Claude finished @MartinZikmund's task in 17s —— View job


Review summary (re-review after synchronize)

I re-read the FindName/namescope diff: the generator, FrameworkElement.Interface.cs, IFrameworkElement.cs, the template-part call sites and XamlObjectBuilder. The commits from #23935 are out of scope. I did not build or run anything, so this is by inspection only.

Verdict: fix-first, minor. Nothing new beyond the earlier review. No new inline comments, to avoid duplicates.

Still open from the earlier review (2 medium):

  • FrameworkElement.FindName falls back to NameScope.GetNameScope(this), which resolves through the inherited scope. That conflicts with "names don't cross scopes", and no test pins the behaviour. Either add a test or document that the fallback is deliberately inherited.
  • XamlObjectBuilder.TryRegisterName unregisters the name before re-registering in the component scope. That hides genuine duplicate-name errors. Unregister only when the existing entry is the same instance.

Checked, no issue found:

  • The FindNameInSubtree rewiring of the DescriptionPresenter/GetTemplateChild callers is behaviour-preserving for the old tree walk.
  • The generator's else if means an element with x:Name is not double-registered. An element with both x:Name and Name= is not diagnosed here. WinUI treats that as an error, so it may be worth a note.
  • The compiled and runtime paths register Name= consistently. Names inside resource dictionaries are skipped in compiled XAML. This is listed as deferred in the PR description.
  • Tests are not skipped or ignored. The three tests moved to fix: Declare Name on DependencyObject like WinUI #25184 are documented.

Not from this PR: the CodeQL GC.Collect() notes are in test files that come from the base PR #23935.

@unodevops

Copy link
Copy Markdown
Contributor

@unodevops

Copy link
Copy Markdown
Contributor

@nventive-devops

Copy link
Copy Markdown
Contributor

The build 238968 found UI Test snapshots differences: skia-linux-screenshots: 118, skia-windows-screenshots: 2458

Details
  • skia-linux-screenshots: 118 changed over 2458

    🚨🚨 Comparison Details (first 20) 🚨🚨
    • ButtonClippingTestsControl.png-dark
    • ButtonClippingTestsControl.png
    • Buttons.png-dark
    • Buttons.png
    • CalendarView_Theming.png-dark
    • CalendarView_Theming.png
    • ClipboardTests.png-dark
    • DisplayInformation.png-dark
    • DropDownButtonPage.png-dark
    • CompositionEffectBrush.png-dark
    • CompositionEffectBrush.png
    • CompositionNineGridBrush_Source_Changes.png-dark
    • CompositionNineGridBrush_Source_Changes.png
    • DoubleImageBrushInList.png-dark
    • DoubleImageBrushInList.png
    • Focus_FocusVisual_Properties.png-dark
    • Focus_FocusVisual_Properties.png
    • ImageBrushAlignmentXY.png-dark
    • ImageBrushAlignmentXY.png
    • ElementLevelTheme.png-dark
  • skia-windows-screenshots: 2458 changed over 2488

    🚨🚨 Comparison Details (first 20) 🚨🚨
    • AppBarButtonTest.png-dark
    • AppBarButtonTest.png
    • AppBarButtonWithIconTest.png-dark
    • AppBarButtonWithIconTest.png
    • ApplicationViewMode.png-dark
    • Application_DispatcherShutdownMode.png
    • AppWindowPresenters.png
    • ArcSegment.png
    • AuthenticationBroker_Cancel.png
    • AuthenticationBroker_Demo.png-dark
    • AutomationProperties_Name.png-dark
    • AutomationProperties_Name.png
    • AutoSizedTopLeft.png-dark
    • AutoSizedTopLeft.png
    • AutoSuggestBox_Reason.png
    • AutoSuggestBox_SoftKeboard.png-dark
    • Basics.png-dark
    • Basics.png
    • BindableDrawerLayout_ChangePane.png-dark
    • BindableDrawerLayout_ChangePane.png

Base automatically changed from 005-mobile-a11y-automation to master October 12, 2026 06:30
@MartinZikmund
MartinZikmund force-pushed the dev/mazi/findname-namescope branch from bc38c4d to c46ee0e Compare October 12, 2026 06:30
@github-actions

github-actions Bot commented Oct 12, 2026 •

Copy link
Copy Markdown
Contributor

Claude finished @MartinZikmund's task in 14s —— View job


Review summary (re-review after synchronize)

I read the diff for the generator registration, FrameworkElement.Interface.cs, IFrameworkElement.cs and XamlObjectBuilder. The #23935 commits are out of scope. I did not build or run anything, so this is by inspection only.

Verdict: fix-first, minor. This push adds nothing new. I posted no new inline comments, so the existing ones stay the only ones.

Still open (2 medium, both already commented inline):

  • The FindName fallback uses NameScope.GetNameScope(this), which resolves through the inherited scope. That conflicts with "names don't cross scopes", and no test pins the behaviour.
  • XamlObjectBuilder.TryRegisterName unregisters the name before re-registering it in the component scope. That hides genuine duplicate-name errors.

Cross-cutting:

  • If an element has both x:Name and Name=, the generator's else if registers only x:Name. WinUI reports an error for this case. Consider a diagnostic or a test.
  • The Conventional Commits and test-coverage rules are met. I found no skipped or ignored tests.
  • The CodeQL GC.Collect() notes are in test files that come from the base PR feat(a11y): add mobile automation support #23935, not this PR.
  • The screenshot-compare differences (Skia Linux and Windows) are very broad. They are unlikely to come from a namescope change, so compare them against the base PR's results before merging.

@unodevops

Copy link
Copy Markdown
Contributor

@nventive-devops

Copy link
Copy Markdown
Contributor

The build 239014 found UI Test snapshots differences: skia-linux-screenshots: 118, skia-windows-screenshots: 2458

Details
  • skia-linux-screenshots: 118 changed over 2458

    🚨🚨 Comparison Details (first 20) 🚨🚨
    • ButtonClippingTestsControl.png-dark
    • ButtonClippingTestsControl.png
    • Buttons.png-dark
    • Buttons.png
    • ClipboardTests.png-dark
    • CompositionEffectBrush.png-dark
    • CompositionEffectBrush.png
    • CompositionNineGridBrush_Source_Changes.png-dark
    • CompositionNineGridBrush_Source_Changes.png
    • CalendarView_Theming.png-dark
    • CalendarView_Theming.png
    • DisplayInformation.png-dark
    • ElementLevelTheme.png-dark
    • ElementLevelTheme.png
    • DynamicFont.png-dark
    • DynamicFont.png
    • Examples.png
    • Focus_FocusVisual_Properties.png-dark
    • Focus_FocusVisual_Properties.png
    • ImageBrushAlignmentXY.png-dark
  • skia-windows-screenshots: 2458 changed over 2488

    🚨🚨 Comparison Details (first 20) 🚨🚨
    • AndroidWindowInsets.png
    • AnimatedVisualsTestbedPage.png-dark
    • AppBar_KeyBoard.png-dark
    • Application_DispatcherShutdownMode.png
    • AppWindowTitleBar Properties.png-dark
    • Attributed_text_FontSize_Changing.png-dark
    • AuthenticationBroker_Demo.png-dark
    • AutoBorderStretchwithtopmargin.png
    • AutomationProperties_Name.png-dark
    • AutomationProperties_Name.png
    • AutoSuggestBox_BitmapIcon.png-dark
    • AutoSuggestBox_BitmapIcon.png
    • BasicAutoSuggestBox.png-dark
    • BasicAutoSuggestBox.png
    • Battery.png-dark
    • Battery.png
    • BindableDrawerLayout_ChangePane.png-dark
    • BindableDrawerLayout_ChangePane.png
    • BorderCenteredwithmargins.png-dark
    • BorderCenteredwithmargins.png

@morning4coffe-dev morning4coffe-dev left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Verified by reading the diff at head c46ee0e against WinUI sources (dxaml/xcp/core/dll/xcpcore_namescope.cpp GetAdjustedReferenceObjectAndNamescopeType, dxaml/xcp/core/core/elements/Control.cpp CControl::GetTemplateChild, dxaml/xcp/core/Parser/XamlProperty.cpp for the DependencyObject_Name directive). The Name= directive on FrameworkElement, the template-part subtree lookups, and the per-XamlReader-load and per-template namescope ownership all match WinUI. Uno's IXNameProvider covers only TextElement/VisualState/VisualStateGroup, so the new generator branch is reached only for FrameworkElement Name= and does not overlap the x:Name path. Nothing was built or run by me. Reviewed by inspection only.

Findings, most severe first:

  1. Medium, namescope leak through public FindName (src/Uno.UI/UI/Xaml/FrameworkElement.Interface.cs:35,39-40). NameScope.NameScopeProperty is registered with FrameworkPropertyMetadataOptions.Inherits (NameScope.cs), so NameScope.GetNameScope(this) resolves through ancestors. Any element in a template or subtree that has no namescope of its own (for example a ControlTemplate built in C#, or elements under such a root) will now return names from the outer page's namescope from public FindName. WinUI resolves a templated member through its TemplatedParent's template namescope and returns null for outer names. The XAML-loaded template path is covered by When_Live_ControlTemplate_Then_Names_Do_Not_Cross_Scopes, but nothing covers the code-built case, and the PR body's "names don't cross scopes" claim is not true for it. Either add a test for that case or narrow the fallback and document the gap.

  2. Low/medium, duplicate-name errors are masked (src/Uno.UI/UI/Xaml/Markup/Reader/XamlObjectBuilder.cs:501-507). For the component scope, the code unregisters the name and then re-registers it. NameScope.RegisterName only logs a warning on duplicates, so genuine duplicates in LoadComponent disappear. Suggested change: when nameScope.FindName(name) already returns the same instance, skip the register; otherwise register so a real duplicate still warns. This removes the need for the unregister.

  3. Low, the generator Name= branch skips validation (src/SourceGenerators/Uno.UI.SourceGenerators/XamlGenerator/XamlFileGenerator.cs:3540-3549). The new else if registers value without ValidateName(...), unlike the x:Name branch above it. Invalid identifiers then fail in the generated __that.{value} code instead of as a XamlGenerationException. This predates the PR for the field path, but the new registration is the first place the value goes into the namescope unchecked. Suggest calling ValidateName for consistency.

  4. Open question, screenshot-compare results. Bot comments on this PR (builds 238968 and 239014) report 118 changed on skia-linux and 2458 changed on skia-windows. The checklist box for screenshot validation is still unchecked. A namescope-only change should not produce that many rendering diffs, so please confirm they come from the base (#23935) or from CI noise before this merges.

  5. Open question, validation at this head. The PR body cites runtime results at earlier stack heads (#25184 and #25308), and says Uno.UI compiles at this head. I did not find a runtime pass stated for c46ee0e itself. Please run the FindName and template-part tests (Given_FindName_NonFrameworkElement, plus Given_DependencyObject_Name and Given_VisualStateManager) at this head and say so.

Also note, not blocking: FindName still runs the tree walk first, so a same-named FrameworkElement in the tree still wins over the namescope entry. The PR documents this as deferred to #21129, so no change is needed here.

Items 1 to 3 match the open points from the earlier automated review on this PR. I have added the code-built template case and the masking detail.

MartinZikmund and others added 8 commits November 10, 2026 10:42
FindName falls back to the element's namescope when the tree walk finds
nothing, so named Runs, Hyperlinks, brushes and flyouts resolve as on WinUI.
Recursion stays a pure tree walk so names don't leak across scopes.
XamlReader now builds namescopes like compiled XAML: one owned by the
parsed root, and one per template materialization.

Part of #21129.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017TzDba3gSK3uYpvLmmBmaa
GetTemplateChild, its IFrameworkElement extension and the DescriptionPresenter/LightDismissLayer lookups now walk the control's own subtree only. The FindName namescope fallback reads the inherited NameScope, which for a control is its page's or outer template's scope, so a missing template part resolved to an unrelated element of the same name. WinUI's GetTemplateChild only searches the template namescope.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017TzDba3gSK3uYpvLmmBmaa
Replace the detached DataTemplate check with a live ControlTemplate: names must not cross between the page and template scopes, and GetTemplateChild must not return an outer element for a missing part.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017TzDba3gSK3uYpvLmmBmaa
FrameworkElement.Name is WinUI's DependencyObject_Name, which the parser treats as the name directive, so Name= is registered like x:Name. XamlReader already did; compiled XAML now matches.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017TzDba3gSK3uYpvLmmBmaa
NameScope is Uno-internal, so the WinAppSDK runtime-test build failed
with CS0103.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017TzDba3gSK3uYpvLmmBmaa
These assert x:Name storage on non-FrameworkElement objects, which
needs DependencyObject_Name from #25184.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017TzDba3gSK3uYpvLmmBmaa
@MartinZikmund
MartinZikmund force-pushed the dev/mazi/findname-namescope branch from c46ee0e to 80d4676 Compare November 10, 2026 10:00
Copilot AI balanced review requested due to automatic review settings November 10, 2026 10:00

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.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota.

An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing. Review the Copilot code review billing settings.

@github-actions

github-actions Bot commented Nov 10, 2026 •

Copy link
Copy Markdown
Contributor

Claude finished @MartinZikmund's task in 13s —— View job


Review summary (re-review after synchronize, by inspection only; nothing built or run)

Verdict: fix-first, minor. No new problems beyond the open points already raised. Three of them overlap with morning4coffe-dev's review.

Open (all previously raised):

  • Medium: The FindName fallback uses NameScope.GetNameScope(this) (FrameworkElement.Interface.cs:39). That property inherits, so a code-built template, or elements under a root with no namescope of their own, can see names from the outer page. This conflicts with the "names don't cross scopes" claim. Add a test for the code-built case, or narrow the fallback and document it.
  • Low/Medium: XamlObjectBuilder.TryRegisterName unregisters a name before re-registering it in the component scope. That hides genuine duplicates. Skip the registration when FindName(name) already returns the same instance, and let real duplicates warn.
  • Low: The new generator Name= branch (XamlFileGenerator.cs:3585) registers value without the ValidateName call that the x:Name branch makes. A bad identifier then fails in the generated code instead of raising a XamlGenerationException. Also, an element with both x:Name and Name= registers only x:Name. WinUI reports an error for that case.
  • Process:
    • Please state which runtime tests (Given_FindName_NonFrameworkElement, Given_VisualStateManager) ran at this exact head.
    • Please confirm the screenshot diffs (118 on Linux, 2458 on Windows) match the base PR's results. A namescope-only change shouldn't cause them.

Checked, no issue found: commit messages follow Conventional Commits, no tests are skipped or ignored, and the template-part lookups now stay inside the template subtree. The CodeQL GC.Collect() notes are in files from #23935, not this PR.

@unodevops

Copy link
Copy Markdown
Contributor

🤖 Your WebAssembly Sample App stage site is ready! Visit it here:

@nventive-devops

Copy link
Copy Markdown
Contributor

The build 245163 found UI Test snapshots differences: skia-linux-screenshots: 218, skia-windows-screenshots: 293

Details
  • skia-linux-screenshots: 218 changed over 2494

    🚨🚨 Comparison Details (first 20) 🚨🚨
    • ClipboardTests.png-dark
    • ClipboardTests.png
    • AnimatedVisualsTestbedPage.png-dark
    • BenchmarkDotNet.png-dark
    • BenchmarkDotNet.png
    • AutomationProperties_AutomationId.png-dark
    • AutomationProperties_AutomationId.png
    • Border_CornerRadius_Binding.png-dark
    • Border_CornerRadius_Binding.png
    • CalendarView_Theming.png-dark
    • CalendarView_Theming.png
    • CompositionPath.png-dark
    • CompositionPath.png
    • AnimatedBackVisualSourceSamplePage.png-dark
    • AnimatedVisualsTestbedPage.png
    • AutomationProperties_StructureAndProps.png-dark
    • AutomationProperties_StructureAndProps.png
    • Basics.png-dark
    • Basics.png
    • Border_CornerRadius_BorderThickness.png-dark
  • skia-windows-screenshots: 293 changed over 2494

    🚨🚨 Comparison Details (first 20) 🚨🚨
    • AnimatedVisualsTestbedPage.png
    • AnimatedBackVisualSourceSamplePage.png-dark
    • BenchmarkDotNet.png-dark
    • BenchmarkDotNet.png
    • AnimatedBackVisualSourceSamplePage.png
    • Basics.png-dark
    • Basics.png
    • ComboBox_MaxDropdownHeight.png-dark
    • ComboBox_MaxDropdownHeight.png
    • AutomationProperties_AutomationId.png
    • AutomationProperties_StructureAndProps.png-dark
    • AutomationProperties_StructureAndProps.png
    • BreadcrumbBarPage.png-dark
    • BreadcrumbBarPage.png
    • CompositionPath.png-dark
    • CompositionPath.png
    • AnimatedVisualsTestbedPage.png-dark
    • BasicAcrylicBrushTest2.png-dark
    • BasicAcrylicBrushTest2.png
    • CalendarView_Theming.png-dark

@morning4coffe-dev morning4coffe-dev left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I went over this again after the rebase onto master. As far as I can see, the points from my earlier review are still open: the inherited-scope fallback in FindName, the unregister that hides duplicate names, and the missing ValidateName for Name=. I also checked the runtime-name handling against WinUI's parser (XamlManagedTypeInfoProvider::GetRuntimeNameProperty always returns DependencyObject_Name) and left one new note on XamlReader below.

&& member.Value is string { Length: > 0 } name
&& instance is not MarkupExtension
&& (member.Member.DeclaringType == null
|| (TypeResolver.IsType(control.Type, member.Member.DeclaringType) && !TypeResolver.IsAttachedProperty(member))))

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

For a plain Name=, this matches any type with its own CLR Name property, so a POCO such as <local:Item Name="Home"/> gets registered in the namescope and becomes visible to FindName. In WinUI the runtime name property is always DependencyObject_Name (core/Parser/ManagedTypeInfoProvider.cpp / NativeTypeInfoProvider.cpp, GetRuntimeNameProperty), and the compiled path here already restricts it through IsFrameworkElementNameMember. Could we limit the non-x: case to instance is FrameworkElement and keep DeclaringType == null (x:Name) as it is? A small XamlReader test with a non-DO item that has a Name property, ideally with a duplicate value, would pin it down.

@mergify

mergify Bot commented Nov 10, 2026

Copy link
Copy Markdown
Contributor

Tick the box to add this pull request to the merge queue (same as @mergifyio queue). If it does not match the queue conditions yet, it enters the queue once it does.

  • Queue this pull request

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/build Categorizes an issue or PR as relevant to build infrastructure area/code-generation Categorizes an issue or PR as relevant to code generation area/skia ✏️ Categorizes an issue or PR as relevant to Skia kind/documentation platform/android 🤖 Categorizes an issue or PR as relevant to the Android platform platform/ios 🍎 Categorizes an issue or PR as relevant to the iOS platform platform/macos 🍏 Categorizes an issue or PR as relevant to the macOS platform 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.

5 participants