[orca] Don't treat nameless, textless links/static text elements as clickables
- From: Joanmarie Diggs <joanied src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [orca] Don't treat nameless, textless links/static text elements as clickables
- Date: Fri, 15 Nov 2019 16:47:47 +0000 (UTC)
commit 7e8e666e2ba6906a52704fd0e9b4749e39f4475f
Author: Joanmarie Diggs <jdiggs igalia com>
Date: Fri Nov 15 11:42:50 2019 -0500
Don't treat nameless, textless links/static text elements as clickables
Some pages have quite a few nameless, textless objects exposed to us as
links or static-text elements. Chromium seems to filter these out so
users are not spammed by them. Firefox fails to do so.
src/orca/scripts/web/script_utilities.py | 5 +++++
1 file changed, 5 insertions(+)
---
diff --git a/src/orca/scripts/web/script_utilities.py b/src/orca/scripts/web/script_utilities.py
index b7e70eda6..46ba0597e 100644
--- a/src/orca/scripts/web/script_utilities.py
+++ b/src/orca/scripts/web/script_utilities.py
@@ -3030,6 +3030,11 @@ class Utilities(script_utilities.Utilities):
names = self._getActionNames(obj)
rv = "click" in names
+ if rv and not obj.name and "Text" in pyatspi.listInterfaces(obj):
+ string = obj.queryText().getText(0, -1)
+ if not string.strip():
+ rv = obj.getRole() not in [pyatspi.ROLE_STATIC, pyatspi.ROLE_LINK]
+
self._isClickableElement[hash(obj)] = rv
return rv
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]