Skip to content

Fixed VerifyImageAspect_CenterWithImageSourceFromUri failure - #35945

Merged
kubaflo merged 3 commits into
dotnet:inflight/candidatefrom
Dhivya-SF4094:fix-VerifyImageAspect_CenterWithImageSourceFromUri
Jun 22, 2026
Merged

kubaflo merged 3 commits into
dotnet:inflight/candidatefrom
Dhivya-SF4094:fix-VerifyImageAspect_CenterWithImageSourceFromUri

Conversation

@Dhivya-SF4094

@Dhivya-SF4094 Dhivya-SF4094 commented Jun 16, 2026 •

Copy link
Copy Markdown
Contributor

Failed case

  • VerifyImageAspect_CenterWithImageSourceFromUri

Root Cause

  • PR #28465 changed the clip offset calculation in ContentPanel.UpdateClip from Content.ActualOffset to LayoutInformation.GetLayoutSlot(Content).
  • GetLayoutSlot returns the element's allocated layout slot, not its actual rendered position after WinUI applies alignment. For Aspect=Center (Stretch=None), when the image is larger than its allocated slot, WinUI centers the image, causing its actual position to shift outside the layout slot. As a result, the clip offset was calculated using an incorrect origin, clipping a large portion of the image.
  • Content.ActualOffset correctly represents the content's final position after layout and alignment, which is the coordinate space required for the composition clip offset calculation.

Fix Description

  • Updated ContentPanel.UpdateClip to use Content.ActualOffset instead of LayoutInformation.GetLayoutSlot(Content) when calculating the clip offset. This ensures the clip geometry is aligned with the content's actual rendered position, restoring correct clipping for centered oversized images while preserving the intended behavior for all layouts.
  • Also removed the unused Microsoft.UI.Xaml.Controls.Primitives import that was only required for LayoutInformation

@dotnet-policy-service dotnet-policy-service Bot added the partner/syncfusion Issues / PR's with Syncfusion collaboration label Jun 16, 2026
@kubaflo

kubaflo commented Jun 16, 2026

Copy link
Copy Markdown
Contributor

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 3 pipeline(s).

@kubaflo kubaflo 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.

Is it ready?

@vishnumenon2684

Copy link
Copy Markdown
Contributor

/azp run maui-pr-uitests,maui-pr-devicetests

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 2 pipeline(s).

@sheiksyedm
sheiksyedm marked this pull request as ready for review June 19, 2026 10:02
@kubaflo

This comment has been minimized.

@github-actions

This comment has been minimized.

@vishnumenon2684

Copy link
Copy Markdown
Contributor

/azp run maui-pr-uitests

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 1 pipeline(s).

@kubaflo

This comment has been minimized.

@github-actions

Copy link
Copy Markdown
Contributor

Tests Failure Analysis

@Dhivya-SF4094 — test-failure review results are available based on commit d77a22d.
To request a fresh review after new comments, commits, or CI runs, comment /review tests.

Overall Likely unrelated Failures 66 Platform windows

Test Failure Review: Likely unrelated - click to expand

Overall verdict: Likely unrelated

All 66 unique deduplicated failures are for controls, areas, and platforms not modified by this PR. The base branch (inflight/candidate) has five consecutive failed maui-pr builds, confirming that the Helix unit test failures pre-exist independently of this PR.

Failure Verdict Evidence
maui-pr — Windows Helix Unit Tests (Debug + Release) Likely unrelated Microsoft.Maui.UnitTests.dll work items failed on Helix; base branch shows 5 consecutive failed maui-pr builds on inflight/candidate (builds 1468335, 1466412, 1465196, 1465208, 1464365) — failure is pre-existing
maui-pr-uitests — Visual snapshot failures (Shadow, Entry, TabbedPage, RadioButton — 20 tests) Likely unrelated All VisualTestUtils.VisualTestFailedException for controls not touched by this PR; Shadow_SetRadius_Zero shows "0.54% difference" vs baseline; PR only updates VerifyImageAspect_* Windows snapshots and does not modify Shadow, Entry, TabbedPage, or RadioButton code or baselines
maui-pr-uitests — WebView app-unresponsive and timeouts (11 tests) Likely unrelated "The app became unresponsive and was force-terminated: App.AppState query did not complete" and System.TimeoutException: An Appium command did not complete within 45s across macOS WebView jobs; classic infrastructure/flakiness pattern; PR does not touch WebView
maui-pr-uitests — SafeArea fixture cascade (35+ tests, Android) Likely unrelated OneTimeSetUp: System.TimeoutException: SafeArea incorrectly applied when using ControlTemplate with ContentPresenter — single fixture setup failure causes all ValidateSafeAreaEdges_*, ValidateKeyboard*, ValidatePerEdge*, and ValidateOrientation* tests to cascade-fail; Android-only; PR does not change SafeArea code
maui-pr-uitests — Android / iOS / macOS: CollectionView, CarouselView, Shell, ListView Likely unrelated Failing checks span Android API 30, iOS vlatest, and macOS — platforms unaffected by this PR; PR changes are limited to Windows platform code (ContentPanel.cs) and two Windows UI test snapshot images

Recommended action

No test-failure action is needed. The failures are pre-existing baseline instability on inflight/candidate and known infrastructure flakiness. The PR can proceed through its normal code review for its Image-aspect-related Windows changes.

Evidence details

PR scope:

  • Changed files (3): src/Controls/tests/TestCases.WinUI.Tests/snapshots/windows/VerifyImageAspect_AspectFillWithImageSourceFromFontImage.png, src/Controls/tests/TestCases.WinUI.Tests/snapshots/windows/VerifyImageAspect_AspectFitWithImageSourceFromUri.png, src/Core/src/Platform/Windows/ContentPanel.cs
  • Labels: platform/windows, area-controls-image, partner/syncfusion
  • Target base: inflight/candidate

Build 1474942 (maui-pr): AzDO link — maui-pr definition 302, result: failed. Five most-recent base-branch builds for the same definition (1468335, 1466412, 1465196, 1465208, 1464365) all show failed/completed on refs/heads/inflight/candidate, confirming the Helix unit test failures are pre-existing. Failure log for the failing work item: https://helix.dot.net/api/2019-06-17/jobs/63b74e7c-5479-4eb8-868c-229791058981/workitems/Microsoft.Maui.UnitTests.dll/console

Build 1474959 (maui-pr-uitests): AzDO link — maui-pr-uitests definition 313, result: failed. 30 failed timeline records, 87 raw log failures, 66 unique deduplicated failures. Five most-recent base-branch builds for the same definition also show failed/completed, reinforcing that these failures are not introduced by this PR.

Limitations: AzDO authenticated access was not available; _apis/test/... enrichment was skipped. Helix aggregate data for maui-pr-uitests was not separately retrieved. Platform classification for all 66 failures is unknown because the gatherer could not map test records to specific platforms from anonymous log data alone. Device-test hidden failures via XHarness could not be independently verified.

@kubaflo
kubaflo merged commit a9800de into dotnet:inflight/candidate Jun 22, 2026
130 of 158 checks passed
@github-actions github-actions Bot added this to the .NET 10 SR9 milestone Jun 22, 2026
@PureWeen PureWeen mentioned this pull request Jul 7, 2026
@github-actions github-actions Bot locked and limited conversation to collaborators Jul 23, 2026
@sheiksyedm sheiksyedm added the community ✨ Community Contribution label Oct 1, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

area-controls-image Image control community ✨ Community Contribution partner/syncfusion Issues / PR's with Syncfusion collaboration platform/windows

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants