From 1e843800ffba57ff3e83edba6fdf8cd9a2c5323e Mon Sep 17 00:00:00 2001 From: unknown Date: Sat, 14 Dec 2024 19:24:46 -0800 Subject: [PATCH 1/2] Fix math not being read in Chromium-based browers. Chromium made a change that causes a call to (correctly) return E_NOTIMPL. This simple fix catches the exception and moves on. The behavior should be the same as before the Chromium change. Only E_NOTIMPL is caught, other COMErrors are re-raised. Fixes #17421 --- source/NVDAObjects/IAccessible/ia2Web.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/source/NVDAObjects/IAccessible/ia2Web.py b/source/NVDAObjects/IAccessible/ia2Web.py index ffae86763b9..908178b0737 100644 --- a/source/NVDAObjects/IAccessible/ia2Web.py +++ b/source/NVDAObjects/IAccessible/ia2Web.py @@ -12,6 +12,7 @@ ) from ctypes import c_short from comtypes import COMError, BSTR +from comtypes.hresult import E_NOTIMPL import oleacc from annotation import ( @@ -336,7 +337,13 @@ def _get_mathMl(self): # Try the data-mathml attribute. attrNames = (BSTR * 1)("data-mathml") namespaceIds = (c_short * 1)(0) - attr = node.attributesForNames(1, attrNames, namespaceIds) + try: + attr = node.attributesForNames(1, attrNames, namespaceIds) + except COMError as e: + if e.hresult != E_NOTIMPL: + log.debugWarning(f"MathML getting attr error: {e}") + raise + attr = None if attr: import mathPres From 10fea681521c59ac4f46a9ac08a8ea52df534687 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 17 Dec 2024 22:51:49 -0800 Subject: [PATCH 2/2] Add change to go along with PR #17528 --- user_docs/en/changes.md | 1 + 1 file changed, 1 insertion(+) diff --git a/user_docs/en/changes.md b/user_docs/en/changes.md index 59086a27091..b50d6b6d308 100644 --- a/user_docs/en/changes.md +++ b/user_docs/en/changes.md @@ -53,6 +53,7 @@ Prefix matching on command line flags, e.g. using `--di` for `--disable-addons` ### Bug Fixes +* Restore reading of math in Chromium-based browsers (Chrome/Edge/...) by handling a change they made (#17421) * Math reading has been fixed for some web elements. Specifically, MathML inside of span and other elements that have the attribute `role="math"`. (#15058) * Native support for the Dot Pad tactile graphics device from Dot Inc as a multiline braille display. (#17007)