keyboard
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseKeyboard
键盘
This skill puts the mouse away and walks a running page with keys alone. It records every focus stop in order and returns a numbered report of what the keyboard cannot reach, see or operate.
此 skill 收起鼠标,仅使用按键遍历正在运行的页面。它按顺序记录每个焦点停靠点,并返回一份带编号的报告,列出键盘无法到达、看见或操作的控件。
Every stop pressed, never read from the code
逐一按下每个停靠点,绝不读取代码推断
Focus order, reach and operation are judged from keys pressed in the running page. A stop the walk did not press is , never assumed. One unreachable control is a finding however minor the control.
Not verifiedHow the focus ring looks, dialog focus traps and accessible names belong to , and a failure there cites its id. Opening the running result belongs to . Forcing hidden states open belongs to .
defaultsverifylab焦点顺序、可达性和可操作性均根据在正在运行的页面中实际按下的按键来判断。遍历时未按下的停靠点一律标为 ,绝不做任何假设。任何不可达的控件,无论多么轻微,都算一个发现。
Not verified焦点环的外观、对话框焦点陷阱和可访问名称属于 ,其中出现失败时应引用相应的 id。运行结果中的打开操作属于 。强制打开隐藏状态属于 。
defaultsverifylab1. Load the recorder
1. 加载记录器
Open the page at the state the user named and click nothing. Run tabstops.js through the browser's evaluate call. It returns pointer targets with no keyboard way in, then records each stop as keys are pressed. Judging order or reach from the markup is .
keyboard-press-the-keysSend keys through trusted input, such as Playwright's or the operating system. A dispatched DOM never moves focus, so a walk with no stops means the keys never arrived.
keyboard.pressKeyboardEvent在用户指定的状态打开页面,不点击任何内容。通过浏览器的 evaluate 调用运行 tabstops.js。它先返回只能通过指针访问、无法通过键盘进入的目标,随后在按键过程中记录每一个停靠点。如果根据标记代码判断顺序或可达性,则属于 。
keyboard-press-the-keys通过 trusted input 发送按键,例如使用 Playwright 的 ,或通过操作系统发送。派发的 DOM 不会移动焦点,因此若一次遍历没有产生任何停靠点,就说明按键从未送达。
keyboard.pressKeyboardEvent2. Walk forward, then back
2. 向前遍历,再向后遍历
Press Tab from the top of the page until focus leaves it, then Shift+Tab back to the start. Read and call .
window.__keyboard.stopswindow.__keyboard.highlight()Stops follow the reading order of the layout. A jump from the header to the footer and back, or any positive , is .
tabindexkeyboard-order-follows-layoutEvery stop shows an indicator on screen. A stop with no visible ring is . Focus landing on links inside a closed drawer is . A stop with no name cites .
keyboard-see-every-stopkeyboard-no-hidden-stopsdefaults-name-icon-buttonsWhen navigation comes before the main content, the first stop is a skip link to it. Twenty header stops before the first result is .
keyboard-skip-link从页面顶部按 Tab,直到焦点移出页面,再按 Shift+Tab 返回起点。读取 并调用 。
window.__keyboard.stopswindow.__keyboard.highlight()停靠点应遵循布局的阅读顺序。从页眉跳到页脚再返回,或存在任何正数 ,均属于 。
tabindexkeyboard-order-follows-layout每个停靠点都会在屏幕上显示指示标记。没有可见焦点环的停靠点属于 。焦点落在已关闭抽屉内的链接上属于 。停靠点没有名称时,引用 。
keyboard-see-every-stopkeyboard-no-hidden-stopsdefaults-name-icon-buttons当导航位于主要内容之前时,第一个停靠点应是通往主要内容的 skip link。在找到第一个结果之前出现二十个页眉停靠点,属于 。
keyboard-skip-link3. Reach every control
3. 到达每一个控件
Compare the stops against what the page shows and against the recorder's list. A clickable the walk never lands on is .
unreachabledivkeyboard-reach-every-control将停靠点同页面显示的内容及记录器的 列表进行对比。遍历从未落在某个可点击 上,属于 。
unreachabledivkeyboard-reach-every-control4. Operate each control
4. 操作每一个控件
Enter and Space press buttons, Enter follows links and Space toggles checkboxes and switches. A control that answers a click but no key is .
keyboard-operate-every-controlMenus, tabs, radio groups, listboxes and grids take one Tab stop, and arrows move inside them. A menu where every item is its own Tab stop is .
keyboard-arrows-inside-compositesEscape closes the open menu, popover, sheet or dialog. An overlay that only a click can close is .
keyboard-escape-closes使用 Enter 和 Space 可激活按钮;Enter 可跟随链接,Space 可切换复选框和开关。控件响应点击,却不响应任何按键,属于 。
keyboard-operate-every-controlmenu、tab、radio group、listbox 和 grid 等复合控件只占一个 Tab 停靠点,方向键用于在组件内部移动。如果 menu 中每个项目都是独立的 Tab 停靠点,属于 。
keyboard-arrows-inside-composites按 Escape 可关闭已打开的 menu、popover、sheet 或 dialog。只能通过点击关闭的 overlay 属于 。
keyboard-escape-closes5. Open and close each overlay
5. 打开并关闭每一个浮层
Open each dialog, menu and popover from the keyboard. Focus moves inside, stays inside a modal and returns to the trigger on close. A failure cites .
defaults-trap-and-return-focus使用键盘打开每一个 dialog、menu 和 popover。焦点移入内部,在 modal 中保持,并在关闭后返回触发元素(trigger)。任一失败均引用 。
defaults-trap-and-return-focus6. Remove something, then find focus
6. 移除内容后,确认焦点位置
Delete a row, dismiss a toast, collapse a section and submit a form from the keyboard. Focus lands on a neighbour, the container or the result. A stop the recorder marks , with focus left on , is .
lostbodykeyboard-focus-survives-removal使用键盘删除一行、关闭 toast、折叠 section 并提交 form。焦点应落到相邻元素、容器或结果上。记录器将某个停靠点标记为 ,且焦点留在 上,属于 。
lostbodykeyboard-focus-survives-removal7. Report the walk
7. 报告遍历结果
Return the stops as a numbered list of role and name, with the screenshot showing the numbers. Cite each finding by its stop number and the key that failed. A finding with no stop and no key is .
highlight()keyboard-numbered-walk将停靠点以 role 和 name 组成的编号列表返回,并提供显示 编号的截图。每个问题均引用其停靠点编号和未生效的按键。如果问题既无停靠点也无按键信息,则属于 。
highlight()keyboard-numbered-walkThe pair
成对对照
Every check is a pair. The broken line sits beside the line that replaces it.
| Rule | Broken | Replacement |
|---|---|---|
| "The markup uses buttons, so it is reachable" | The walk recorded with Tab and Shift+Tab |
| | No positive |
| Stop 7 focused with no visible ring | Stop 7 showing the project's |
| Tab landing on links in the closed drawer | |
| Twenty header stops before the first result | A |
| | |
| A switch that toggles on click only | Space toggles it |
| Eight Tab stops inside one menu | One stop, arrows move between items |
| A popover that closes on outside click only | Escape closes it and focus returns to the trigger |
| Focus on | Focus on the next row |
| "Keyboard support is patchy" | "Stop 12, Space does nothing on |
每项检查都是成对对照:错误示例与替代方案并列。
| 规则 | 错误示例 | 替代方案 |
|---|---|---|
| “标记使用了 button,因此它是可访问的” | 使用 Tab 和 Shift+Tab 记录的遍历结果 |
| | 不使用正数 |
| 停靠点 7 获得焦点,但没有可见焦点环 | 停靠点 7 显示项目的 |
| Tab 落在已关闭抽屉内的链接上 | 抽屉关闭时设置 |
| 在第一个结果之前有二十个页眉停靠点 | 将 |
| | |
| 仅通过点击切换的开关 | 使用 Space 切换 |
| 一个菜单内有八个 Tab 停靠点 | 仅有一个停靠点,使用方向键在项目之间移动 |
| 只能通过点击页面外部关闭的 popover | Escape 关闭它,且焦点返回触发元素 |
| 删除一行后焦点位于 | 焦点位于下一行 |
| “键盘支持不完善” | “停靠点 12,Space 对 |
Reporting
报告
Severity. is a control the keyboard cannot reach or operate, or focus lost to after an action. is a stop out of reading order, a stop with no visible ring or a stop hidden off screen. It is also a composite with a Tab stop per item, or an overlay Escape does not close. is a missing skip link, or a report without numbered stops.
HIGHbodyMEDIUMLOWFormat. One finding per root cause, numbered and citing the stop:
1. file:line - [rule-id] stop N, key, what is wrongCite the recorder's element when the source line is not found. Then a summary. when any remains, otherwise. Mark content inside cross-origin frames as .
Rule | Count | SeverityBlockHIGHApproveNot verified严重性。 是键盘无法到达或操作的控件,或者执行操作后焦点丢失到 的情况。 是停靠点顺序不符合阅读顺序、没有可见焦点环,或停靠点隐藏在屏幕外的情况。复合控件中每个项目各占一个 Tab 停靠点,或 overlay 无法通过 Escape 关闭,也属于 。 是缺少 skip link,或报告未提供编号停靠点。
HIGHbodyMEDIUMMEDIUMLOW格式。 每个根本原因只报告一个问题,并进行编号且引用对应的停靠点:
1. file:line - [rule-id] stop N, key, what is wrong找不到源代码行时,引用记录器中的对应元素。随后附上 汇总。只要仍有任何 ,结论即为 ;否则为 。将跨源 frame 内的内容标记为 。
Rule | Count | SeverityHIGHBlockApproveNot verified