File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -170,6 +170,7 @@ def _get_detailsRole(self) -> Optional[controlTypes.Role]:
170170 return self .annotations .roles [0 ]
171171
172172 def _get_isCurrent (self ) -> controlTypes .IsCurrent :
173+ log .debugWarning ("impl required for: %s" % repr (self ), stack_info = True )
173174 ia2attrCurrent : str = self .IA2Attributes .get ("current" , "false" )
174175 try :
175176 return controlTypes .IsCurrent (ia2attrCurrent )
@@ -251,6 +252,11 @@ def _get_liveRegionPoliteness(self) -> aria.AriaLivePoliteness:
251252 except ValueError :
252253 log .error (f"Unknown live politeness of { politeness } " , exc_info = True )
253254 super ().liveRegionPoliteness
255+
256+ def _get_role (self ):
257+ if self .IA2Attributes .get ("tag" , "" ).casefold () == "figure" :
258+ return controlTypes .Role .FIGURE
259+ return super ()._get_role ()
254260
255261
256262class Document (Ia2Web ):
Original file line number Diff line number Diff line change @@ -128,12 +128,16 @@ def _normalizeControlField(self, attrs): # noqa: C901
128128 attrs ['placeholder' ]= placeholder
129129
130130 role = IAccessibleHandler .NVDARoleFromAttr (attrs ['IAccessible::role' ])
131+
131132 if attrs .get ('IAccessible2::attribute_tag' ,"" ).lower ()== "blockquote" :
132133 role = controlTypes .Role .BLOCKQUOTE
134+ elif attrs .get ('IAccessible2::attribute_tag' ,"" ).lower ()== "figure" :
135+ role = controlTypes .Role .FIGURE
133136
134137 states = IAccessibleHandler .getStatesSetFromIAccessibleAttrs (attrs )
135138 states |= IAccessibleHandler .getStatesSetFromIAccessible2Attrs (attrs )
136139 role , states = controlTypes .transformRoleStates (role , states )
140+ if role == controlTypes .Role .GROUPING : log .debug ("Found a grouping" )
137141
138142 if role == controlTypes .Role .EDITABLETEXT and not (controlTypes .State .FOCUSABLE in states or controlTypes .State .UNAVAILABLE in states or controlTypes .State .EDITABLE in states ):
139143 # This is a text leaf.
You can’t perform that action at this time.
0 commit comments