Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

Windows: expose a heading's level as UIA HeadingLevel

Đang mở
#840 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
3/5
Thời gian dự kiến
1-2 ngày
Mức phù hợp với người mới
76/100
Loại issue
Tính năng
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
rust
Lĩnh vực
accessibility

Hướng nghiên cứu

Start with adapters/windows/src/node.rs, especially level() and the UIA property table, then read a nearby test in adapters/windows/src/tests/simple.rs. Add coverage for a level-2 heading, a level-12 heading, and a label by reading UIA_HeadingLevelPropertyId through IUIAutomation; done means they report HeadingLevel2, HeadingLevel_None, and HeadingLevel_None respectively, with the Windows test passing.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

Platform: Windows (UI Automation). Version: accesskit_windows 0.34.0 through current main.

Problem

The Windows adapter gives a heading's level to UIA only as UIA_LevelPropertyId and as level= in UIA_AriaPropertiesPropertyId. It never sets UIA_HeadingLevelPropertyId (30173), so every heading reports the default, HeadingLevel_None.

Narrator's heading navigation (scan mode H / Shift+H and the headings list) goes by HeadingLevel. So AccessKit headings are announced as "heading", but Narrator can't move to them or list them.

To reproduce, put a Node::new(Role::Heading) with set_label("Inbox") and set_level(2) in any tree, then read UIA_HeadingLevelPropertyId on it with a UIA client. You get HeadingLevel_None (80050) where you'd expect HeadingLevel2 (80052).

What Chromium does

AXPlatformNodeWin::GetPropertyValueImpl answers UIA_HeadingLevelPropertyId with AXHierarchicalLevelToUIAHeadingLevel(role, hierarchical_level) (ui/accessibility/platform/ax_platform_node_win.cc). For a heading with level 1 to 9 that returns HeadingLevel1 + level - 1. For anything else, including a level above 9 (UIA has no enum value for those), it returns HeadingLevel_None.

Proposed implementation

Only adapters/windows/src/node.rs changes:

  1. A heading_level(&self) -> Option<i32> method next to level(). It returns HeadingLevel1.0 + level - 1 when the role is Role::Heading and level() is in 1..=9, and None otherwise. With None, UIA keeps its default, HeadingLevel_None, which matches Chromium for non-headings and out-of-range levels.
  2. A (UIA_HeadingLevelPropertyId, heading_level) entry in the property table, after (UIA_LevelPropertyId, level).
  3. A test in adapters/windows/src/tests/ built like simple.rs. It reads the property through IUIAutomation for a level-2 heading (HeadingLevel2), a level-12 heading (HeadingLevel_None) and a label (HeadingLevel_None).

The other adapters don't need anything from this. macOS headings are covered separately in #830.

We carry exactly this change as a local patch on 0.34.0, and the test above passes on Windows CI. I can share the diff if that helps.


This issue was drafted with the help of an AI assistant. The behaviour and the Chromium reference were checked against the sources.

Ngôn ngữ chính
Rust
Star
1.5k
Fork
127
Merge trung bình
16 giờ 44 phút
Pull request đã merge (30 ngày)
12

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của AccessKit/accesskit

Tất cả issue của AccessKit/accesskit

Issue tương tự

Thêm issue về Rust

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.