[Bug]: Embedded number/range inputs contribute their `value` attribute, not their current value, to accessible names
Maintainer thường phản hồi trong vòng 1 ngày
Đánh giá
- Độ khó
- 2/5
- Thời gian dự kiến
- 1-3 giờ
- Mức phù hợp với người mới
- 35/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Đặc tả rõ ràng
- Mức độ hoạt động
- Đình trệ
- Công nghệ
- playwright, typescript
- Lĩnh vực
- accessibility, testing
Hướng nghiên cứu
Start in packages/injected/src/roleUtils.ts at the progressbar/scrollbar/slider/spinbutton/meter branch of getTextAlternativeInternal; compare its value handling with the textbox branch above. Reproduce with the supplied test and check existing accessible-name tests for the right place to add coverage. Done means embedded number and range inputs contribute their current values to the containing checkbox names; an open linked pull request (#43985) is already addressing this issue.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Version
1.65.0 (also 1.66.0-alpha-1793916328000)
Steps to reproduce
- Clone https://github.com/trackoor/playwright-accname-range-number-repro
npm install && npx playwright install chromiumnpm test
The test:
import { test, expect } from '@playwright/test';
test('embedded number/range inputs use their current value in accessible names', async ({ page }) => {
await page.setContent(`
<input type="checkbox" id="cb"><label for="cb">Remind me <input type="number" value="3" aria-label="count"> times</label>
<input type="checkbox" id="v"><label for="v">Volume <input type="range" aria-label="vol"> percent</label>
<input type="checkbox" id="w"><label for="w">Level <input type="range" max="10" value="70" aria-label="lvl"> of 10</label>
`);
await page.getByLabel('count').fill('5');
const boxes = page.getByRole('checkbox');
await expect(boxes.nth(0)).toHaveAccessibleName('Remind me 5 times');
await expect(boxes.nth(1)).toHaveAccessibleName('Volume 50 percent');
await expect(boxes.nth(2)).toHaveAccessibleName('Level 10 of 10');
});
Expected behavior
The checkbox names are Remind me 5 times, Volume 50 percent and Level 10 of 10. That is what Chromium itself computes (Accessibility.getFullAXTree over CDP), and the embedded spinbutton/slider in ariaSnapshot() already shows "5", "50" and "10".
Actual behavior
Expected: "Remind me 5 times"
Received: "Remind me 3 times"
page.locator('body').ariaSnapshot() shows all three:
- checkbox "Remind me 3 times"
- text: Remind me
- spinbutton "count": "5"
- text: times
- checkbox "Volume percent"
- text: Volume
- slider "vol": "50"
- text: percent
- checkbox "Level 70 of 10"
- text: Level
- slider "lvl": "10"
- text: of 10
Additional context
In packages/injected/src/roleUtils.ts, the progressbar/scrollbar/slider/spinbutton/meter branch of getTextAlternativeInternal falls back to element.getAttribute('value'). For <input> it should use the .value property, like the textbox branch just above it does. Same line on main at 07c7069.
Environment
System:
OS: Linux (x64)
Binaries:
Node: 26.13.0
npmPackages:
@playwright/test: 1.65.0
Credit: https://ucsbplse.github.io/
- Ngôn ngữ chính
- TypeScript
- Star
- 99.1k
- Fork
- 6.8k
- Merge trung bình
- 17 giờ 6 phút
- Pull request đã merge (30 ngày)
- 306
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Không có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- 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.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của microsoft/playwright
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 76/100
microsoft/playwright#43987 · 3 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 72/100
microsoft/playwright#43986 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 64/100
microsoft/playwright#43983 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 35/100
microsoft/playwright#43981 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
needs-triage
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 30/100
microsoft/playwright#43969 · 2 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của microsoft/playwright
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
backnotprop/plannotator#2914 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
microsoft/vscode-containers#655 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 77/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
dsh-tauri-desk/deepseek-harness-desktop#1477 · 1 bình luận ·