nvaccess / nvda

NVDA, the free and open source Screen Reader for Microsoft Windows
https://www.nvaccess.org/
Other
2.11k stars 637 forks source link

Enhanced support for form controls in MS Word #6944

Open LeonarddeR opened 7 years ago

LeonarddeR commented 7 years ago

This ticket is related to #2295, #4709 and #6643.

Example materials:

Overall, it is not possible to change values in form controls in a reliable way. I think this is a show stopper for #6643. Especially the sluggishness with legacy controls is something which should also be fixed before we even start thinking about making editing them accessible.

LeonarddeR commented 7 years ago

cc @derekriemer, @michaeldcurran, @josephsl, @Qchristensen

LeonarddeR commented 6 years ago

It seems that #7849 doesn't improve this much. The new style check boxes are navigable using browse mode, they can't be toggled in browse mode though. All other form controls do not have proper control types assigned.

Adriani90 commented 5 months ago

Status with NVDA alpha-32185,7e31f30f (2024.3.0.32185) in MS Word 365, both UIA enabled and disabled, behavior is the same:

  1. First document with HTML based edit field and combo box:
    • When focusing the embeded object, You have to press shift+right arrow to expand it and the caret or the focus lands in the edit field or in the combo box.
    • In the edit field, NVDA does not report anything unless you change the window back and forth with alt+tab. When UIA is enabled, following is written to the log:
      IO - inputCore.InputManager.executeGesture (23:31:35.676) - winInputHook (24896):
      Input: kb(laptop):shift+rightArrow
      DEBUG - UIAHandler.shouldUseUIAInMSWord (23:31:35.691) - MainThread (17536):
      Using UIA due to suitable Office version: (16, 0, 17531)
      IO - speech.speech.speak (23:31:35.729) - MainThread (17536):
      Speaking ['Eingabefeld', CancellableSpeech (still valid), 'Leer']
      DEBUGWARNING - NVDAObjects.IAccessible.IAccessible._getIA2RelationFirstTarget (23:31:35.736) - MainThread (17536):
      Unable to use _getIA2TargetsForRelationsOfType, fallback to _IA2Relations.
      DEBUG - NVDAObjects.IAccessible.IAccessible._get__IA2Relations (23:31:35.736) - MainThread (17536):
      Not an IA2.IAccessible2
      DEBUG - NVDAObjects.IAccessible.IAccessible._getIA2RelationFirstTarget (23:31:35.736) - MainThread (17536):
      Unable to fetch _IA2Relations
      Traceback (most recent call last):
      File "NVDAObjects\IAccessible\__init__.pyc", line 1635, in _getIA2RelationFirstTarget
      File "baseObject.pyc", line 62, in __get__
      File "baseObject.pyc", line 168, in _getPropertyViaCache
      File "NVDAObjects\IAccessible\__init__.pyc", line 1550, in _get__IA2Relations
      NotImplementedError
      IO - speech.speech.speak (23:31:35.776) - MainThread (17536):
      Speaking ['Eingabefeld', CancellableSpeech (still valid)]
      IO - inputCore.InputManager.executeGesture (23:31:36.476) - winInputHook (24896):
      Input: kb(laptop):leftArrow
      IO - inputCore.InputManager.executeGesture (23:31:36.826) - winInputHook (24896):
      Input: kb(laptop):rightArrow
      IO - inputCore.InputManager.executeGesture (23:31:36.996) - winInputHook (24896):
      Input: kb(laptop):downArrow
      IO - inputCore.InputManager.executeGesture (23:31:37.252) - winInputHook (24896):
      Input: kb(laptop):upArrow
      IO - inputCore.InputManager.executeGesture (23:31:37.466) - winInputHook (24896):
      Input: kb(laptop):downArrow
      IO - inputCore.InputManager.executeGesture (23:31:37.696) - winInputHook (24896):
      Input: kb(laptop):upArrow
      IO - inputCore.InputManager.executeGesture (23:31:38.158) - winInputHook (24896):
      Input: kb(laptop):rightArrow
      IO - inputCore.InputManager.executeGesture (23:31:38.441) - winInputHook (24896):
      Input: kb(laptop):a
      DEBUG - UIAHandler.shouldUseUIAInMSWord (23:31:38.476) - MainThread (17536):
      Using UIA due to suitable Office version: (16, 0, 17531)
      IO - inputCore.InputManager.executeGesture (23:31:38.656) - winInputHook (24896):
      Input: kb(laptop):a
      IO - inputCore.InputManager.executeGesture (23:31:38.881) - winInputHook (24896):
      Input: kb(laptop):leftArrow
      IO - inputCore.InputManager.executeGesture (23:31:39.126) - winInputHook (24896):
      Input: kb(laptop):leftArrow

When UIA in MS Word is enabled, on pressing shift+right arrow to expand the embeded object, following error is written to the log:

DEBUGWARNING - NVDAObjects.IAccessible.IAccessible._getIA2RelationFirstTarget (23:28:19.480) - MainThread (28596):
Unable to use _getIA2TargetsForRelationsOfType, fallback to _IA2Relations.
DEBUG - NVDAObjects.IAccessible.IAccessible._get__IA2Relations (23:28:19.480) - MainThread (28596):
Not an IA2.IAccessible2
DEBUG - NVDAObjects.IAccessible.IAccessible._getIA2RelationFirstTarget (23:28:19.480) - MainThread (28596):
Unable to fetch _IA2Relations
Traceback (most recent call last):
  File "NVDAObjects\IAccessible\__init__.pyc", line 1635, in _getIA2RelationFirstTarget
  File "baseObject.pyc", line 62, in __get__
  File "baseObject.pyc", line 168, in _getPropertyViaCache
  File "NVDAObjects\IAccessible\__init__.pyc", line 1550, in _get__IA2Relations
