diff --git a/src/cthulhu/scripts/web/script.py b/src/cthulhu/scripts/web/script.py index a9f4341..e482f2b 100644 --- a/src/cthulhu/scripts/web/script.py +++ b/src/cthulhu/scripts/web/script.py @@ -2350,6 +2350,10 @@ class Script(default.Script): if prevDocument != document: tokens = ["WEB: document changed from", prevDocument, "to", document] debug.printTokens(debug.LEVEL_INFO, tokens, True) + elif document == event.source: + msg = "WEB: Ignoring focus change to document ancestor of focus" + debug.printMessage(debug.LEVEL_INFO, msg, True) + return True if self.utilities.isWebAppDescendant(event.source): if self._browseModeIsSticky: diff --git a/src/cthulhu/scripts/web/script_utilities.py b/src/cthulhu/scripts/web/script_utilities.py index 8826ed4..9ebd461 100644 --- a/src/cthulhu/scripts/web/script_utilities.py +++ b/src/cthulhu/scripts/web/script_utilities.py @@ -991,7 +991,7 @@ class Utilities(script_utilities.Utilities): rv = False elif rv and not self.isLiveRegion(obj): - doNotQuery = [Atspi.Role.LIST_BOX] + doNotQuery = [Atspi.Role.LIST_BOX, Atspi.Role.TABLE, Atspi.Role.TABLE_ROW] role = AXObject.get_role(obj) if rv and role in doNotQuery: tokens = ["WEB: Treating", obj, "as non-text due to role."] @@ -1773,6 +1773,7 @@ class Utilities(script_utilities.Utilities): extents = self.getExtents(container, 0, 1) objBanner = AXObject.find_ancestor(obj, self.isLandmarkBanner) + objRow = AXObject.find_ancestor(obj, AXUtilities.is_table_row) def _include(x): if x in objects: @@ -1844,6 +1845,9 @@ class Utilities(script_utilities.Utilities): and firstObj == prevObj: break + if objRow != AXObject.find_ancestor(prevObj, AXUtilities.is_table_row): + break + onLeft = self._getContentsForObj(prevObj, pOffset, boundary) onLeft = list(filter(_include, onLeft)) if not onLeft: @@ -1871,6 +1875,9 @@ class Utilities(script_utilities.Utilities): and lastObj == nextObj: break + if objRow != AXObject.find_ancestor(nextObj, AXUtilities.is_table_row): + break + onRight = self._getContentsForObj(nextObj, nOffset, boundary) if onRight and self._contentIsSubsetOf(objects[0], onRight[-1]): onRight = onRight[0:-1] @@ -4758,6 +4765,10 @@ class Utilities(script_utilities.Utilities): tokens = ["WEB: Landmark can have caret context", obj] debug.printTokens(debug.LEVEL_INFO, tokens, True) rv = True + elif AXUtilities.is_table_related(obj, True): + tokens = ["WEB: Table-related object can have caret context", obj] + debug.printTokens(debug.LEVEL_INFO, tokens, True) + rv = True elif self.isStaticTextLeaf(obj): tokens = ["WEB: Static text leaf cannot have caret context", obj] debug.printTokens(debug.LEVEL_INFO, tokens, True)