office-gobmx/vcl/unx
Michael Weghorn 1215e1bcb1 gtk4 a11y: Map paragraph role to Gtk equivalent
Map `css::accessibility::AccessibleRole::PARAGRAPH`
to the new `GTK_ACCESSIBLE_ROLE_PARAGRAPH` role newly
added to Gtk in commit [1]

    commit 9f078bd5c975f33d832b6da71cba2923450d3127
    Author: Michael Weghorn <m.weghorn@posteo.de>
    Date:   Mon Sep 25 10:41:42 2023 +0200

        a11y: Add paragraph role

        Add new GTK_ACCESSIBLE_ROLE_PARAGRAPH role
        for paragraphs.

        ARIA has a paragraph role as well.

        The paragraph role is used e.g. in document editors
        like LibreOffice or web browsers like Firefox.

        According to the ARIA spec [1], naming paragraphs
        is forbidden (§ 5.2.8.6), and the superclass role
        is section.

        This role will be more useful once a way to expose
        the textual data via the AT-SPI Text interface is
        also available (s. issue #5912 [2]).

        [1] https://www.w3.org/TR/wai-aria-1.2/
        [2] https://gitlab.gnome.org/GNOME/gtk/-/issues/5912

With this in place, a Writer paragraph reports the
proper role to AT-SPI.

There's however currently no way to expose the
paragraph text via the AT-SPI Text interface since
Gtk 4 currently lacks the required API for that (s. [2]).

Without this change in place, the paragraph text was
exposed as the accessible name of the a11y object
(see the "for now set GTK_ACCESSIBLE_PROPERTY_LABEL
as a proof of concept" comment in
`lo_accessible_get_property`), but since ARIA does not
allow naming paragraphs and Gtk 4 follows ARIA, this
is no longer the case with the new mapping in place.

But then, I don't see how to have proper a11y
without supporting the Text interface, so that
will be needed at some point anyway.

[1] 9f078bd5c9
[2] https://gitlab.gnome.org/GNOME/gtk/-/issues/5912

Change-Id: I44315754a6376ecc06bee01d16eedb8a769c3d4a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157241
Tested-by: Jenkins
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
2023-09-27 16:00:29 +02:00
..
generic
gtk3
gtk3_kde5
gtk4 gtk4 a11y: Map paragraph role to Gtk equivalent 2023-09-27 16:00:29 +02:00
kf5
kf6
x11