[orca] Web: Handle yet more off-screen text-interface brokenness
- From: Joanmarie Diggs <joanied src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [orca] Web: Handle yet more off-screen text-interface brokenness
- Date: Mon, 22 Feb 2021 09:30:32 +0000 (UTC)
commit ff35bd73b87d366f53ab09eb24f3dee04fde744f
Author: Joanmarie Diggs <jdiggs igalia com>
Date: Mon Feb 22 10:23:50 2021 +0100
Web: Handle yet more off-screen text-interface brokenness
It turns out that we sometimes get non-broken text when the off-screen
text at offset happens to be a space, but for all other offsets we
get just a single-character per line. Therefore also ignore spaces
when doing the sanity check. Ditto for the replacement character. We
can see the latter in some implementations when we use getText() for
a length of one at the offset of a multibyte character. In theory,
we should instead call getTextAtOffset() asking for a character. But
due to other bugs in (at least) Gecko, that is even less reliable.
src/orca/scripts/web/script_utilities.py | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
---
diff --git a/src/orca/scripts/web/script_utilities.py b/src/orca/scripts/web/script_utilities.py
index 30af22e0d..787a6c779 100644
--- a/src/orca/scripts/web/script_utilities.py
+++ b/src/orca/scripts/web/script_utilities.py
@@ -3140,7 +3140,8 @@ class Utilities(script_utilities.Utilities):
if rv:
boundary = pyatspi.TEXT_BOUNDARY_LINE_START
for i in range(nChars):
- if text.getText(i, i + 1) == self.EMBEDDED_OBJECT_CHARACTER:
+ char = text.getText(i, i + 1)
+ if char.isspace() or char in ["\ufffc", "\ufffd"]:
continue
string, start, end = text.getTextAtOffset(i, boundary)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]