Repository navigation
Conversation
|
🤖 Your WebAssembly Skia Sample App stage site is ready! Visit it here: https://unowasmprstaging.z20.web.core.windows.net/pr-23978/wasm-skia-net9/index.html |
|
🤖 Your Docs stage site is ready! Visit it here: https://unodocsprstaging.z13.web.core.windows.net/pr-23978/docs/index.html |
|
The build 225950 found UI Test snapshots differences: Details
|
|
|
|
🤖 Your WebAssembly Skia Sample App stage site is ready! Visit it here: https://unowasmprstaging.z20.web.core.windows.net/pr-23978/wasm-skia-net9/index.html |
|
🤖 Your Docs stage site is ready! Visit it here: https://unodocsprstaging.z13.web.core.windows.net/pr-23978/docs/index.html |
|
The build 226197 found UI Test snapshots differences: Details
|
|
|
|
|
|
The build 226280 found UI Test snapshots differences: Details
|
|
|
|
@Xiaoy312 there is a cspell issue |
|
🤖 Your WebAssembly Skia Sample App stage site is ready! Visit it here: https://unowasmprstaging.z20.web.core.windows.net/pr-23978/wasm-skia-net9/index.html |
|
🤖 Your Docs stage site is ready! Visit it here: https://unodocsprstaging.z13.web.core.windows.net/pr-23978/docs/index.html |
|
The build 226460 found UI Test snapshots differences: Details
|
|
@copilot resolve the merge conflicts in this pull request |
Head branch was pushed to by a user without write access
Fills the empty else-branch in XamlFileGenerator.RewriteUri so a relative URI on a Uri-typed property compiles to the MRT local-resource form WinUI produces (a raw `ms-resource:///Files/` concat, leading '/' trimmed), and keys the ms-appx special case on the property type - measured on WinAppSDK 1.7 for both application and library XAML: - property typed ImageSource (Image.Source, ImageBrush.ImageSource, a custom control's ImageSource DP) and BitmapImage.UriSource resolve against the base URI, so ImageBrush and custom ImageSource properties no longer fall through to the verbatim branch - every other Uri-typed property (custom Uri DPs, Hyperlink[Button].NavigateUri, BitmapIcon/BitmapIconSource.UriSource, WebView2.Source) takes the ms-resource form ImageSource resolution now maps `ms-resource:///Files/X` to `ms-appx:///X`, the equivalent of MRT's Files subtree, so relative-URI BitmapIcon/BitmapIconSource keep loading the same asset they load today - the value changes, the behavior does not. ResourceDictionary.Source is untouched; it resolves through RetrieveDictionaryForSource, not RewriteUri. The owner-type check that used to carry the special case alone is kept beside the new one, and is what holds SvgImageSource.UriSource on the ms-appx form where WinUI emits ms-resource: the ms-resource form cannot carry the assembly prefix a library's svg assets are resolved through. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Documents the compiled-value change for relative URIs on Uri-typed properties, that images keep resolving through the ms-resource -> ms-appx mapping, and the deliberate SvgImageSource divergence. Checks BC51 off the rollup spec with the recorded decision and the WinUI measurements behind it. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
FrameworkPropertyMetadata is Uno-only surface (the one other use in this project sits behind #if HAS_UNO), so the test helper registers with PropertyMetadata instead - it never needed framework metadata options. Excludes from the native WinUI head every test that asserts an ms-appx value or Uno's ms-resource -> ms-appx mapping, which has no WinUI analog and would otherwise depend on how a library-contributed asset lands in the merged PRI. Only the Uri-typed value assertions still run there, since those were the ones measured against WinUI. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Review found the ms-resource -> ms-appx mapping only covered the ImageSource conversion, so a UriSource assigned directly - by the BitmapImage ctor, x:Bind, a Style Setter for a Uri-typed property, or code-behind - reached the Skia loader unmapped. It reads the UriSource property rather than the normalized AbsoluteUri, and an ms-resource URI is absolute, so it cleared the guard and then fell through to a network fetch instead of failing loudly. Maps at that read and in LoadedImageSurface, the two places a raw URI is consumed. When_Local_Resource_On_UriSource_Loads covers it: it times out waiting for a non-zero ActualHeight without the mapping, which also shows the loading assertions discriminate rather than measuring template size. Adds a loading test for a library asset on an ImageSource-typed property, where the assembly prefix is what makes it resolve. NormalizeLocalResourceUri now traces the original/resolved pair at Debug, since the value read back from the property is not the one being resolved, and stays total when the remainder is not a valid URI (its callers are non-throwing). The migration note claimed only readback changed. It also documents that a relative value is now absolute at the point of use (WebView2.Source stops throwing and silently navigates nowhere, a scheme-less NavigateUri reaches the launcher as an unregistered scheme, a relative DefaultStyleResourceUri no longer throws), and that in a library the two property kinds resolve differently - the assembly prefix on ImageSource, the app root on Uri. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
A path is free to contain a backslash, which the emitted regular string literal read as an escape sequence - `ImageSource="Assets\x.png"` dropped the generated file altogether. Both branches now go through one verbatim-literal helper. NormalizeLocalResourceUri matches the parsed scheme and path instead of the original string, so a leading whitespace or an upper-cased scheme the Uri parser accepted resolves as well, and it keeps the query the way the neighbouring TryGetMsAppxAssetPath does. Drops the mapping in the Uri conversion operator: every UriSource assignment reaches InitFromUri through OnUriSourceChanged, which already maps the value on all targets. A converted ImageSource therefore reports the URI it was given, the way WinUI reports a Uri-typed property. Covers the cases the first round left untested: a rooted path on an ImageSource property, SvgImageSource in the generator golden, a backslash in a path, the value a converted ImageSource reports, and BitmapIconSource, whose value is copied to a BitmapIcon through a binding. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
CA1845 is an error on the net10.0/net11.0 heads, but the span overload does not exist on netstandard2.0, where this shared file also compiles into Uno.UI.SourceGenerators. The generator never calls this method, so scope it to the runtime heads. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
The existing exclusion covered only the FrameBuffer job, so the X11 job still hung to its 60-minute limit on a TCS that is never completed. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
The Win32 launcher extension called process.Start() unguarded, so an unlaunchable URI threw Win32Exception into HyperlinkButton.OnClick - async void with no try/catch - terminating the process on a click. The sibling fallback in Launcher.skia.cs has always been wrapped. Measured on WinAppSDK 1.7: Launcher.LaunchUriAsync never throws and returns true for ms-resource, ms-appx and unregistered schemes alike; the shell takes the request and discards it quietly. Match that. BC51 makes this reachable on every click rather than occasionally, since a relative NavigateUri now compiles to an ms-resource URI that is never registered, where a relative path could previously resolve against the working directory. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
The rollup claimed the compiled value changes and the behavior does not, which the migration note contradicts two files away: a relative value is now absolute at the point of use, and in a library the two property kinds resolve against different roots. Records the WinAppSDK 1.7 measurement behind the first one - WinUI's launcher is equally unable to service the emitted URI - so the silent failure reads as parity rather than an unexplained regression. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
An ms-resource URI outside the Files/ subtree was returned untouched and then resolved to no asset, with nothing raised and nothing logged unless the app had subscribed to ImageFailed. Only an ms-resource URI reaches that branch, so the warning cannot fire for the ms-appx values every other load goes through. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
A Setter resolves its property type from the style's target type, not from the syntactic owner, so the rewrite could have keyed differently there than inline. It does not: an ImageSource-typed property lands on the base URI and a Uri-typed one on the local-resource form, matching the inline golden for the same four properties. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
BitmapIcon.UriSource registers no changed callback - the value reaches the image through the binding its constructor sets up, and the mapping happens a layer later when the converted ImageSource initializes. Only the compiled-XAML route was covered, so the route a Setter, x:Bind or code-behind assignment takes had nothing pinning it. Verified to discriminate: with the mapping disabled the new test fails along with five others in this class. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Three findings this pass did not survive verification: a generator emission claim contradicted by its own golden, a crash attributed to the diff that the pre-change value reached identically, and a cross-branch CI comparison confounded by differing SDKs. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
`LocalResourcePrefix` / `LocalResourceFolder` / `NormalizeLocalResourceUri` all mean `ms-resource:///Files/`, three lines from `UriExtensions.IsLocalResource`, which means `ms-appx`. Name them for the scheme they actually match. Identifiers only - the emitted `ms-resource:///Files/` literal is unchanged, so the generator goldens are untouched. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
`Uri.Scheme` throws `InvalidOperationException` on a relative URI, so `IsAppData` threw where the neighbouring `IsLocalResource` - which carries the `IsAbsoluteUri &&` guard - returns false. Apply the same guard. Defensive hardening: no known caller reaches it with a relative URI today. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
The mapping read `PathAndQuery`, which drops both the authority and the fragment: - `ms-resource://OtherPkg/Files/x.png` mapped to `ms-appx:///x.png` and so resolved the *app's* asset of that name - a wrong asset, not a missing one. It now stays untouched and warns. - `ms-resource:///Files/icon.svg#layer1` lost `#layer1`, which `SvgImageSource` resolves against. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
`Uri.IsLocalResource()` tests for the `ms-appx` scheme, but sat three lines from the `ms-resource:///Files/` helpers on the other end of the same mapping - one name for two opposite things. Renamed to say what it matches, with all 11 call sites updated. No forwarding shim; this is the breaking-changes branch. Registered in PackageDiffIgnore, with the migration note and the BC51 spec entry. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
The ms-resource -> ms-appx mapping had no direct test; the runtime tests reach it only through image loading. Covers the folder/scheme casing the comments assert, the fragment and foreign-package cases just fixed, query and percent-escape survival, and TryGetMsAppxAssetPath. Discriminating: with the mapping neutered, 8 of the 21 rows fail. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Probed SvgImageSource on native WinUI (WinAppSDK 1.7), which the original BC51 measurements never covered. Two results: - WinUI does compile SvgImageSource.UriSource to ms-resource, as the carve-out comment claimed without evidence. - It also compiles `Image.Source="x.svg"` to ms-resource. So the deciding factor is the object the value lands in, not the property type - an ImageSource-typed property is not uniformly file-relative. Uno keeps svg on ms-appx. The old justification - that ms-resource "cannot carry the assembly prefix" - is wrong: an assembly-qualified ms-resource is emitted for ResourceDictionary.Source. The real discriminator is how the sink resolves the form, which is what decides the next carve-out. Also corrects the affected-property list, which omitted the sinks that were never asset-resolving, and names the assembly-root vs XAML-folder base URI divergence instead of implying parity. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
bff1385 to
04fb866
Compare
|
Rebased onto Two of this PR's files were folded away on the base, so their hunks were hand-applied to the merged files:
The other conflicts were append-vs-append in Re-verified locally after the rebase: |
|
🤖 Your Docs stage site is ready! Visit it here: https://unodocsprstaging.z13.web.core.windows.net/pr-23978/docs/index.html |
|
🤖 Your WebAssembly Skia Sample App stage site is ready! Visit it here: https://unowasmprstaging.z20.web.core.windows.net/pr-23978/wasm-skia-net9/index.html |
|
The build 227017 found UI Test snapshots differences: Details
|
|
Tick the box to add this pull request to the merge queue (same as
|
…orm#23978/unoplatform#23660 Fold BitmapImage, BitmapSource, RenderTargetBitmap, SvgImageSource, WriteableBitmap and LoadedImageSurface's resurrected .skia.cs partials back into their base .cs files, matching master's single-file layout while keeping the branch's neutral CompositionImageSurface/ITexture types. Also restore the IsMsAppx/NormalizeMsResourceFilesUri call in LoadedImageSurface.StartLoadFromUri that unoplatform#23978 added and the merge dropped (BitmapImage/BitmapSource already had it). RenderTargetBitmap keeps the branch's CPU-raster RenderOffscreen/SnapshotAsync path rather than porting master's GRContext-based async picture-replay, since that mechanism is Skia/GRContext-specific and can't exist in SkiaSharp-free Uno.UI; see report for follow-up. Co-Authored-By: Claude Sonnet 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01XsQppKuZgijApgJxaTZt81
GitHub Issue: Part of #8339
PR Type:
✨ Feature
What changed? 🚀
BC51 of the 7.0 rollup: a relative URI in XAML now compiles to the MRT local-resource form
WinUI produces (
ms-resource:///Files/…) instead of being emitted verbatim. This fills theelsebranch that has carried a// Breaking change … (#8339)placeholder inXamlFileGenerator.RewriteUrisince that issue was filed.Expected values were measured on native WinUI (WinAppSDK 1.7) with a self-contained
unpackaged probe app, for both application and library XAML, rather than inferred:
BitmapImage—BitmapImage.UriSource, or anImageSource-typed property (Image.Source,ImageBrush.ImageSource, custom DP) given a non-svg pathms-appx:///+ file-relative baseSvgImageSource— includingImage.Source="x.svg"ms-resource:///Files/<raw>Uri-typed property —BitmapIcon/BitmapIconSource.UriSource,NavigateUri,WebView2.Source, customUriDPsms-resource:///Files/<raw>Two properties of that rewrite drove the implementation:
ms-appxspecial case is not keyed on the owner type. Uno keyed it on the owner,which was wrong in both directions —
ImageBrush.ImageSourceand a customImageSourceDPfell through to the verbatim branch, while a
Uri-typed property on anImageSource-derivedowner took the
ms-appxbranch. Uno now keys on the property type.ms-resourcerewrite is a raw prefix concat, dropping a leading/and ignoring thefolder of the XAML file — with no assembly prefix, even in a library.
ResourceDictionary.Sourceis untouched — it resolves throughRetrieveDictionaryForSource,not
RewriteUri.The svg carve-out is a deliberate divergence
Uno keeps every
ImageSource-typed property on thems-appxform, svg included. WinUI doesnot, as the table above shows — that row was probed for this PR and had never been measured
before.
The discriminator is how the sink resolves the form, not what the form can express.
ms-appxis resolved as an asset path, so it carries the assembly prefix a library's own assetsneed;
ms-resourceis understood only by Uno's mapping, which resolves against the app root.Following WinUI here would leave a library's svg assets unreachable, with no MRT to fall back
on. (An assembly-qualified
ms-resourceis emitted forResourceDictionary.Source, becausedictionary resolution is a registry string-key lookup rather than asset resolution — so the form
itself is not the constraint. An earlier version of this PR justified the carve-out with exactly
that mistaken claim.)
Keeping images loading
ms-resource:///Files/Xis mapped toms-appx:///X— the equivalent of MRT'sFilessubtree —so relative-URI
BitmapIcon/BitmapIconSourcekeep loading the same asset they load today.The value changes; the behavior does not.
The mapping sits where a URI is consumed, not only in the
ImageSourceconversion:ImageSource.InitFromUri(which everyUriSourceassignment reaches throughOnUriSourceChanged, on every target), theBitmapImageSkia loader (the one place a raw DPvalue is read), and
LoadedImageSurface.StartLoadFromUri. AUriSourceassigned directly —ctor,
x:Bind, aSetter, code-behind — therefore resolves too, while still reporting the URIit was given, the way WinUI reports a
Uri-typed property.The mapping preserves the fragment (load-bearing for
SvgImageSource) and rejects a non-emptyauthority:
ms-resource://OtherPkg/Files/x.pngnames another package's resources, whichms-appxcannot reach, so mapping it would silently resolve the app's asset of the same name.An unmappable
ms-resourceURI now warns rather than failing silently.Also in this PR
ms-appxbranch emitted a regular string literal,so
ImageSource="Assets\x.png"had\xread as an escape and dropped the generated fileentirely. Both branches now emit verbatim literals.
UriExtensions.IsLocalResource→IsMsAppx(source-breaking). The old name said "localresource" but the predicate tests for
ms-appx— the opposite end of this very mapping. Theinternal helpers were renamed to match (
MsResourceFilesPrefix,NormalizeMsResourceFilesUri).UriExtensions.IsAppDataguarded against a relative URI — it readuri.Schemebehind onlya null check, where the neighbouring predicate correctly guards
IsAbsoluteUri &&.Defensive hardening; no known caller reaches it.
Launcheron Skia reports launch failures the way WinUI does. Measured on WinAppSDK 1.7:LaunchUriAsyncreturnstruewithout launching anything forms-resource,ms-appxandunregistered schemes alike. Uno's Win32 extension let a
ShellExecutefailure escape intoHyperlinkButton.OnClick, which isasync void.build/PackageDiffIgnore.xmldoes carry an entry for this PR — theIsLocalResourceremoval. Nothing else publicly visible is removed or retyped;
XamlFilePathHelperis internal.Validation
Per
debugging-discipline.md, labelled by evidence type. All local evidence is Skia desktop,net10.0 —
net11.0is not buildable on this SDK and is left to CI.OnUriSourceChanged → InitFromUricovers all platforms, which is why the conversion operatordoes not map (it would only change the value a caller reads back).
-p:UnoFastDevBuild=false -p:OptimizeImplicitlyTriggeredBuild=false):Uno.UI.Skia,Uno.UI.Reference,Uno.Skia,Uno.Foundation.Skiaand the netstandard2.0Uno.UI.SourceGenerators— 0 errors, 0 warnings. The generator matters separately: itcompiles
XamlFilePathHelper.shared.cstoo, where the span-basedstring.Concatoverload doesnot exist.
Given_RelativeUrigolden locks the emitted shape for every property kind, including a rootedpath, a backslash,
SvgImageSource, and theSetterpath (which reaches the rewrite throughthe style's target type rather than the syntactic owner).
Given_XamlFilePathHelper→ 21/21, covering scheme/foldercasing, query and percent-escape survival, the fragment and foreign-package cases, and
TryGetMsAppxAssetPath.Given_RelativeUriRewrite→ 11/11, 0 inconclusive, plusGiven_BitmapSource→ 15 passed / 1 pre-existing skip. Value assertions measured against WinUIrun on the WinUI head too; the
ms-appx-value and mapping assertions are excluded there, sinceMRT resolves the local-resource URI natively.
the only proof that half of the fix does anything;
ImageSource→ 4 of the 6 tests that existed at that point fail(the 2 that pass are intentional regression guards);
BitmapImageSkia loader line →When_Local_Resource_On_UriSource_Loadstimes out (which also proves
ActualHeight > 0is a real load signal, not a template-sizeproxy);
MainPagefile disappears from thecompilation;
BitmapIconSourceat a missing asset → its load test fails.Not validated locally: the WinUI head, WASM, native Android/iOS, and hot reload — left to CI.
Six of the eleven
IsMsAppxcall sites (mobile, WASM, macOS, AddIns) are not compiled by anyproject buildable here; their completeness proof is a repo-wide zero-hit grep for the old name
across every text format, and the mobile/WASM/macOS CI legs are the real check. The
PackageDiffIgnoreentry is likewise CI-gated.PR Checklist ✅
Screenshots Compare Test Runresults.Breaking change impact and migration path
This changes the compiled value of a relative URI, so it is a breaking change — intentional,
scoped to the 7.0 major, and toward WinUI parity. Documented in
migrating-to-uno-7.md. Four impacts:WebView2.Sourcewith a relativevalue used to throw
ArgumentExceptionwhile the page initialized; it now navigates anms-resource:URI no web view can service, so the failure is silent instead of loud. Ascheme-less
NavigateUri(www.example.com) becomesms-resource:///Files/www.example.comand reaches the launcher as an unregistered scheme, and a relative
Control.DefaultStyleResourceUrino longer throws while resolving.Migration: give these properties absolute URIs —
https://…,ms-appx:///….Measured on WinAppSDK 1.7,
Launcher.LaunchUriAsyncreturnstruewithout launchinganything for
ms-resourceandms-appxalike, so a relativeNavigateUriis equally inerton WinUI — the silent failure is parity, but it is quieter than the exception Uno used to
raise.
ImageSource-typedproperty the value now carries the library's assembly prefix (
ms-appx:///MyLib/Assets/x.png),so a library's own assets resolve — but a library asset that previously resolved from the
consuming app's root no longer does. On a
Uri-typed property thems-resourceform ismapped against the app root, so it does not. Migration: a library shipping assets for
BitmapIconmust use an explicitms-appx:///MyLib/…URI.ImageBrush.ImageSourceand customImageSourceproperties previously kept the relativestring and now resolve against the base URI, consistent with
Image.Source.UriExtensions.IsLocalResourceis renamed toIsMsAppx(source-breaking, no forwardingshim). Same behavior. Migration: rename the call.
Images declared in application XAML keep loading the same asset. To keep any value verbatim,
write it as an explicit
ms-appx:///…URI in XAML.Known divergence left open
Uno resolves the
ms-appxform against the assembly root; WinUI resolves it against theXAML file's folder.
Assets/logo.pnginViews/MainPage.xamlisms-appx:///Assets/logo.pnghere andms-appx:///Views/Assets/logo.pngon WinUI. This predatesBC51 and is unchanged by it, but it is a real behavior gap and is now named in the migration
note; it needs its own BC entry, since fixing it changes compiled values again.