From e7266c7cef7a6763b276ebd44875087c7f756d18 Mon Sep 17 00:00:00 2001 From: Michael Curran Date: Mon, 15 Jul 2024 17:32:47 +1000 Subject: [PATCH 1/3] ia2TextMozilla: expose name as content for any non-contenteditable within a contenteditable. Required to report addresses in outlook.com / Modern Outlook To/CC/BCC fields. (#16856) Summary of the issue: In outlook.com or Modern Outlook (Monarch) app, when arrowing through the To/CC/BCC fields, NVDA only reports button graphic for email addresses, and does not report the actual name/ address. This is because NVDA knows it is in a contenteditable / editable text field, and assumes that all the content can be moved through by character, and therefore does not include meta info such as name on ancestor elements. However, in this case, the addresses are actually on-contenteditable buttons within the contenteditable, which means that each button only takes up one character stop, and its content does not contain the name / address. Description of user facing changes NVDA now reports addresses when arrowing through To/CC/BCC fields in outlook.com / the Modern Outlook app. Description of development approach In ia2TextMozilla compound textInfo: conrolFields or objects that are non-contenteditable (don't have the editable state) are within a contenteditable (do have the editable state), have their 'content' key set to the object's name. Which forces NVDA to report the name as the content. --- source/NVDAObjects/IAccessible/ia2TextMozilla.py | 10 ++++++++++ user_docs/en/changes.md | 1 + 2 files changed, 11 insertions(+) diff --git a/source/NVDAObjects/IAccessible/ia2TextMozilla.py b/source/NVDAObjects/IAccessible/ia2TextMozilla.py index 9ed7c673115..6dbe8ec072f 100644 --- a/source/NVDAObjects/IAccessible/ia2TextMozilla.py +++ b/source/NVDAObjects/IAccessible/ia2TextMozilla.py @@ -80,6 +80,16 @@ def _getControlFieldForObject(self, obj, ignoreEditableText=True): uniqueID = obj.IA2UniqueID if uniqueID is not None: controlField["uniqueID"] = uniqueID + # #16631: Outlook.com /modern Outlook represent addresses in To/CC/BCC fields as labelled buttons. + # These buttons are non-contenteditable within a parent contenteditable. + # Ensure their label (name) is reported as the content + # as the caret cannot move through them. + if ( + controlTypes.state.State.EDITABLE not in obj.states + and obj.parent + and controlTypes.state.State.EDITABLE in obj.parent.states + ): + controlField['content'] = obj.name return controlField def _isCaretAtEndOfLine(self, caretObj: IAccessible) -> bool: diff --git a/user_docs/en/changes.md b/user_docs/en/changes.md index 6ce4b9567eb..c94208bbbc0 100644 --- a/user_docs/en/changes.md +++ b/user_docs/en/changes.md @@ -81,6 +81,7 @@ A warning message will inform you if you try writing to a non-empty directory. ( * Speech is no longer silent after disconnecting from and reconnecting to a Remote Desktop session. (#16722, @jcsteh) * Support added for text review commands for an object's name in Visual Studio Code. (#16248, @Cary-Rowen) * Playing NVDA sounds no longer fails on a mono audio device. (#16770, @jcsteh) +* NVDA will report addresses when arrowing through To/CC/BCC fields in outlook.com / Modern Outlook. (#16856) * NVDA now handles add-on installation failures more gracefully. (#16704) ### Changes for Developers From 4ef1f68897dc39b6e29ab51d7d312589ad11abe8 Mon Sep 17 00:00:00 2001 From: Michael Curran Date: Mon, 15 Jul 2024 17:49:56 +1000 Subject: [PATCH 2/3] =?UTF-8?q?Revert=20"ia2TextMozilla:=20expose=20name?= =?UTF-8?q?=20as=20content=20for=20any=20non-contenteditable=20wi=E2=80=A6?= =?UTF-8?q?"=20(#16859)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit reverts commit e7266c7cef7a6763b276ebd44875087c7f756d18. Reverts #16856 There were valid system tests that failed with the merging of pr #16856This --- source/NVDAObjects/IAccessible/ia2TextMozilla.py | 10 ---------- user_docs/en/changes.md | 1 - 2 files changed, 11 deletions(-) diff --git a/source/NVDAObjects/IAccessible/ia2TextMozilla.py b/source/NVDAObjects/IAccessible/ia2TextMozilla.py index 6dbe8ec072f..9ed7c673115 100644 --- a/source/NVDAObjects/IAccessible/ia2TextMozilla.py +++ b/source/NVDAObjects/IAccessible/ia2TextMozilla.py @@ -80,16 +80,6 @@ def _getControlFieldForObject(self, obj, ignoreEditableText=True): uniqueID = obj.IA2UniqueID if uniqueID is not None: controlField["uniqueID"] = uniqueID - # #16631: Outlook.com /modern Outlook represent addresses in To/CC/BCC fields as labelled buttons. - # These buttons are non-contenteditable within a parent contenteditable. - # Ensure their label (name) is reported as the content - # as the caret cannot move through them. - if ( - controlTypes.state.State.EDITABLE not in obj.states - and obj.parent - and controlTypes.state.State.EDITABLE in obj.parent.states - ): - controlField['content'] = obj.name return controlField def _isCaretAtEndOfLine(self, caretObj: IAccessible) -> bool: diff --git a/user_docs/en/changes.md b/user_docs/en/changes.md index c94208bbbc0..6ce4b9567eb 100644 --- a/user_docs/en/changes.md +++ b/user_docs/en/changes.md @@ -81,7 +81,6 @@ A warning message will inform you if you try writing to a non-empty directory. ( * Speech is no longer silent after disconnecting from and reconnecting to a Remote Desktop session. (#16722, @jcsteh) * Support added for text review commands for an object's name in Visual Studio Code. (#16248, @Cary-Rowen) * Playing NVDA sounds no longer fails on a mono audio device. (#16770, @jcsteh) -* NVDA will report addresses when arrowing through To/CC/BCC fields in outlook.com / Modern Outlook. (#16856) * NVDA now handles add-on installation failures more gracefully. (#16704) ### Changes for Developers From a675db0dff40d43041fd7ae4dc1d21172d5aa4e7 Mon Sep 17 00:00:00 2001 From: Michael Curran Date: Wed, 17 Jul 2024 17:12:22 +1000 Subject: [PATCH 3/3] ia2TextMozilla: report addresses in outlook.com and Modern Outlook's To/CC/BCC fields (#16870) In outlook.com or Modern Outlook (Monarch) app, when arrowing through the To/CC/BCC fields, NVDA only reports button graphic for email addresses, and does not report the actual name/ address. This is because NVDA knows it is in a contenteditable / editable text field, and assumes that all the content can be moved through by character, and therefore does not include meta info such as name on ancestor elements. However, in this case, the addresses are actually on-contenteditable buttons within the contenteditable, which means that each button only takes up one character stop, and its content does not contain the name / address. Description of user facing changes NVDA now reports addresses when arrowing through To/CC/BCC fields in outlook.com / the Modern Outlook app. Description of development approach In ia2TextMozilla compound textInfo: conrolFields or objects that are non-contenteditable (don't have the editable state) are within a contenteditable (do have the editable state), have their 'content' key set to the object's name. Which forces NVDA to report the name as the content. --- source/NVDAObjects/IAccessible/ia2TextMozilla.py | 11 +++++++++++ user_docs/en/changes.md | 1 + 2 files changed, 12 insertions(+) diff --git a/source/NVDAObjects/IAccessible/ia2TextMozilla.py b/source/NVDAObjects/IAccessible/ia2TextMozilla.py index 9ed7c673115..96c83da63ae 100644 --- a/source/NVDAObjects/IAccessible/ia2TextMozilla.py +++ b/source/NVDAObjects/IAccessible/ia2TextMozilla.py @@ -80,6 +80,17 @@ def _getControlFieldForObject(self, obj, ignoreEditableText=True): uniqueID = obj.IA2UniqueID if uniqueID is not None: controlField["uniqueID"] = uniqueID + # #16631: Outlook.com /modern Outlook represent addresses in To/CC/BCC fields as labelled buttons. + # These buttons are non-contenteditable within a parent contenteditable. + # Ensure their label (name) is reported as the content + # as the caret cannot move through them. + if ( + obj.role == controlTypes.role.Role.BUTTON + and controlTypes.state.State.EDITABLE not in obj.states + and obj.parent + and controlTypes.state.State.EDITABLE in obj.parent.states + ): + controlField['content'] = obj.name return controlField def _isCaretAtEndOfLine(self, caretObj: IAccessible) -> bool: diff --git a/user_docs/en/changes.md b/user_docs/en/changes.md index 6ce4b9567eb..c94208bbbc0 100644 --- a/user_docs/en/changes.md +++ b/user_docs/en/changes.md @@ -81,6 +81,7 @@ A warning message will inform you if you try writing to a non-empty directory. ( * Speech is no longer silent after disconnecting from and reconnecting to a Remote Desktop session. (#16722, @jcsteh) * Support added for text review commands for an object's name in Visual Studio Code. (#16248, @Cary-Rowen) * Playing NVDA sounds no longer fails on a mono audio device. (#16770, @jcsteh) +* NVDA will report addresses when arrowing through To/CC/BCC fields in outlook.com / Modern Outlook. (#16856) * NVDA now handles add-on installation failures more gracefully. (#16704) ### Changes for Developers