Details
-
Bug
-
Resolution: Fixed
-
P2: Important
-
6.5
-
None
-
-
f5358e593 (dev), b8fb12038 (dev)
Description
IAccessible2 and AT-SPI have (among others) relations FLOWS_FROM and FLOWS_TO that can be used to describe logical content flow beyond the a11y hierarchy.
Quoting the AT-SPI doc ( https://docs.gtk.org/atspi2/enum.RelationType.html ) for
ATSPI_RELATION_FLOWS_TO:
"Object renders content which flows logically to another object. For instance, text in a paragraph may flow to another object which is not the ‘next sibling’ in the accessibility hierarchy."
Among others, the Orca screen reader on Linux makes use of those relations (e.g. to access off-screen items in LibreOffice Writer).
However, Qt currently does not provide any way for Qt applications to expose those relations to AT-SPI.
Sample steps to reproduce with the Qt 6 based UI variant of LibreOffice:
1) open attached document "three_paragraphs.odt" in the Qt 6 based variant of LibreOffice Writer
2) run the attached pyatspi script that selects the a11y object of the second paragraph in the Writer document and prints all of its relations
$ python3 pyatspi-script-contentflowsfrom-contentflowsto.py
Actual result:
No relations are printed
$ python3 pyatspi-script-contentflowsfrom-contentflowsto.py 0 relations:
Expected result:
The paragraph should have the FLOWS_FROM and FLOWS_TO relations set to the previous (first) and subsequent (third) paragraph, as is the case for the gtk3 variant of LibreOffice:
$ python3 pyatspi-script-contentflowsfrom-contentflowsto.py 2 relations: - <enum ATSPI_RELATION_FLOWS_FROM of type Atspi.RelationType> - target: [paragraph | ], text: First paragraph - <enum ATSPI_RELATION_FLOWS_TO of type Atspi.RelationType> - target: [paragraph | ], text: Third paragraph
The relevant place in LibreOffice code where the mapping from LibreOffice's internal relation types (also based on IAccessible2) to Qt's (which then does the mapping to AT-SPI) is here:
https://git.libreoffice.org/core/+/2523b5451507c53bb3a10350e016651db82eb1d1/vcl/qt5/QtAccessibleWidget.cxx#211
However, there is currently no QAccessible::Relation flag that LibreOffice could make use of to expose those relations.