Repository: nvaccess/nvda

Issue:
Report "has details" in braille for non-landmark content
<!-- Please read the text in this edit field before filling it in.
Please thoroughly read NVDA's wiki article on how to fill in this template, including how to provide the required files.
Issues may be closed if the required information is not present.
https://github.com/nvaccess/nvda/blob/master/devDocs/githubIssueTemplateExplanationAndExamples.md
Please also note that the NVDA project has a Citizen and Contributor Code of Conduct which can be found at https://github.com/nvaccess/nvda/blob/master/CODE_OF_CONDUCT.md. NV Access expects that all contributors and other community members read and abide by the rules set out in this document while participating or contributing to this project. This includes creating or commenting on issues and pull requests. 

Each of the questions and sections below start with multiple hash symbols (#). Place your answers and information on the blank line below each question.
-->

Discovered in #13649 

### Steps to reproduce:
There is uneven behaviour between details reporting for speech and braille.
The following will report "has details" in speech but not braille:

```html
<div><span aria-details="foo">bar</span></div>
<div id="foo">details of bar</div>
```

The following will report "has details" in both speech and braille:
```html
<div><mark aria-details="foo">bar</mark></div>

<span aria-details="foo" role="form">bar</span>

<div id="foo">details of bar</div>
```

### Actual behavior:
Some html nodes will not report "has details" in braille. It is suspected that this problem occurs for all non-landmark nodes.

### Expected behavior:
Has details is reported consistently across braille and speech

### System configuration
#### NVDA installed/portable/running from source:

#### NVDA version:
NVDA 2022.1




Discussion:

Resolving patch:
diff --git a/source/braille.py b/source/braille.py
--- a/source/braille.py
+++ b/source/braille.py
@@ -785,6 +785,8 @@ def getControlFieldBraille(  # noqa: C901
 			text.append(getPropertiesBraille(description=description))
 		if current:
 			text.append(getPropertiesBraille(current=current))
+		if hasDetails:
+			text.append(getPropertiesBraille(hasDetails=hasDetails, detailsRole=detailsRole))
 		if role == controlTypes.Role.GRAPHIC and content:
 			text.append(content)
 		return TEXT_SEPARATOR.join(text) if len(text) != 0 else None


Test patch:
diff --git a/tests/system/robot/chromeTests.py b/tests/system/robot/chromeTests.py
--- a/tests/system/robot/chromeTests.py
+++ b/tests/system/robot/chromeTests.py
@@ -225,30 +225,6 @@ def test_mark_aria_details_role():
 		"form",
 	])
 
-	# TODO: fix known bug with braille not announcing details #13815
-	expectedBraille = " ".join([  # noqa: F841
-		"mln",
-		"edit",
-		# the role doc-endnote is unsupported as an IA2 role
-		# The role "ROLE_LIST_ITEM" is used instead
-		"details",
-		"doc endnote,",
-		"has fnote",
-		"doc footnote,",
-		"has cmnt",
-		"comment,",
-		# the role definition is unsupported as an IA2 role
-		# The role "ROLE_PARAGRAPH" is used instead
-		"details",
-		"definition,",
-		"details",
-		"definition,",
-		# The role "form" is deliberately unsupported
-		"details",
-		"form",
-		"edt end",
-	])
-
 	actualSpeech, actualBraille = _NvdaLib.getSpeechAndBrailleAfterKey('downArrow')
 
 	_asserts.speech_matches(
@@ -257,11 +233,34 @@ def test_mark_aria_details_role():
 		message="Browse mode speech: Read line with different aria details roles."
 	)
 	_asserts.braille_matches(
-		actualBraille,
-		# TODO: fix known bug with braille not announcing details #13815
-		# expectedBraille,
-		"mln edt doc-endnote, doc-footnote, comment, definition, definition, form edt end",
 		message="Browse mode braille: Read line with different aria details roles.",
+		actual=actualBraille,
+		expected=" ".join([
+			"mln",
+			"edt ",
+			# the role doc-endnote is unsupported as an IA2 role
+			# The role "ROLE_LIST_ITEM" is used instead
+			"details",
+			"doc-endnote,",
+			" ",  # space between spans
+			"has fnote",
+			"doc-footnote,",
+			" ",  # space between spans
+			"has cmnt",
+			"comment,",
+			" ",  # space between spans
+			# the role definition is unsupported as an IA2 role
+			# The role "ROLE_PARAGRAPH" is used instead
+			"details",
+			"definition,",
+			" ",  # space between spans
+			"details",
+			"definition,",
+			# The role "form" is deliberately unsupported
+			# "details",
+			# "form",
+			# "edt end",
+		])
 	)
 	
 	# Reset caret
@@ -291,11 +290,35 @@ def test_mark_aria_details_role():
 		message="Focus mode speech: Read line with different aria details roles"
 	)
 	_asserts.braille_matches(
-		actualBraille,
-		# TODO: fix known bug with braille not announcing details #13815
-		# expectedBraille,
-		"doc-endnote, doc-footnote, comment, definition, definition, form",
 		message="Focus mode braille: Read line with different aria details roles",
+		actual=actualBraille,
+		expected=" ".join([
+			# no "mln edt"
+			# the role doc-endnote is unsupported as an IA2 role
+			# The role "ROLE_LIST_ITEM" is used instead
+			"details",
+			"doc-endnote,",
+			" ",  # space between spans
+			"has fnote",
+			"doc-footnote,",
+			" ",  # space between spans
+			"has cmnt",
+			"comment,",
+			" ",  # space between spans
+			# the role definition is unsupported as an IA2 role
+			# The role "ROLE_PARAGRAPH" is used instead
+			"details",
+			"definition,",
+			" ",  # space between spans
+			"details",
+			"definition,",
+			" ",  # space between spans
+			"d"  # Is this the start of the word 'details' with the rest cut-off?
+			# The role "form" is deliberately unsupported
+			# "details",
+			# "form",
+			# "edt end",
+		])
 	)