Skip to content

Commit fcd86d6

Browse files
authored
Merge 5bd4b66 into fba44b4
2 parents fba44b4 + 5bd4b66 commit fcd86d6

2 files changed

Lines changed: 18 additions & 2 deletions

File tree

source/NVDAObjects/IAccessible/ia2Web.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,9 @@
1818
from . import IAccessible
1919
from .ia2TextMozilla import MozillaCompoundTextInfo
2020
import aria
21+
import api
22+
import speech
23+
import controlTypes
2124

2225
class Ia2Web(IAccessible):
2326
IAccessibleTableUsesTableCellIndexAttrib=True
@@ -80,6 +83,15 @@ def _get_landmark(self):
8083
return landmark
8184
return super().landmark
8285

86+
def event_IA2AttributeChange(self):
87+
super().event_IA2AttributeChange()
88+
if self is api.getFocusObject():
89+
# Report aria-current if it changed.
90+
speech.speakObjectProperties(self, current=True,
91+
reason=controlTypes.REASON_CHANGE)
92+
# super calls event_stateChange which updates braille, so no need to
93+
# update braille here.
94+
8395

8496
class Document(Ia2Web):
8597
value = None

source/speech/__init__.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -297,6 +297,10 @@ def speakObjectProperties( # noqa: C901
297297
elif name.startswith('positionInfo_') and value:
298298
if positionInfo is None:
299299
positionInfo=obj.positionInfo
300+
elif value and name == "current":
301+
# getPropertiesSpeech names this "current", but the NVDAObject property is
302+
# named "isCurrent".
303+
newPropertyValues['current'] = obj.isCurrent
300304
elif value:
301305
# Certain properties such as row and column numbers have presentational versions, which should be used for speech if they are available.
302306
# Therefore redirect to those values first if they are available, falling back to the normal properties if not.
@@ -350,7 +354,6 @@ def speakObjectProperties( # noqa: C901
350354
newPropertyValues["_tableID"]=obj.tableID
351355
except NotImplementedError:
352356
pass
353-
newPropertyValues['current']=obj.isCurrent
354357
if allowedProperties.get('placeholder', False):
355358
newPropertyValues['placeholder']=obj.placeholder
356359
# When speaking an object due to a focus change, the 'selected' state should not be reported if only one item is selected.
@@ -437,7 +440,8 @@ def speakObject( # noqa: C901
437440
"rowHeaderText": True,
438441
"columnHeaderText": True,
439442
"rowSpan": True,
440-
"columnSpan": True
443+
"columnSpan": True,
444+
"current": True
441445
}
442446

443447
if reason==controlTypes.REASON_FOCUSENTERED:

0 commit comments

Comments
 (0)