Skip to content

Conversation

@SamBent
Copy link
Contributor

@SamBent SamBent commented Dec 16, 2021

Addresses #4834
This is a port of a servicing fix in .NET 4.7-4.8.

Description

This hang arises when UseLayoutRounding is set, and the container's top margin is not a multiple of the rounding quantum. VSP uses two offsets from the viewport to the container, one that includes the margin and one that doesn't. It was computing the second and subtracting the margin to obtain the first, but that can give the wrong answer in the situation above. This can lead to infinite re-measures in anchored scrolls.

Fixed by computing the first offset directly from layout information. The two offsets will differ by an amount that is close to the margin size, and rounded to a quantum, but there's no way to know which of the nearby candidates is the right one.

Customer Impact

Hang while scrolling an ItemsControl.

Regression

no

Testing

Ad-hoc around customer scenario.
Standard regression testing.

Risk

Low. Port of a .NETFx servicing fix released earlier this year.

@SamBent SamBent requested a review from a team as a code owner December 16, 2021 02:28
@ghost ghost added the PR metadata: Label to tag PRs, to facilitate with triage label Dec 16, 2021
@ghost ghost requested review from fabiant3 and ryalanms December 16, 2021 02:28
@singhashish-wpf singhashish-wpf merged commit a30c4ed into dotnet:main Jan 19, 2022
dipeshmsft added a commit that referenced this pull request Feb 7, 2022
dipeshmsft added a commit that referenced this pull request Feb 7, 2022
dipeshmsft pushed a commit that referenced this pull request Feb 7, 2022
@ghost ghost locked as resolved and limited conversation to collaborators Apr 6, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

PR metadata: Label to tag PRs, to facilitate with triage

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants