Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed DeferredContent parents order #15670

Merged

Conversation

MrJul
Copy link
Member

@MrJul MrJul commented May 9, 2024

What does the pull request do?

This PR fixes a bug where parent nodes for deferred content were reversed after #15070.
Unit tests have been added.

What is the current behavior?

Parent nodes were reversed for deferred content, effectively looking up the resources in the wrong order for StaticResource.
(Note that the bug doesn't manifest everywhere, as it depends on the exact hierarchy of deferred contents, which can be subtle.)

How was the solution implemented (if it's not obvious)?

IAvaloniaXamlIlEagerParentStackProvider had both implementations where DirectParents were in normal order (DeferredParentServiceProvider), and implementations where they were in stack order, reversed (XamlIlContext, generated by the XAML compiler).

With this PR, the parents are always in stack order, as this was expected by EagerParentStackEnumerator.

Breaking changes

I renamed IAvaloniaXamlIlEagerParentStackProvider.DirectParents to DirectParentsStack to make the expected order clearer (alongside documentation comments). Since this interface isn't supposed to be implemented by users and is new in 11.1-beta2, it isn't really part of the official public API yet. If that isn't acceptable, please let me know and I'll rename it back.

Fixed issues

@MrJul MrJul added area-xaml backport-candidate-11.1.x Consider this PR for backporting to 11.1 branch labels May 9, 2024
@MrJul MrJul mentioned this pull request May 9, 2024
@avaloniaui-bot
Copy link

You can test this PR using the following package version. 11.2.999-cibuild0048288-alpha. (feed url: https://nuget-feed-all.avaloniaui.net/v3/index.json) [PRBUILDID]

@maxkatz6 maxkatz6 merged commit 7ade4fa into AvaloniaUI:master May 10, 2024
10 checks passed
@MrJul MrJul deleted the fix/deferred-content-parents-order branch May 12, 2024 11:51
@maxkatz6 maxkatz6 added the bug label May 14, 2024
grokys pushed a commit that referenced this pull request Jun 3, 2024
@grokys grokys added backported-11.1.x and removed backport-candidate-11.1.x Consider this PR for backporting to 11.1 branch labels Jun 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

XAML fails to load (11.2)
4 participants