-
Notifications
You must be signed in to change notification settings - Fork 8.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
UIA: degenerate text ranges not degenerate after move #7342
Comments
Cc @carlos-zamora. |
Could this please be reconsidered for 21H1? I'd really like to start using UIA console by default. Thanks. |
The issue seems not to be with >>> # In word
>>> ti=nav.makeTextInfo("caret")
>>> ti.compareEndPoints(ti, "startToEnd")
0
>>> ti.move("character", 2)
2
>>> ti.compareEndPoints(ti, "startToEnd")
0
>>> # Now, in conhost
>>> ti=nav.makeTextInfo("caret")
>>> ti.compareEndPoints(ti, "startToEnd")
0
>>> ti.move("character", 2)
2
>>> ti.compareEndPoints(ti, "startToEnd")
-1 Based on my testing in Word, the key seems to be: if a degenerate range is moved, it should remain degenerate after the move. |
Conhost expands UIA text ranges when moved. This means that degenerate ranges become non-degenerate after movement, leading to odd behaviour from UIA clients. This PR doesn't expand degenerate ranges, but rather keeps them degenerate by moving `_end` to the newly-changed `_start`. Tested in the NVDA Python console (cases with `setEndPoint` and `compareEndPoints` described in #7342). Also ran the logic by @michaelDCurran. Closes #7342 Almost definitely addresses nvaccess/nvda#11288 (although I'll need to test with my Braille display). Also fixes an issue privately reported to me by @Simon818 with copy/paste from review cursor which originally lead me to believe the issue was with `moveEndPointByRange`.
Conhost expands UIA text ranges when moved. This means that degenerate ranges become non-degenerate after movement, leading to odd behaviour from UIA clients. This PR doesn't expand degenerate ranges, but rather keeps them degenerate by moving `_end` to the newly-changed `_start`. Tested in the NVDA Python console (cases with `setEndPoint` and `compareEndPoints` described in #7342). Also ran the logic by @michaelDCurran. Closes #7342 Almost definitely addresses nvaccess/nvda#11288 (although I'll need to test with my Braille display). Also fixes an issue privately reported to me by @Simon818 with copy/paste from review cursor which originally lead me to believe the issue was with `moveEndPointByRange`. (cherry picked from commit 7a03f75)
🎉This issue was addressed in #7530, which has now been successfully released as Handy links: |
🎉This issue was addressed in #7530, which has now been successfully released as Handy links: |
Environment
Steps to reproduce
Expected behaviour
Conhost matches Microsoft Word when calling
MoveEndpointByRange
.Actual behaviour
See above.
The text was updated successfully, but these errors were encountered: