[orca] Don't treat zero-width no-break space chars as valid offsets
- From: Joanmarie Diggs <joanied src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [orca] Don't treat zero-width no-break space chars as valid offsets
- Date: Thu, 18 Apr 2019 16:40:09 +0000 (UTC)
commit 84c81570d3947ff3b3c7fa033cc7688915ba01c9
Author: Joanmarie Diggs <jdiggs igalia com>
Date: Thu Apr 18 12:39:18 2019 -0400
Don't treat zero-width no-break space chars as valid offsets
src/orca/script_utilities.py | 1 +
src/orca/scripts/web/script_utilities.py | 4 ++--
2 files changed, 3 insertions(+), 2 deletions(-)
---
diff --git a/src/orca/script_utilities.py b/src/orca/script_utilities.py
index 62a925d49..187867647 100644
--- a/src/orca/script_utilities.py
+++ b/src/orca/script_utilities.py
@@ -68,6 +68,7 @@ class Utilities:
_desktop = pyatspi.Registry.getDesktop(0)
EMBEDDED_OBJECT_CHARACTER = '\ufffc'
+ ZERO_WIDTH_NO_BREAK_SPACE = '\ufeff'
SUPERSCRIPT_DIGITS = \
['\u2070', '\u00b9', '\u00b2', '\u00b3', '\u2074',
'\u2075', '\u2076', '\u2077', '\u2078', '\u2079']
diff --git a/src/orca/scripts/web/script_utilities.py b/src/orca/scripts/web/script_utilities.py
index 750e4cf2b..85155c1b3 100644
--- a/src/orca/scripts/web/script_utilities.py
+++ b/src/orca/scripts/web/script_utilities.py
@@ -3813,7 +3813,7 @@ class Utilities(script_utilities.Utilities):
if child and not self.isZombie(child) and not self.isEmptyAnchor(child) \
and not self.isUselessImage(child):
return self.findNextCaretInOrder(child, -1)
- if allText[i] != self.EMBEDDED_OBJECT_CHARACTER:
+ if allText[i] not in (self.EMBEDDED_OBJECT_CHARACTER, self.ZERO_WIDTH_NO_BREAK_SPACE):
return obj, i
elif not self.doNotDescendForCaret(obj) and obj.childCount:
return self.findNextCaretInOrder(obj[0], -1)
@@ -3879,7 +3879,7 @@ class Utilities(script_utilities.Utilities):
if child and not self.isZombie(child) and not self.isEmptyAnchor(child) \
and not self.isUselessImage(child):
return self.findPreviousCaretInOrder(child, -1)
- if allText[i] != self.EMBEDDED_OBJECT_CHARACTER:
+ if allText[i] not in (self.EMBEDDED_OBJECT_CHARACTER, self.ZERO_WIDTH_NO_BREAK_SPACE):
return obj, i
elif not self.doNotDescendForCaret(obj) and obj.childCount:
return self.findPreviousCaretInOrder(obj[obj.childCount - 1], -1)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]