Bug: Opening an HTML dialog nested in a shadow root more than once causes controls inside it to become non-clickable
Steps to reproduce:
- Open https://codepen.io/mra11yx/pen/VwoRwKq (forking this and opening in debug mode would be ideal) in either Chrome or Edge.
- Navigate to the "example 2 (dialog inside shadow root)" button with NVDA running, and activate it
- Close the dialog
- Reopen it and observe that the close button can no longer be activated
- Observe that this does not occur in example 1, which is fully in the light DOM.
- Attempt to reproduce this in Firefox and observe that the issue does not occur.
Actual behavior:
Nesting a native HTML dialog in a shadow DOM root causes buttons inside the dialog to be no longer clickable in NVDA if the dialog has been closed and then reopened. This occurs in Edge and Chrome, but not Firefox.
I believe it to be a Chromium bug, and raised a separate report in the Chromium bug tracker, but am logging here as well in case it's an issue with NVDA itself.
Issue does not occur with JAWS or VoiceOver.
Expected behavior:
Users should be able to reliably interact with controls.
NVDA logs, crash dumps and other attachments:
System configuration
NVDA installed/portable/running from source:
NVDA installed on a Windows 11 VM for ARM on macOS. Confirmed issue occurs on Windows for x86 as well.
NVDA version:
2024.4.1
Windows version:
11
Name and version of other software in use when reproducing the issue:
Chrome or Edge
Other information about your system:
Windows 11 VM in Parallels Desktop; confirmed this also occurs on a real Intel PC
Other questions
Does the issue still occur after restarting your computer?
Yes
Have you tried any other versions of NVDA? If so, please report their behaviors.
No
If NVDA add-ons are disabled, is your problem still occurring?
Yes
Does the issue still occur after you run the COM Registration Fixing Tool in NVDA's tools menu?
Yes
Following error is written to NVDA log:
IO - inputCore.InputManager.executeGesture (19:52:53.884) - winInputHook (27352):
Input: kb(laptop):tab
IO - speech.speech.speak (19:52:53.903) - MainThread (20248):
Speaking ['Example 2 (dialog inside shadow root)', 'Schalter']
IO - inputCore.InputManager.executeGesture (19:52:54.469) - winInputHook (27352):
Input: kb(laptop):enter
DEBUGWARNING - NVDAObjects.IAccessible.IAccessible._get_IAccessibleRole (19:52:54.489) - MainThread (20248):
accRole failed: (-2147467259, 'Unbekannter Fehler', (None, None, None, 0, None))
DEBUGWARNING - NVDAObjects.IAccessible.IAccessible._get_IA2States (19:52:54.489) - MainThread (20248):
could not get IAccessible2 states
Traceback (most recent call last):
File "NVDAObjects\IAccessible\__init__.pyc", line 2171, in _get_IA2States
_ctypes.COMError: (-2147467259, 'Unbekannter Fehler', (None, None, None, 0, None))
DEBUGWARNING - NVDAObjects.IAccessible.IAccessible._get_IA2Attributes (19:52:54.494) - MainThread (20248):
IAccessibleObject.attributes COMError (-2147467259, 'Unbekannter Fehler', (None, None, None, 0, None))
IO - speech.speech.speak (19:52:54.544) - MainThread (20248):
Speaking ['Sample dialog heading', 'Dialogfeld', 'Sample dialog content\nYour name\nYour favorite food']
IO - speech.speech.speak (19:52:54.544) - MainThread (20248):
Speaking ['Schalter', 'Close dialog']
DEBUGWARNING - NVDAObjects.IAccessible.IAccessible._get_IAccessibleRole (19:52:54.564) - MainThread (20248):
accRole failed: (-2147467259, 'Unbekannter Fehler', (None, None, None, 0, None))
DEBUGWARNING - NVDAObjects.IAccessible.IAccessible._get_IA2States (19:52:54.564) - MainThread (20248):
could not get IAccessible2 states
Traceback (most recent call last):
File "NVDAObjects\IAccessible\__init__.pyc", line 2171, in _get_IA2States
_ctypes.COMError: (-2147467259, 'Unbekannter Fehler', (None, None, None, 0, None))
DEBUGWARNING - NVDAObjects.IAccessible.IAccessible._get_IA2Attributes (19:52:54.564) - MainThread (20248):
IAccessibleObject.attributes COMError (-2147467259, 'Unbekannter Fehler', (None, None, None, 0, None))
IO - speech.speech.speak (19:52:54.564) - MainThread (20248):
Speaking ['Close dialog', 'Schalter']
IO - inputCore.InputManager.executeGesture (19:52:56.919) - winInputHook (27352):
Input: kb(laptop):enter
ERROR - scriptHandler.executeScript (19:52:56.919) - MainThread (20248):
error executing script: <bound method BrowseModeTreeInterceptor.script_activatePosition of <NVDAObjects.IAccessible.chromium.ChromeVBuf object at 0x06157550>> with gesture 'Eingabe'
Traceback (most recent call last):
File "scriptHandler.pyc", line 300, in executeScript
File "browseMode.pyc", line 701, in script_activatePosition
File "browseMode.pyc", line 716, in _focusLastFocusableObject
File "virtualBuffers\gecko_ia2.pyc", line 366, in _shouldSetFocusToObj
AttributeError: 'NoneType' object has no attribute 'role'
@seanbudd this issue does not occur with Jaws or Narator.
cc: @SaschaCowley