Accessibility: text interface is exposed for every accessible item
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 2/5
- 見積もり時間
- 1〜3時間
- 初心者へのやさしさ
- 85/100
- issue の種類
- バグ
- 明瞭さ
- 明確に書かれている
- 活発さ
- 活発
- 技術スタック
- cpp
調査の方向性
framework/accessibility/internal/accessibleiteminterface.cpp の AccessibleItemInterface::interface_cast から始め、関連する Windows UI Automation と AT-SPI の動作を確認します。EditableText 項目だけが Text interface を公開し、ボタン、リスト項目、グループ、その他のテキスト以外の要素は Text pattern を報告しなくなっていることを確認してください。
索引モデルが issue の本文から書いたものです。
説明
Issue type
Bug (accessibility, all platforms; most visible on Windows through UI Automation)
Description
Every accessible item in the framework exposes a text interface, whatever its role. Buttons, check boxes, list items, groups and non-text score elements all report that they are text.
Qt decides per platform whether an element is a text control by asking the accessible interface for its text interface. On Windows, the UI Automation backend offers the Text pattern to assistive technology exactly when that call returns a non-null pointer (QWindowsUiaMainProvider::GetPatternProvider, case UIA_TextPatternId). The AT-SPI backend on Linux uses the same call to add the Text interface to every element.
The framework's AccessibleItemInterface::interface_cast returns the text interface unconditionally:
As a result every control reports IsTextPatternAvailable = true in UIA. For non-text controls the exposed text document is empty, because the item's text hooks return an empty string and a character count of zero.
Screen readers such as NVDA treat any element with a Text pattern as a text container. Buttons and list items then behave like empty text documents instead of like buttons and list items: text review, braille routing and caret tracking operate on an empty document instead of on the control's name.
Steps to reproduce
- Start MuseScore Studio on Windows.
- Open Accessibility Insights for Windows or Inspect.exe.
- Move keyboard focus to any button, or to an item in a list.
- Look at the patterns reported for the focused element.
Expected: no Text pattern on a button or list item.
Actual: IsTextPatternAvailable is true, and the Text pattern's document range is empty.
Root cause
The unconditional branch dates from the commit that added screen reader access to score text (musescore/MuseScore#10371). It was never restricted to text items. It did not need to be unconditional: score text elements already register with the EditableText role (TextBase::createAccessible), and the only QML consumer of the accessible.text property is the braille view, which also uses EditableText.
Qt's own reference implementation for Quick items limits the text interface to text roles (QAccessibleQuickItem::interface_cast returns it only for EditableText, StaticText and Heading).
Proposed fix
Return the text interface only when the framework role of the item is EditableText. The check must use the framework role, not the Qt role. On Windows the framework maps Group, Information and ElementOnScore to QAccessible::StaticText, so a check on the Qt role would still leak the Text pattern to every non-text score element.
if (type == QAccessible::InterfaceType::ValueInterface && itemRole == QAccessible::Slider) {
return static_cast<QAccessibleValueInterface*>(this);
- } else if (type == QAccessible::InterfaceType::TextInterface) {
+ } else if (type == QAccessible::InterfaceType::TextInterface
+ && m_object->item()->accessibleRole() == IAccessible::Role::EditableText) {
return static_cast<QAccessibleTextInterface*>(this);
}
StaticText is deliberately left out. No item with that role sets accessible text today, so including it would keep exposing empty text documents on labels.
The comment at lines 542 and 547 says "Without Action and Text interfaces NVDA doesn't work" for list items. That comment was added a year after the text interface became unconditional, so the Text half of that claim was never observed in isolation. NVDA announces UIA list items from their Name property and does not need a Text pattern for that.
- 主要言語
- C++
- スター
- 14
- フォーク
- 79
- 平均マージ
- 1日 14時間
- マージ済み PR(30日)
- 43
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドなし
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
musescore/muse_framework のほかの issue
-
Untranslated texts再び着手できるかも このイシューのプルリクエストはマージされずにクローズされました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
musescore/muse_framework#110 ·
メンテナーはふだん 1 日以内に返信
-
The ColorPicker component does not indicate whether you picked a color with alpha.対応中かも @woldaker が 13 日前に担当しました。 オープン
難易度 1/5 1時間未満 初心者へのやさしさ 10/100
musescore/muse_framework#434 ·
メンテナーはふだん 1 日以内に返信
-
難易度 5/5 1週間以上 初心者へのやさしさ 35/100
musescore/muse_framework#417 · コメント 8 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 4/5 3〜5日 初心者へのやさしさ 52/100
musescore/muse_framework#405 ·
メンテナーはふだん 1 日以内に返信
-
ExpressionContext equality ignores the other velocity override対応中かも @0xMashiro が 36 日前に担当しました。 オープン
難易度 1/5 1時間未満 初心者へのやさしさ 45/100
musescore/muse_framework#381 ·
メンテナーはふだん 1 日以内に返信
musescore/muse_framework の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
compiler-explorer/compiler-explorer#9738 ·
メンテナーはふだん 2 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
メンテナーはふだん 1 日以内に返信
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
メンテナーはふだん 1 日以内に返信