Skip to content

Commit 2897f53

Browse files
Merge 3913bf5 into a452470
2 parents a452470 + 3913bf5 commit 2897f53

3 files changed

Lines changed: 53 additions & 0 deletions

File tree

source/virtualBuffers/__init__.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -327,6 +327,10 @@ def _normalizeControlField(self, attrs: textInfos.ControlField):
327327
# Get the text for the header cells.
328328
textList = []
329329
for docHandle, ID in cellIdentifiers:
330+
if attrs.get("controlIdentifier_docHandle") == docHandle and attrs.get("controlIdentifier_ID") == ID:
331+
# This is a self-reference to a column or row header
332+
# Do not double up the cell header name. This is happening in Chrome.
333+
continue
330334
try:
331335
start, end = self._getOffsetsFromFieldIdentifier(int(docHandle), int(ID))
332336
except (LookupError, ValueError):

tests/system/robot/chromeTests.py

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -603,3 +603,49 @@ def test_ariaDescription_sayAll():
603603
"After Test Case Marker"
604604
])
605605
)
606+
607+
608+
def test_i10840():
609+
"""
610+
The name of table header cells should only be conveyed once when navigating directly to them in browse mode
611+
Chrome self-references a header cell as its own header, which used to cause the name to be announced twice
612+
"""
613+
_chrome.prepareChrome(
614+
f"""
615+
<table>
616+
<thead>
617+
<tr>
618+
<th>Month</th>
619+
<th>items</th>
620+
</tr>
621+
</thead>
622+
<tbody>
623+
<tr>
624+
<td>January</td>
625+
<td>100</td>
626+
</tr>
627+
<tr>
628+
<td>February</td>
629+
<td>80</td>
630+
</tr>
631+
</tbody>
632+
<tfoot>
633+
<tr>
634+
<td>Sum</td>
635+
<td>180</td>
636+
</tr>
637+
</tfoot>
638+
</table>
639+
"""
640+
)
641+
# Jump to the table
642+
actualSpeech = _chrome.getSpeechAfterKey("t")
643+
_asserts.strings_match(
644+
actualSpeech,
645+
"table with 4 rows and 2 columns row 1 column 1 Month"
646+
)
647+
nextActualSpeech = _chrome.getSpeechAfterKey("control+alt+rightArrow")
648+
_asserts.strings_match(
649+
nextActualSpeech,
650+
"column 2 items"
651+
)

tests/system/robot/chromeTests.robot

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,3 +69,6 @@ ARIA description Browse Mode
6969
ARIA description Say All
7070
[Documentation] Say all, contents includes aria-description
7171
test_ariaDescription_sayAll
72+
i10840
73+
[Documentation] The name of table header cells should only be conveyed once when navigating directly to them in browse mode (chrome self-references a header cell as its own header, which used to cause the name to be announced twice)
74+
test_i10840

0 commit comments

Comments
 (0)