summaryrefslogtreecommitdiffstats
path: root/src/core/browser_accessibility_qt.h
diff options
context:
space:
mode:
authorPeter Varga <pvarga@inf.u-szeged.hu>2019-11-12 10:57:12 +0100
committerPeter Varga <pvarga@inf.u-szeged.hu>2020-01-24 12:31:50 +0100
commitffdf7eceed26c99c81accaf1529024bd0bf40f44 (patch)
treea25914e8fa450622d31d146e00cbf8803085ff73 /src/core/browser_accessibility_qt.h
parent08cad56d16ce56a89ae98f6f8a6589d3cc369e6b (diff)
Fix widget accessibility on macOS
macOS Accessibility queries the window for the focused accessibility element. The window forwards the query to the widget with active focus. This widget is the RWHVQtDelegateWidget if a web element is focused in QWebEngineView. Therefore, a QAccessibleWidget interface has been implemented for the RWHVQtDelegateWidget to forward the request to the QWebEngineView. The focused accessibility element expected to be returned by the QAccessibleInterface::focusChild() method. In case of the macOS accessibility backend, it is called by the accessibilityFocusedUIElement() NSAccessibility API function. It expects the focused web accessibility element otherwise VoiceOver won't focus properly. The focused web accessiblity element is looked up by the new BrowserAccessibilityQt::focusChild() method. RenderWidgetHostviewQtDelegateWidget::focusChild() and QWebengineViewAccessible::focusChild() methods have been also implemented to forward it. This patch depends on a focusChild() fix in qtbase: a132e02540 Fix QAccessibleWidget::focusChild() to return focused descendant Microsoft Narrator also uses focusChild() to query the current focused element when it starts but it is still functional without this fix. Task-number: QTBUG-78284 Task-number: QTBUG-81539 Change-Id: I3c4861e58622ccbb5046c60c4efcc19842400a88 Reviewed-by: Michael BrĂ¼ning <michael.bruning@qt.io>
Diffstat (limited to 'src/core/browser_accessibility_qt.h')
-rw-r--r--src/core/browser_accessibility_qt.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/core/browser_accessibility_qt.h b/src/core/browser_accessibility_qt.h
index decfc1e9d..4acac6aa7 100644
--- a/src/core/browser_accessibility_qt.h
+++ b/src/core/browser_accessibility_qt.h
@@ -68,6 +68,7 @@ public:
// navigation, hierarchy
QAccessibleInterface *parent() const override;
QAccessibleInterface *child(int index) const override;
+ QAccessibleInterface *focusChild() const override;
int childCount() const override;
int indexOfChild(const QAccessibleInterface *) const override;