Skip to content

Commit c9f42c9

Browse files
Merge 12f8527 into cb8d3ad
2 parents cb8d3ad + 12f8527 commit c9f42c9

3 files changed

Lines changed: 26 additions & 0 deletions

File tree

nvdaHelper/vbufBackends/gecko_ia2/gecko_ia2.cpp

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -609,6 +609,19 @@ VBufStorage_fieldNode_t* GeckoVBufBackend_t::fillVBuf(
609609
}
610610
}
611611

612+
// Force equation role back to graphic role if the underlying tag is img.
613+
// #16007: Many publishers were setting role=math on images with alt text.
614+
// We want to just treat these as normal images.
615+
// We do this very early in the rendering so that all our graphic rules apply.
616+
if(role == ROLE_SYSTEM_EQUATION) {
617+
if(auto it = IA2AttribsMap.find(L"tag");
618+
it != IA2AttribsMap.end()
619+
&&it->second==L"img"
620+
) {
621+
role = ROLE_SYSTEM_GRAPHIC;
622+
}
623+
}
624+
612625
if (roleString) {
613626
roleAttr = roleString;
614627
} else {

source/NVDAObjects/IAccessible/ia2Web.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -373,6 +373,18 @@ def _get_mathMl(self):
373373
)
374374
raise LookupError
375375

376+
def _get_role(self):
377+
if self.IA2Attributes.get("tag") == "img":
378+
try:
379+
mathMl = self.mathMl
380+
except LookupError:
381+
mathMl = None
382+
if mathMl is None:
383+
# #16007: Many publishers were setting role=math on plain images with alt text.
384+
# We want to just treat these as normal images.
385+
return controlTypes.Role.GRAPHIC
386+
return super().role
387+
376388

377389
class Switch(Ia2Web):
378390
# role="switch" gets mapped to IA2_ROLE_TOGGLE_BUTTON, but it uses the

user_docs/en/changes.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,7 @@ In any document, if the cursor is on the last line, it will be moved to the end
134134
* Fixed an issue where some SAPI4 voices (e.g. IBM TTS Chinese) cannot be loaded. (#17726, @gexgd0419)
135135
* In Excel, the element list dialog (`NVDA+f7`) no longer fails to list comment or formulas on some non-English systems. (#11366, @CyrilleB79)
136136
* NVDA can now restore the audio ducking behavior when speaking a new utterance, when another app such as Magnifier changes the behavior system-wide. (#17747, @gexgd0419)
137+
* Math equations only represented by an image and alt text with no mathml for rich navigation, are now treated like normal images, rather than math with no content, allowing the user to jump to them with `g` and to be able to arrow through the alt text by character. (#16007)
137138

138139
### Changes for Developers
139140

0 commit comments

Comments
 (0)