Skip to content

Microsoft Edge/UIA: Expanding an empty text range to line results in a broken IUIAutomationTextRange #12474

@LeonarddeR

Description

@LeonarddeR

Note, this is likely a bug in Edge, but we might want to consider working around it

Steps to reproduce:

  1. Open Edge
  2. Focus the address bar
  3. Make it blank
  4. Open a python console
  5. Observe the following behavior
>>> ti=nav.makeTextInfo("all")
>>> ti.text
''
>>> ti.isCollapsed
True
>>> ti.expand("character")
>>> ti.isCollapsed
True
>>> ti.expand("line")
>>> ti.isCollapsed
Traceback (most recent call last):
  File "<console>", line 1, in <module>
  File "baseObject.pyc", line 26, in __get__
  File "textInfos\__init__.pyc", line 438, in _get_isCollapsed
  File "NVDAObjects\UIA\__init__.pyc", line 798, in compareEndPoints
  File "comtypesMonkeyPatches.pyc", line 27, in __call__
_ctypes.COMError: (-2147220991, 'An event was unable to invoke any of the subscribers', (None, None, None, 0, None))

Actual behavior:

Expanding to line breaks the range object, makes it unusable. It can't be cloned, collapsed, etc.

Expected behavior:

Expanding to line behaves the same as expanding to character, word, etc. when the text range is empty, and it should still be a collapsed range as it is empty,

System configuration

NVDA installed/portable/running from source:

Installed

NVDA version:

alpha-22944,31ef7c54

Windows version:

Windows 10 21h01

Name and version of other software in use when reproducing the issue:

Edge 90.0.818.66 (Official build) (64-bit)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions