Skip to content

Commit a72df41

Browse files
authored
Merge 7aa9849 into 6a43521
2 parents 6a43521 + 7aa9849 commit a72df41

2 files changed

Lines changed: 10 additions & 0 deletions

File tree

source/NVDAObjects/IAccessible/ia2Web.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff 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

256262
class Document(Ia2Web):

source/virtualBuffers/gecko_ia2.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff 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.

0 commit comments

Comments
 (0)