NotImplementedError
Adriani90 commented 5 months ago

The developer info for the edit field is as follows:

INFO - globalCommands.script_navigatorObject_devInfo (23:33:24.946) - MainThread (17536):
Developer info for navigator object:
name: None
role: EDITABLETEXT
processID: 25184
roleText: None
states: FOCUSABLE, FOCUSED
isFocusable: True
hasFocus: True
Python object: <NVDAObjects.IAccessible.IAccessible object at 0x01230170>
Python class mro: (<class 'NVDAObjects.IAccessible.IAccessible'>, <class 'NVDAObjects.window.Window'>, <class 'NVDAObjects.NVDAObject'>, <class 'documentBase.TextContainerObject'>, <class 'baseObject.ScriptableObject'>, <class 'baseObject.AutoPropertyObject'>, <class 'garbageHandler.TrackedObject'>, <class 'object'>)
description: None
location: RectLTWH(left=496, top=315, width=107, height=36)
value: None
TextInfo: <class 'NVDAObjects.NVDAObjectTextInfo'>
appModule: AppModule(winword, appName='winword', processID=25184)
appModule.productName: 'Microsoft Office'
appModule.productVersion: '16.0.17531.20152'
appModule.helperLocalBindingHandle: c_long(73477104)
windowHandle: 9636202
windowClassName: 'F3 Server 9e980000'
windowControlID: 0
windowStyle: 1442840576
extendedWindowStyle: 0
windowThreadID: 20816
windowText: ''
displayText: ''
IAccessibleObject: <POINTER(IAccessible) ptr=0x6897e48 at 9d66b20>
IAccessibleChildID: 0
IAccessible event parameters: windowHandle=9636202, objectID=9, childID=0
IAccessible accName: exception: (-2147467263, 'Nicht implementiert', (None, None, None, 0, None))
IAccessible accRole: ROLE_SYSTEM_TEXT
IAccessible accState: STATE_SYSTEM_FOCUSED, STATE_SYSTEM_FOCUSABLE, STATE_SYSTEM_VALID (1048580)
IAccessible accDescription: None
IAccessible accValue: None

The developer info for the combo box is as follows:

INFO - globalCommands.script_navigatorObject_devInfo (23:37:39.349) - MainThread (17536):
Developer info for navigator object:
name: None
role: COMBOBOX
processID: 25184
roleText: None
states: FOCUSABLE, FOCUSED
isFocusable: True
hasFocus: True
Python object: <NVDAObjects.Dynamic_IAccessibleDisplayModelEditableTextWindowNVDAObject object at 0x09DD90D0>
Python class mro: (<class 'NVDAObjects.Dynamic_IAccessibleDisplayModelEditableTextWindowNVDAObject'>, <class 'NVDAObjects.IAccessible.IAccessible'>, <class 'NVDAObjects.window.DisplayModelEditableText'>, <class 'NVDAObjects.behaviors.EditableTextWithoutAutoSelectDetection'>, <class 'editableText.EditableTextWithoutAutoSelectDetection'>, <class 'NVDAObjects.behaviors.EditableText'>, <class 'NVDAObjects.behaviors.EditableTextWithSuggestions'>, <class 'NVDAObjects.behaviors.InputFieldWithSuggestions'>, <class 'NVDAObjects.behaviors.EditableTextBase'>, <class 'editableText.EditableText'>, <class 'NVDAObjects.window.Window'>, <class 'NVDAObjects.NVDAObject'>, <class 'documentBase.TextContainerObject'>, <class 'baseObject.ScriptableObject'>, <class 'baseObject.AutoPropertyObject'>, <class 'garbageHandler.TrackedObject'>, <class 'object'>)
description: None
location: None
value: 'value 2'
TextInfo: <class 'displayModel.EditableTextDisplayModelTextInfo'>
appModule: AppModule(winword, appName='winword', processID=25184)
appModule.productName: 'Microsoft Office'
appModule.productVersion: '16.0.17531.20152'
appModule.helperLocalBindingHandle: c_long(73477104)
windowHandle: 526936
windowClassName: 'F3 Server 9e980000'
windowControlID: 0
windowStyle: 1442840576
extendedWindowStyle: 0
windowThreadID: 20816
windowText: ''
displayText: exception: cannot unpack non-iterable NoneType object
IAccessibleObject: <POINTER(IAccessible) ptr=0x6926390 at 9da1c10>
IAccessibleChildID: 0
IAccessible event parameters: windowHandle=526936, objectID=-4, childID=0
IAccessible accName: exception: (-2147467263, 'Nicht implementiert', (None, None, None, 0, None))
IAccessible accRole: ROLE_SYSTEM_COMBOBOX
IAccessible accState: STATE_SYSTEM_FOCUSED, STATE_SYSTEM_FOCUSABLE, STATE_SYSTEM_VALID (1048580)
IAccessible accDescription: None
IAccessible accValue: 'value 2'
Adriani90 commented 5 months ago
  1. New and legacy form fields: Enabling UIA makes this form quite inaccessible, so I tested with UIA disabled.
    • The HTML based form fields are actually the same like legacy form fields. In the second document, the legacy form fields can be expanded by pressing shift+right arrow, and the same behavior like in the tests above applies.