From 0b28e08bfa1910db4e462f5fea8b8dbd69d00e4b Mon Sep 17 00:00:00 2001 From: Volker Hilsheimer Date: Sat, 8 Apr 2023 12:24:46 +0200 Subject: [PATCH] macOS Accessibility: flag all synthetic elements as unignored This saves us a few more roundtrips. For rows and columns we could check if their accessibilityFrame instersects with the table and so ignore rows and columns that are outside of the view, but I'm observing weird corruptions in the list returned by NSAccessibilityUnignoredChildren when ignoring any objects. Task-number: QTBUG-34337 Change-Id: Ia2d13fff463ff26abb39acfceafcfa0761171203 Reviewed-by: Timur Pocheptsov Reviewed-by: Qt CI Bot (cherry picked from commit 6b67c3e7384322ade9ea4b7c4c1be5d5b32779ec) Reviewed-by: Qt Cherry-pick Bot --- src/plugins/platforms/cocoa/qcocoaaccessibilityelement.mm | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/plugins/platforms/cocoa/qcocoaaccessibilityelement.mm b/src/plugins/platforms/cocoa/qcocoaaccessibilityelement.mm index 5beabcc0ba3..d63c0401fde 100644 --- a/src/plugins/platforms/cocoa/qcocoaaccessibilityelement.mm +++ b/src/plugins/platforms/cocoa/qcocoaaccessibilityelement.mm @@ -830,9 +830,10 @@ static void convertLineOffset(QAccessibleTextInterface *text, int *line, int *of // misc - (BOOL)accessibilityIsIgnored { - // Placeholders for cells should never be ignored, but we also - // don't want to generate a QAccessibleInterface for them yet. - if (synthesizedRole == NSAccessibilityCellRole) + // Short-cut for placeholders and synthesized elements. Working around a bug + // that corrups lists returned by NSAccessibilityUnignoredChildren, otherwise + // we could ignore rows and columns that are outside the table. + if (self.isManagedByParent) return false; if (QAccessibleInterface *iface = self.qtInterface)