File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1818from . import IAccessible
1919from .ia2TextMozilla import MozillaCompoundTextInfo
2020import aria
21+ import api
22+ import speech
23+ import controlTypes
2124
2225class 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
8496class Document (Ia2Web ):
8597 value = None
Original file line number Diff line number Diff 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 :
You can’t perform that action at this time.
0 commit comments