Fixed MaskedTextBoxAccessibleObject.Name if Owner.Mask is filled#7983
Merged
Tanya-Solyanik merged 1 commit intodotnet:mainfrom Oct 28, 2022
Conversation
b07058e to
d37ad4a
Compare
dmitrii-drobotov
previously approved these changes
Oct 21, 2022
Contributor
dmitrii-drobotov
left a comment
There was a problem hiding this comment.
Looks good, but I would add a comment to clarify the change
...System.Windows.Forms/src/System/Windows/Forms/MaskedTextBox.MaskedTextBoxAccessibleObject.cs
Show resolved
Hide resolved
...System.Windows.Forms/src/System/Windows/Forms/MaskedTextBox.MaskedTextBoxAccessibleObject.cs
Show resolved
Hide resolved
...System.Windows.Forms/src/System/Windows/Forms/MaskedTextBox.MaskedTextBoxAccessibleObject.cs
Show resolved
Hide resolved
...System.Windows.Forms/src/System/Windows/Forms/MaskedTextBox.MaskedTextBoxAccessibleObject.cs
Show resolved
Hide resolved
d37ad4a to
9ce9ec4
Compare
...System.Windows.Forms/src/System/Windows/Forms/MaskedTextBox.MaskedTextBoxAccessibleObject.cs
Outdated
Show resolved
Hide resolved
6fed3a2 to
27f0e6a
Compare
dmitrii-drobotov
previously approved these changes
Oct 25, 2022
| } | ||
|
|
||
| public Control Owner { get; } | ||
| public virtual Control Owner { get; } |
Contributor
There was a problem hiding this comment.
Sorry about stirring you into a wrong direction. This is a breaking change -
Adding virtual to a member
While this change would often work without breaking too many scenarios because C# compiler tends to emit callvirt IL instructions to call non-virtual methods (callvirt performs a null check, while a normal call won't), we can't rely on it. C# is not the only language we target and the C# compiler increasingly tries to optimize callvirt to a normal call whenever the target method is non-virtual and the this is provably not null (such as a method accessed through the ?. null propagation operator). Making a method virtual would mean that consumer code would often end up calling it non-virtually.
We could add a second property with the same content which would be internal virtual. But it's really best done in a separate PR.
Contributor
There was a problem hiding this comment.
Good call, @Tanya-Solyanik.
We should add a new internal property:
internal virtual Control OwnerInternal { get; }
Contributor
Author
There was a problem hiding this comment.
Reverted changes
27f0e6a to
44d4976
Compare
dmitrii-drobotov
approved these changes
Oct 26, 2022
Tanya-Solyanik
approved these changes
Oct 28, 2022
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #7938
Proposed changes
Nameproperty inMaskedTextBoxAccessibleObject.Customer Impact
NameofMaskedTextBoxAccessibleObjectis more clarify.Regression?
Risk
Screenshots
Before
After
Test methodology
Accessibility testing
Test environment(s)
.NET SDK:
Version: 8.0.100-alpha.1.22512.5
Commit: 1b80461e45
Runtime Environment:
OS Name: Windows
OS Version: 10.0.22621
OS Platform: Windows
Microsoft Reviewers: Open in CodeFlow