-
Notifications
You must be signed in to change notification settings - Fork 8.4k
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
Remove most uses of CompareInBounds
#13244
Conversation
This comment was marked as outdated.
This comment was marked as outdated.
ok, this works really well. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll throw myself on the block list to review it -- especially because we've been talking about backporting it as part of also backporting a conversion of UIA to til::point
Created the 1.14 port version in #13313 |
Hello @DHowett! Because this pull request has the p.s. you can customize the way I help with merging this pull request, such as holding this pull request until a specific person approves. Simply @mention me (
|
Will this make it to SV2 as well? Any stability fixes will be good to help strengthen our case for nvaccess/nvda#10964 making it into the next release! |
Marking for discussion to see if this can be backported. I'm guessing that the servicing bar is too high for this 😕 but we'll discuss. |
This definitely can't make it into SV2; the boarding doors are closed for sure. Sorry. |
Makes sense, thanks for letting me know. |
🎉 Handy links: |
This reverts commit f785168.
This reverts commit f785168 (PR #13244) The error logged to NVDA was caused by the following line of code in `_getTextValue()`: `THROW_HR_IF(E_FAIL, !bufferSize.IsInBounds(_start) || !bufferSize.IsInBounds(_end));` NVDA would expand a text range to encompass the document in the alt buffer. This means that the "end" would be set to the dangling "endExclusive" point (x = left, y = one past the end of the buffer). This is a valid range! However, upon extracting the text, we would hit the code above. The exclusive end doesn't actually point to anything in the buffer, so we would falsly throw `E_FAIL`. Though this could be fixed by adding a special check for the `endExclusive` in the line above, I suspect there are other places throughout the UIA code that hit this problem too. The safest course of action is to revert this commit entirely since it was a code health commit (it doesn't actually close an issue). Closes #13866
This reverts commit f785168 (PR #13244) The error logged to NVDA was caused by the following line of code in `_getTextValue()`: `THROW_HR_IF(E_FAIL, !bufferSize.IsInBounds(_start) || !bufferSize.IsInBounds(_end));` NVDA would expand a text range to encompass the document in the alt buffer. This means that the "end" would be set to the dangling "endExclusive" point (x = left, y = one past the end of the buffer). This is a valid range! However, upon extracting the text, we would hit the code above. The exclusive end doesn't actually point to anything in the buffer, so we would falsly throw `E_FAIL`. Though this could be fixed by adding a special check for the `endExclusive` in the line above, I suspect there are other places throughout the UIA code that hit this problem too. The safest course of action is to revert this commit entirely since it was a code health commit (it doesn't actually close an issue). Closes #13866 (cherry picked from commit bfd5248) Service-Card-Id: 85405833 Service-Version: 1.15
Summary of the Pull Request
Replaces most uses of
Viewport::CompareInBounds()
withtil::point
's<
and>
operators.CompareInBounds
has been the cause of a bunch of UIA crashes over the years. Replacing them entirely ensures that theFAILFAST_IF
isn't ever touched.Unfortunately, we still need
IncrementInBounds
andDecrementInBounds
to have support for that exclusive end.References
#13183