nvda
f5e55147 - Ensure documents always scroll to exact browse mode position (#12803)

Commit
4 years ago
Ensure documents always scroll to exact browse mode position (#12803) When reading / navigating with browse mode in Microsoft Word via UI Automation, the document does not always scroll so that the current browse mode position is visible on screen, nor does the focus mode caret position stay in sync with the browse mode caret, especially when moving across pages in browse mode. Browse mode currently only knows how to scroll to objects in the document, not specific text range positions. Thus, it is only able to scroll to lists, tables and graphics, and not any arbitrary text. Also, setting the caret in Microsoft Word to a range that is on a page that is currently off screen seems to fail and or set the caret to a random point on the current page. Description of how this pull request fixes the issue: • Add a scrollIntoView method on textInfos.TextInfo which should croll the document containing that range such that the range is visible on screen. The base implementation has no implementation and does nothing. • Implement ScrollIntoView for IAccessible2 textInfos, UIA textInfos, Microsoft Word object model textInfos, and virtualBuffer textInfos. The VirtualBuffer textInfo implementation comes straight from the old BrowseMode logic which is to call ScrollIntoView on the deepest object at the position in the document. • Change BrowseModeDocument's _set_selection to call ScrollIntoView on the given textInfo, rather than the deepest object at the position of that textInfo. This is much more accurate and will ensure that any arbitrary textRange is scrolled to. It is specifically this change, plus the implementation of ScrollIntoView for UIA TextInfo that solves the Microsoft Word with Browse mode via UI Automation scrolling issue.
Parents
Loading