Skip to content
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

HP Secure Browser support (#16377): Detect & prevent infinite loop in iterUIARangeByUnit #16394

Merged
merged 1 commit into from Apr 16, 2024

Commits on Apr 15, 2024

  1. HP Secure Browser support (nvaccess#16377): Detect & prevent infinite…

    … loop in iterUIARangeByUnit
    
    Summary of the issue:
    We're experiencing NVDA locking up trying to infinitely split some text
    ranges, for example on www.bat.org when it tries to split the range representing
    "Submit" button into individual characters.
    
    NVDA hangs completely in this scenario and has to be forcibly killed.
    
    If the offending split is attempted, the hang always happens. Secure Browser seems to be provoking this split more,
    but we've also seen that in normal chromium-based browsers when using UIA instead of IAccessible2.
    This could be due to significant timing differences etc, as the virtualized
    browser has higher overhead.
    
    Typical repro scenario involves navigating to www.bat.org then duplicating the tab &
    closing some of the dupes, until NVDA attempts the split and hangs.
    
    Description of user facing changes:
    Detect & prevent the infinite loop so that NVDA remains responsive
    
    Description of development approach:
    This is likely a deficiency in UIA text range implementation on the chromium
    side, as I don't see anything obviously wrong with the algorithm in
    iterRangeByUnit which is doing the split. Rewriting this UIA algorithm in C++
    and running against offending website also hangs, always, in regular
    Google Chrome, Edge, and Secure Browser.
    
    At the cost of extra Compare COM call we can detect that chromium is yielding
    same range infinitely, and therefore detect & shortcircuit the infinite loop
    on the NVDA side.
    Tomasz Wroblewski committed Apr 15, 2024
    Configuration menu
    Copy the full SHA
    3e1a4de View commit details
    Browse the repository at this point in the history