[orca] Do not generate ancestors for inline iframe descendants
- From: Joanmarie Diggs <joanied src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [orca] Do not generate ancestors for inline iframe descendants
- Date: Tue, 4 Feb 2020 00:34:17 +0000 (UTC)
commit ba32db29746c2d7432ca8bd44479bbff4d4b1f93
Author: Joanmarie Diggs <jdiggs igalia com>
Date: Mon Feb 3 19:30:43 2020 -0500
Do not generate ancestors for inline iframe descendants
We see inline iframes for things such as an embedded Facebook like
button. While the ancestry might be there, it typically doesn't make
sense to the user.
src/orca/scripts/web/script_utilities.py | 22 ++++++++++++++++++++++
src/orca/scripts/web/speech_generator.py | 7 +++++++
2 files changed, 29 insertions(+)
---
diff --git a/src/orca/scripts/web/script_utilities.py b/src/orca/scripts/web/script_utilities.py
index b59e62814..667a37c1a 100644
--- a/src/orca/scripts/web/script_utilities.py
+++ b/src/orca/scripts/web/script_utilities.py
@@ -87,6 +87,7 @@ class Utilities(script_utilities.Utilities):
self._isEditableComboBox = {}
self._isEditableDescendantOfComboBox = {}
self._isErrorMessage = {}
+ self._isInlineIframeDescendant = {}
self._isInlineListItem = {}
self._isInlineListDescendant = {}
self._isLandmark = {}
@@ -168,6 +169,7 @@ class Utilities(script_utilities.Utilities):
self._isEditableComboBox = {}
self._isEditableDescendantOfComboBox = {}
self._isErrorMessage = {}
+ self._isInlineIframeDescendant = {}
self._isInlineListItem = {}
self._isInlineListDescendant = {}
self._isLandmark = {}
@@ -2169,6 +2171,26 @@ class Utilities(script_utilities.Utilities):
return 'suggestion' in self._getXMLRoles(obj)
+ def isInlineIframe(self, obj):
+ if not (obj and obj.getRole() == pyatspi.ROLE_INTERNAL_FRAME):
+ return False
+
+ displayStyle = self._getDisplayStyle(obj)
+ return "inline" in displayStyle
+
+ def isInlineIframeDescendant(self, obj):
+ if not obj:
+ return False
+
+ rv = self._isInlineIframeDescendant.get(hash(obj))
+ if rv is not None:
+ return rv
+
+ ancestor = pyatspi.findAncestor(obj, self.isInlineIframe)
+ rv = ancestor is not None
+ self._isInlineIframeDescendant[hash(obj)] = rv
+ return rv
+
def isInlineSuggestion(self, obj):
if not self.isContentSuggestion(obj):
return False
diff --git a/src/orca/scripts/web/speech_generator.py b/src/orca/scripts/web/speech_generator.py
index bf4369f90..3b732ed4f 100644
--- a/src/orca/scripts/web/speech_generator.py
+++ b/src/orca/scripts/web/speech_generator.py
@@ -49,12 +49,19 @@ class SpeechGenerator(speech_generator.SpeechGenerator):
if args.get('index', 0) > 0:
return []
+ priorObj = args.get('priorObj')
+ if self._script.utilities.isInlineIframeDescendant(priorObj):
+ return []
+
return super()._generateOldAncestors(obj, **args)
def _generateNewAncestors(self, obj, **args):
if args.get('index', 0) > 0:
return []
+ if self._script.utilities.isInlineIframeDescendant(obj):
+ return []
+
return super()._generateNewAncestors(obj, **args)
def _generateAncestors(self, obj, **args):
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]