[orca] Prevent contenteditable content from being guessed as a functional label
- From: Joanmarie Diggs <joanied src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [orca] Prevent contenteditable content from being guessed as a functional label
- Date: Wed, 7 Feb 2018 15:21:22 +0000 (UTC)
commit 54284c5ee91d11f229ac78193da7b1eb3edf8759
Author: Joanmarie Diggs <jdiggs igalia com>
Date: Wed Feb 7 10:20:40 2018 -0500
Prevent contenteditable content from being guessed as a functional label
src/orca/label_inference.py | 9 +++++++++
1 files changed, 9 insertions(+), 0 deletions(-)
---
diff --git a/src/orca/label_inference.py b/src/orca/label_inference.py
index 5b8342d..b1bf288 100644
--- a/src/orca/label_inference.py
+++ b/src/orca/label_inference.py
@@ -208,6 +208,9 @@ class LabelInference:
pyatspi.ROLE_PUSH_BUTTON]
isWidget = obj.getRole() in widgetRoles
+ if not isWidget and obj.getState().contains(pyatspi.STATE_EDITABLE):
+ isWidget = True
+
self._isWidgetCache[hash(obj)] = isWidget
return isWidget
@@ -406,6 +409,9 @@ class LabelInference:
return None, []
prevObj, start, end, string = prevLine[0]
+ if self._cannotLabel(prevObj):
+ return None, []
+
if string.strip():
x, y, width, height = self._getExtents(prevObj, start, end)
objX, objY, objWidth, objHeight = self._getExtents(obj)
@@ -446,6 +452,9 @@ class LabelInference:
return None, []
nextObj, start, end, string = nextLine[0]
+ if self._cannotLabel(nextObj):
+ return None, []
+
if string.strip():
x, y, width, height = self._getExtents(nextObj, start, end)
objX, objY, objWidth, objHeight = self._getExtents(obj)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]