[orca] Filter out static text leaf nodes when assessing if an object is "simple"
- From: Joanmarie Diggs <joanied src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [orca] Filter out static text leaf nodes when assessing if an object is "simple"
- Date: Tue, 14 Apr 2020 00:31:52 +0000 (UTC)
commit 73db544db62e9fe40eb92ff341dbf29d36abb005
Author: Joanmarie Diggs <jdiggs igalia com>
Date: Mon Apr 13 20:27:33 2020 -0400
Filter out static text leaf nodes when assessing if an object is "simple"
Chromium exposes static text leaf nodes which we try hard to ignore.
The label inference code was failing to ignore them. As a result, some
candidate functional labels were being ignored due to having too many
children.
src/orca/label_inference.py | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
---
diff --git a/src/orca/label_inference.py b/src/orca/label_inference.py
index e188bb444..97846bce2 100644
--- a/src/orca/label_inference.py
+++ b/src/orca/label_inference.py
@@ -149,8 +149,10 @@ class LabelInference:
if not obj:
return False
+ isMatch = lambda x: x and not self._script.utilities.isStaticTextLeaf(x)
+
try:
- children = [child for child in obj]
+ children = [child for child in obj if isMatch(child)]
except (LookupError, RuntimeError):
debug.println(debug.LEVEL_INFO, 'Dead Accessible in %s' % obj, True)
return False
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]