accessibility-auditing
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseAccessibility Auditing
无障碍审计
Audit a web page for accessibility issues using Cursor's built-in browser without external tools.
无需外部工具,使用Cursor内置浏览器审核网页的无障碍问题。
Workflow
工作流程
1. Open the Page
1. 打开页面
Use to open the target URL.
browser_navigate使用打开目标URL。
browser_navigate2. Capture the Accessibility Tree
2. 捕获无障碍树
Use — this returns the aria/accessibility tree of the page. This is the same tree that screen readers use.
browser_snapshot使用——这会返回页面的aria/无障碍树,与屏幕阅读器使用的树一致。
browser_snapshot3. Audit the Tree
3. 审核树结构
Check for these issues:
Missing Labels
- elements with no accessible name (no text, no
button)aria-label - elements with no
imgtextalt - elements with no associated
inputorlabelaria-label - (link) elements with no text content
a - Icon-only buttons missing
aria-label
Semantic HTML
- Clickable or
divelements → should bespanorbuttona - Missing ,
nav,main,headerlandmarksfooter - Headings that skip levels (h1 → h3)
- Lists that aren't using /
ul/olli
Keyboard Navigation
- Interactive elements missing from tab order
- Custom widgets without and keyboard handlers
role - Focus traps in modals (should trap focus, but also allow Escape to close)
- Skip-to-content link missing
ARIA Issues
- on focusable elements
aria-hidden="true" - Invalid values
role - without corresponding collapsible content
aria-expanded - pointing to non-existent IDs
aria-controls
Contrast (use screenshot for visual check)
- Light gray text on white backgrounds
- Placeholder text that's too faint
- Disabled states that are indistinguishable
检查以下问题:
缺失标签
- 无可访问名称的元素(无文本、无
button)aria-label - 无文本的
alt元素img - 无关联或
label的aria-label元素input - 无文本内容的(链接)元素
a - 仅含图标的按钮缺失
aria-label
语义化HTML
- 可点击的或
div元素→应替换为span或buttona - 缺失、
nav、main、header地标元素footer - 标题层级跳跃(如从h1直接到h3)
- 未使用/
ul/ol的列表li
键盘导航
- 交互元素未出现在Tab顺序中
- 自定义组件缺失和键盘处理程序
role - 模态框中的焦点陷阱(应捕获焦点,但也需允许按Escape关闭)
- 缺失“跳转到内容”链接
ARIA问题
- 可聚焦元素上设置了
aria-hidden="true" - 无效的值
role - 存在但无对应的可折叠内容
aria-expanded - 指向不存在的ID
aria-controls
对比度(使用截图进行视觉检查)
- 白色背景上的浅灰色文本
- 占位符文本过于暗淡
- 禁用状态与正常状态难以区分
4. Test Keyboard Navigation
4. 测试键盘导航
Use to simulate Tab key presses and verify:
browser_press- Every interactive element receives focus
- Focus order is logical (top-to-bottom, left-to-right)
- Focus is visible (focus ring or outline)
- Escape closes modals/dropdowns
使用模拟Tab键按下,验证:
browser_press- 所有交互元素都能获得焦点
- 焦点顺序符合逻辑(从上到下、从左到右)
- 焦点可见(焦点环或轮廓)
- 按Escape可关闭模态框/下拉菜单
5. Report
5. 报告
Accessibility Audit:
Critical:
- 3 buttons with no accessible name (header icons)
- Login form inputs missing labels
Warnings:
- Heading levels skip from h1 to h3
- No skip-to-content link
- 2 clickable divs should be buttons
Passed:
- All images have alt text
- Landmarks present (nav, main, footer)
- Focus order is logicalAccessibility Audit:
Critical:
- 3 buttons with no accessible name (header icons)
- Login form inputs missing labels
Warnings:
- Heading levels skip from h1 to h3
- No skip-to-content link
- 2 clickable divs should be buttons
Passed:
- All images have alt text
- Landmarks present (nav, main, footer)
- Focus order is logical6. Fix
6. 修复
For each issue, apply the fix in the source code. Common fixes:
- Add to icon buttons
aria-label="Close" - Wrap inputs in or add
<label>htmlFor - Change to
<div onClick><button> - Add text to images
alt - Fix heading hierarchy
针对每个问题,在源代码中应用修复方案。常见修复:
- 为图标按钮添加
aria-label="Close" - 将输入框包裹在中或添加
<label>属性htmlFor - 将改为
<div onClick><button> - 为图片添加文本
alt - 修正标题层级