Keep summaries in browse mode, focus splitters, speak checked tree items
Adopt three current Orca web behaviors: - A native <summary> no longer forces focus mode, so its expanded details can be read without switching back (Orca issue #543). ARIA disclosure buttons keep focus mode. - A focusable separator is a splitter and uses focus mode so arrow keys resize the panes. Static separators stay in browse mode. - Checkable tree items present checked, not checked or partially checked on focus and on state change (Orca issue #777). The web-widgets native proof records Chromium's exposure of each widget. Verified live in Brave with tests/browser-web-widgets.html. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
996685539a
commit
210e949f76
7 files changed
+142
-2
No files matched your search
@@ -88,7 +88,12 @@ func controlValue(snapshot atspi.Snapshot) string {
|
||||
|
||||
func controlStates(snapshot atspi.Snapshot) []string {
|
||||
var states []string
|
||||
switch snapshot.ControlRole() {
|
||||
role := snapshot.ControlRole()
|
||||
if role == "tree item" && snapshot.Checkable {
|
||||
// aria-checked tree items (checkbox trees) report their checked state.
|
||||
role = "check box"
|
||||
}
|
||||
switch role {
|
||||
case "check box", "check menu item":
|
||||
switch {
|
||||
case snapshot.Indeterminate:
|
||||
|
||||
@@ -38,6 +38,10 @@ func TestFocusTextPresentsControlStates(t *testing.T) {
|
||||
{name: "toggle pressed", snapshot: atspi.Snapshot{Name: "Bold", Role: "toggle button", Checked: true}, want: "Bold, toggle button, pressed"},
|
||||
{name: "collapsed item", snapshot: atspi.Snapshot{Name: "Documents", Role: "tree item", Expandable: true}, want: "Documents, tree item, collapsed"},
|
||||
{name: "expanded selected item", snapshot: atspi.Snapshot{Name: "Documents", Role: "tree item", Expandable: true, Expanded: true, Selected: true}, want: "Documents, tree item, expanded, selected"},
|
||||
{name: "checked tree item", snapshot: atspi.Snapshot{Name: "Backups", Role: "tree item", Checkable: true, Checked: true}, want: "Backups, tree item, checked"},
|
||||
{name: "unchecked tree item", snapshot: atspi.Snapshot{Name: "Backups", Role: "tree item", Checkable: true}, want: "Backups, tree item, not checked"},
|
||||
{name: "mixed tree item", snapshot: atspi.Snapshot{Name: "Backups", Role: "tree item", Checkable: true, Indeterminate: true}, want: "Backups, tree item, partially checked"},
|
||||
{name: "plain tree item", snapshot: atspi.Snapshot{Name: "Backups", Role: "tree item"}, want: "Backups, tree item"},
|
||||
{name: "selected menu item", snapshot: atspi.Snapshot{Name: "Open", Role: "menu item", Selected: true}, want: "Open, menu item"},
|
||||
{name: "unchecked generic menu", snapshot: atspi.Snapshot{Name: "Updates", Role: "menu item", Checkable: true}, want: "Updates, check menu item, not checked"},
|
||||
{name: "checked generic menu without marker", snapshot: atspi.Snapshot{Name: "Updates", Role: "menu item", Checked: true}, want: "Updates, check menu item, checked"},
|
||||
@@ -67,6 +71,8 @@ func TestEventTextPresentsOnlyChangedState(t *testing.T) {
|
||||
{name: "checked", event: atspi.NewEvent("object:state-changed:checked", atspi.Snapshot{Name: "Updates", Role: "check box", Checked: true}), want: "checked"},
|
||||
{name: "generic menu checked", event: atspi.NewEvent("object:state-changed:checked", atspi.Snapshot{Name: "Updates", Role: "menu item", Checkable: true, Checked: true}), want: "checked"},
|
||||
{name: "generic menu unchecked without marker", event: atspi.NewEvent("object:state-changed:checked", atspi.Snapshot{Name: "Updates", Role: "menu item"}), want: "not checked"},
|
||||
{name: "tree item checked", event: atspi.NewEvent("object:state-changed:checked", atspi.Snapshot{Name: "Backups", Role: "tree item", Checkable: true, Checked: true}), want: "checked"},
|
||||
{name: "tree item unchecked", event: atspi.NewEvent("object:state-changed:checked", atspi.Snapshot{Name: "Backups", Role: "tree item", Checkable: true}), want: "not checked"},
|
||||
{name: "expanded", event: atspi.NewEvent("object:state-changed:expanded", atspi.Snapshot{Name: "Files", Role: "tree item", Expanded: true}), want: "expanded"},
|
||||
{name: "menu selection omitted", event: atspi.NewEvent("object:state-changed:selected", atspi.Snapshot{Name: "Open", Role: "menu item", Selected: true}), want: ""},
|
||||
{name: "tree selection", event: atspi.NewEvent("object:state-changed:selected", atspi.Snapshot{Name: "Files", Role: "tree item", Selected: true}), want: "selected"},
|
||||
|
||||
Reference in new issue
Block a user