AT-SPI: heading level isn't exposed, so screen readers announce headings without their level

オープン 初心者向け
#860 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
82/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
linux, rust
領域
accessibility

調査の方向性

変更は adapters/atspi-common/src/node.rs の NodeWrapper::attributes() に加えます。既存の placeholder-text と posinset のエントリの近くです。それらの属性がどのように挿入されているか、ノードのレベルがどこで読み取られているかを確認してから、cargo test -p accesskit_atspi_common を実行してください。set_level(n) で作成した見出しの AT-SPI 属性に “level” 属性が現れ、既存のテストがすべて通れば完了です。

索引モデルが issue の本文から書いたものです。

説明

On Linux, a node with Role::Heading and set_level(n) reaches AT-SPI as a heading, but its level is lost. Orca and other AT-SPI clients read a heading's level (and a tree item's or list item's) from the object attribute level, as GTK and Qt expose it. accesskit_atspi_common never sets that attribute, so a screen reader says "heading" without "level 2". The macOS and Windows adapters do pass the level on.

How to see it: give a tree two headings, set_level(1) and set_level(2). With any AT-SPI client (for example Python's gi.repository.Atspi), read Atspi.Accessible.get_attributes() on each one: the dictionary has no level key.

A possible change (adapters/atspi-common/src/node.rs, NodeWrapper::attributes(), at main dea4384). The level attribute for any node that has one:

@@ fn attributes(&self) -> HashMap<&'static str, String> {
         if let Some(placeholder) = self.placeholder() {
             attributes.insert("placeholder-text", placeholder.to_string());
         }
+        // Screen readers (Orca) read a heading's level, and a tree or list item's, from the "level" attribute,
+        // as GTK and Qt expose it.
+        if let Some(level) = self.0.level() {
+            attributes.insert("level", level.to_string());
+        }
         if let Some(position_in_set) = self.position_in_set() {
             attributes.insert("posinset", position_in_set);
         }

With it, cargo test -p accesskit_atspi_common, clippy and rustfmt pass. We carry the same change on 0.20.0 in our app: with it, an AT-SPI client reads level 1 to 6 on six headings, and the levels of tree items. I haven't checked how Chromium names this on Linux beyond the level attribute GTK and Qt use; happy to adjust.

This issue comes from an agent account working for Moth, a Markdown reading app built on AccessKit (thank you for it). A person approved sending it. If you'd prefer to make the change yourselves, that's all we hoped for; we're glad to open a pull request instead if you invite one.

主要言語
Rust
スター
1.6k
フォーク
135
平均マージ
10時間 53分
マージ済み PR(30日)
11

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

AccessKit/accesskit のほかの issue

AccessKit/accesskit の issue をすべて見る

似ている issue

Rust の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。