[orca] Chromium: Remove some chattiness with spin buttons
- From: Joanmarie Diggs <joanied src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [orca] Chromium: Remove some chattiness with spin buttons
- Date: Tue, 27 Aug 2019 18:21:30 +0000 (UTC)
commit 99fe0f147fc29bfd8004a573e38b40655b279dcc
Author: Joanmarie Diggs <jdiggs igalia com>
Date: Tue Aug 27 14:20:21 2019 -0400
Chromium: Remove some chattiness with spin buttons
src/orca/scripts/web/script.py | 5 +++++
src/orca/scripts/web/script_utilities.py | 16 +++++++++-------
2 files changed, 14 insertions(+), 7 deletions(-)
---
diff --git a/src/orca/scripts/web/script.py b/src/orca/scripts/web/script.py
index f3d681dc9..aeb13ee56 100644
--- a/src/orca/scripts/web/script.py
+++ b/src/orca/scripts/web/script.py
@@ -2142,6 +2142,11 @@ class Script(default.Script):
debug.println(debug.LEVEL_INFO, msg, True)
return True
+ if self.utilities.eventIsSpinnerNoise(event):
+ msg = "WEB: Ignoring: Event believed to be spinner noise"
+ debug.println(debug.LEVEL_INFO, msg, True)
+ return True
+
if self.utilities.textEventIsForNonNavigableTextObject(event):
msg = "WEB: Ignoring event for non-navigable text object"
debug.println(debug.LEVEL_INFO, msg, True)
diff --git a/src/orca/scripts/web/script_utilities.py b/src/orca/scripts/web/script_utilities.py
index 9cfdd557d..d5fca8bcb 100644
--- a/src/orca/scripts/web/script_utilities.py
+++ b/src/orca/scripts/web/script_utilities.py
@@ -3623,18 +3623,20 @@ class Utilities(script_utilities.Utilities):
if not self.inDocumentContent(obj):
return False
- # TODO - JD: Ideally, things that look and act like spinners (such number inputs)
- # would look and act like platform native spinners. That's not true for Gecko. And
- # the only thing that's funkier is what we get from WebKitGtk. Try to at least get
- # the two engines into alignment before migrating Epiphany support to the web script.
- if obj.getState().contains(pyatspi.STATE_EDITABLE) \
- and obj.parent.getRole() == pyatspi.ROLE_SPIN_BUTTON:
+ if not obj.getState().contains(pyatspi.STATE_EDITABLE):
+ return False
+
+ if pyatspi.ROLE_SPIN_BUTTON in [obj.getRole(), obj.parent.getRole()]:
return True
return False
def eventIsSpinnerNoise(self, event):
- if event.type.startswith("object:text-changed") and self.isSpinnerEntry(event.source):
+ if not self.isSpinnerEntry(event.source):
+ return False
+
+ if event.type.startswith("object:text-changed") \
+ or event.type.startswith("object:text-selection-changed"):
lastKey, mods = self.lastKeyAndModifiers()
if lastKey in ["Down", "Up"]:
return True
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]