Properly initialize XamlUiaTextRange with ProviderFromPeer#11501
Merged
4 commits merged intomainfrom Oct 13, 2021
Merged
Conversation
DHowett
requested changes
Oct 13, 2021
DHowett
reviewed
Oct 13, 2021
DHowett
approved these changes
Oct 13, 2021
Member
|
Fix the build (and maybe the comment i guess) 😄 and we can merge it! /cc @PankajBhojwani as release engineer- this is going to merge soon and must be picked over to 1.11. |
carlos-zamora
commented
Oct 13, 2021
Member
Author
|
@msftbot merge this in 5 minutes |
|
Hello @carlos-zamora! Because you've given me some instructions on how to help merge this pull request, I'll be modifying my merge approach. Here's how I understand your requirements for merging this pull request:
If this doesn't seem right to you, you can tell me to cancel these instructions and use the auto-merge policy that has been configured for this repository. Try telling me "forget everything I just told you". |
PankajBhojwani
pushed a commit
that referenced
this pull request
Oct 13, 2021
## Summary of the Pull Request As a part of the Interactivity split, `TermControlAutomationPeer` had to be split into `TermControlAutomationPeer` (TCAP) and `InteractivityAutomationPeer` (IAP). Just about all of the functions in `InterativityAutomationPeer` operate by calling the non-XAML UIA Provider then wrapping the resulting `UIATextRange` into a XAML format (a `XamlUiaTextRange` [XUTR]). As a part of that XUTR constructor, we need a reference to the parent provider. We generally get that via `ProviderFromPeer()`, but IAP's `ProviderFromPeer()` returned null (presumably because IAP isn't in the UI tree, whereas TCAP is directly registered as the automation peer for the `TermControl`). It looks like some screen readers didn't care (like NVDA, though there may be a chance we just didn't encounter an issue just yet), but Narrator definitely did. The fix was to provide XUTR constructors the `ProviderFromPeer` from TCAP, _not_ IAP. To accomplish this, IAP now holds a weak reference to TCAP, and provides the `ProviderFromPeer` when needed. We can't cache this result because there is no guarantee that it won't change. Some miscellaneous changes include: - `TermControl::OnCreateAutomationPeer` now returns the existing auto peer instead of always creating a new one - `TCAP::WrapArrayOfTextRangeProviders` was removed as it was unused (normally, this would be directly affected by the main `ProviderFromPeer` change here) - `XUTR::GetEnclosingElement` is now hooked up to trace logging for debugging purposes ## References Introduced in #10051 Closes #11488 ## Validation Steps Performed ✅ Narrator scan mode now works (verified with character, word, and line navigation) ✅ NVDA movement still works (verified with word and line navigation)
PankajBhojwani
pushed a commit
that referenced
this pull request
Oct 15, 2021
## Summary of the Pull Request As a part of the Interactivity split, `TermControlAutomationPeer` had to be split into `TermControlAutomationPeer` (TCAP) and `InteractivityAutomationPeer` (IAP). Just about all of the functions in `InterativityAutomationPeer` operate by calling the non-XAML UIA Provider then wrapping the resulting `UIATextRange` into a XAML format (a `XamlUiaTextRange` [XUTR]). As a part of that XUTR constructor, we need a reference to the parent provider. We generally get that via `ProviderFromPeer()`, but IAP's `ProviderFromPeer()` returned null (presumably because IAP isn't in the UI tree, whereas TCAP is directly registered as the automation peer for the `TermControl`). It looks like some screen readers didn't care (like NVDA, though there may be a chance we just didn't encounter an issue just yet), but Narrator definitely did. The fix was to provide XUTR constructors the `ProviderFromPeer` from TCAP, _not_ IAP. To accomplish this, IAP now holds a weak reference to TCAP, and provides the `ProviderFromPeer` when needed. We can't cache this result because there is no guarantee that it won't change. Some miscellaneous changes include: - `TermControl::OnCreateAutomationPeer` now returns the existing auto peer instead of always creating a new one - `TCAP::WrapArrayOfTextRangeProviders` was removed as it was unused (normally, this would be directly affected by the main `ProviderFromPeer` change here) - `XUTR::GetEnclosingElement` is now hooked up to trace logging for debugging purposes ## References Introduced in #10051 Closes #11488 ## Validation Steps Performed ✅ Narrator scan mode now works (verified with character, word, and line navigation) ✅ NVDA movement still works (verified with word and line navigation) (cherry picked from commit 02ac246)
zadjii-msft
added a commit
that referenced
this pull request
Apr 15, 2022
…een wrong. I get all sorts of errors. I should to the opposite.
zadjii-msft
added a commit
that referenced
this pull request
Apr 15, 2022
…o have been wrong. I get all sorts of errors. I should to the opposite." This reverts commit bf0f516.
zadjii-msft
added a commit
that referenced
this pull request
Apr 18, 2022
…een wrong. I get all sorts of errors. I should to the opposite. (cherry picked from commit bf0f516)
This pull request was closed.
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary of the Pull Request
As a part of the Interactivity split,
TermControlAutomationPeerhad to be split intoTermControlAutomationPeer(TCAP) andInteractivityAutomationPeer(IAP). Just about all of the functions inInterativityAutomationPeeroperate by calling the non-XAML UIA Provider then wrapping the resultingUIATextRangeinto a XAML format (aXamlUiaTextRange[XUTR]). As a part of that XUTR constructor, we need a reference to the parent provider.We generally get that via
ProviderFromPeer(), but IAP'sProviderFromPeer()returned null (presumably because IAP isn't in the UI tree, whereas TCAP is directly registered as the automation peer for theTermControl).It looks like some screen readers didn't care (like NVDA, though there may be a chance we just didn't encounter an issue just yet), but Narrator definitely did.
The fix was to provide XUTR constructors the
ProviderFromPeerfrom TCAP, not IAP. To accomplish this, IAP now holds a weak reference to TCAP, and provides theProviderFromPeerwhen needed. We can't cache this result because there is no guarantee that it won't change.Some miscellaneous changes include:
TermControl::OnCreateAutomationPeernow returns the existing auto peer instead of always creating a new oneTCAP::WrapArrayOfTextRangeProviderswas removed as it was unused (normally, this would be directly affected by the mainProviderFromPeerchange here)XUTR::GetEnclosingElementis now hooked up to trace logging for debugging purposesReferences
Introduced in #10051
Closes #11488
Validation Steps Performed
✅ Narrator scan mode now works (verified with character, word, and line navigation)
✅ NVDA movement still works (verified with word and line navigation)