-
Notifications
You must be signed in to change notification settings - Fork 6.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add AX Selection Event when an aria selected node is added to the tree.
Currently, when a node whose aria-selected attribute is set to true is added to the tree, no selection event is fired as AXEventGenerator did not have a previous state to compare it to. This causes problems with ATs as they are not notified of this already existing selection. This change fixes this issue by firing a selection event if the aria-selected property is set to true when a new node is added to the tree. Change-Id: I5ad584c07803c6c219c31f0c015deed4326453af AX-Relnotes: n/a. Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4791732 Commit-Queue: Luis Sanchez Padilla <lusanpad@microsoft.com> Reviewed-by: Aaron Leventhal <aleventhal@chromium.org> Cr-Commit-Position: refs/heads/main@{#1188375}
- Loading branch information
Luis Juan Sanchez Padilla
authored and
Chromium LUCI CQ
committed
Aug 25, 2023
1 parent
beb2bf1
commit 3c59aee
Showing
21 changed files
with
268 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 2 additions & 1 deletion
3
content/test/data/accessibility/event/aria-combo-box-delay-show-list-expected-mac.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
AXFocusedUIElementChanged on AXStaticText AXValue='Apple' | ||
AXSelectedChildrenChanged on AXComboBox AXAutocompleteValue='list' | ||
AXSelectedChildrenChanged on AXComboBox AXAutocompleteValue='list' | ||
AXSelectedChildrenChanged on AXList |
3 changes: 3 additions & 0 deletions
3
content/test/data/accessibility/event/aria-combo-box-delay-show-list-expected-win.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,8 @@ | ||
EVENT_OBJECT_FOCUS on <li#op1> role=ROLE_SYSTEM_LISTITEM name="Apple" SELECTED,FOCUSED,FOCUSABLE,SELECTABLE PosInSet=1 SetSize=1 | ||
EVENT_OBJECT_HIDE on <body> role=ROLE_SYSTEM_GROUPING INVISIBLE | ||
EVENT_OBJECT_SELECTION on <li#op1> role=ROLE_SYSTEM_LISTITEM name="Apple" SELECTED,FOCUSED,FOCUSABLE,SELECTABLE PosInSet=1 SetSize=1 | ||
EVENT_OBJECT_SELECTIONWITHIN on <ul#list> role=ROLE_SYSTEM_LIST IA2_STATE_VERTICAL SetSize=1 | ||
EVENT_OBJECT_STATECHANGE on <li#op1> role=ROLE_SYSTEM_LISTITEM name="Apple" SELECTED,FOCUSED,FOCUSABLE,SELECTABLE PosInSet=1 SetSize=1 | ||
IA2_EVENT_ACTIVE_DESCENDANT_CHANGED on <input> role=ROLE_SYSTEM_COMBOBOX EXPANDED,FOCUSABLE,HASPOPUP IA2_STATE_EDITABLE,IA2_STATE_SELECTABLE_TEXT,IA2_STATE_SINGLE_LINE,IA2_STATE_SUPPORTS_AUTOCOMPLETION | ||
IA2_EVENT_TEXT_INSERTED on <#document> role=ROLE_SYSTEM_DOCUMENT value~=[doc-url] FOCUSABLE new_text={'<obj><obj>' start=0 end=2} | ||
IA2_EVENT_TEXT_REMOVED on <#document> role=ROLE_SYSTEM_DOCUMENT value~=[doc-url] FOCUSABLE old_text={'<obj>' start=0 end=1} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
11 changes: 11 additions & 0 deletions
11
...nt/test/data/accessibility/event/aria-selected-changed-new-subtree-expected-auralinux.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
CHILDREN-CHANGED:ADD index:2 CHILD:(role=ROLE_TABLE_CELL) role=ROLE_TABLE_ROW ENABLED,SENSITIVE,SHOWING,VISIBLE | ||
SELECTION-CHANGED role=ROLE_TABLE name='(null)' ENABLED,SENSITIVE,SHOWING,VISIBLE | ||
STATE-CHANGE:SELECTED:TRUE role=ROLE_TABLE_CELL name='Grid, GridCell3' ENABLED,FOCUSABLE,SELECTABLE,SELECTED,SENSITIVE,SHOWING,VISIBLE | ||
=== Start Continuation === | ||
CHILDREN-CHANGED:ADD index:2 CHILD:(role=ROLE_MENU_ITEM) role=ROLE_MENU ENABLED,SENSITIVE | ||
SELECTION-CHANGED role=ROLE_MENU name='(null)' ENABLED,SENSITIVE | ||
STATE-CHANGE:SELECTED:TRUE role=ROLE_MENU_ITEM name='Select, Option3' ENABLED,FOCUSABLE,SELECTABLE,SELECTED,SENSITIVE,SHOWING,VISIBLE | ||
=== Start Continuation === | ||
CHILDREN-CHANGED:ADD index:2 CHILD:(role=ROLE_LIST_ITEM) role=ROLE_LIST_BOX ENABLED,SENSITIVE,SHOWING,VERTICAL,VISIBLE | ||
SELECTION-CHANGED role=ROLE_LIST_BOX name='(null)' ENABLED,SENSITIVE,SHOWING,VERTICAL,VISIBLE | ||
STATE-CHANGE:SELECTED:TRUE role=ROLE_LIST_ITEM name='DivSelect, Option3' ENABLED,SELECTABLE,SELECTED,SENSITIVE,SHOWING,VISIBLE |
6 changes: 6 additions & 0 deletions
6
content/test/data/accessibility/event/aria-selected-changed-new-subtree-expected-mac.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
AXSelectedRowsChanged on AXTable | ||
=== Start Continuation === | ||
AXSelectedChildrenChanged on AXMenu | ||
AXValueChanged on AXPopUpButton AXValue='Select, Option3' | ||
=== Start Continuation === | ||
AXSelectedChildrenChanged on AXList |
24 changes: 24 additions & 0 deletions
24
content/test/data/accessibility/event/aria-selected-changed-new-subtree-expected-uia-win.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
AriaProperties changed on role=gridcell, name=Grid, GridCell1 | ||
AriaProperties changed on role=gridcell, name=Grid, GridCell3 | ||
SelectionItemIsSelected changed on role=gridcell, name=Grid, GridCell1 | ||
SelectionItemIsSelected changed on role=gridcell, name=Grid, GridCell3 | ||
SelectionItem_ElementRemovedFromSelection on role=gridcell, name=Grid, GridCell1 | ||
SelectionItem_ElementSelected on role=gridcell, name=Grid, GridCell3 | ||
StructureChanged/ChildAdded on role=gridcell, name=Grid, GridCell3 | ||
StructureChanged/ChildrenReordered on role=row | ||
=== Start Continuation === | ||
AriaProperties changed on role=listitem, name=Select, Option3 | ||
SelectionItemIsSelected changed on role=listitem, name=Select, Option3 | ||
SelectionItem_ElementSelected on role=listitem, name=Select, Option3 | ||
StructureChanged/ChildAdded on role=listitem, name=Select, Option3 | ||
StructureChanged/ChildrenReordered on role=combobox | ||
Text_TextChanged on role=document | ||
ValueValue changed on role=combobox | ||
=== Start Continuation === | ||
AriaProperties changed on role=option, name=DivSelect, Option1 | ||
AriaProperties changed on role=option, name=DivSelect, Option3 | ||
SelectionItemIsSelected changed on role=option, name=DivSelect, Option1 | ||
SelectionItemIsSelected changed on role=option, name=DivSelect, Option3 | ||
SelectionItem_ElementSelected on role=option, name=DivSelect, Option3 | ||
StructureChanged/ChildAdded on role=option, name=DivSelect, Option3 | ||
StructureChanged/ChildrenReordered on role=listbox |
25 changes: 25 additions & 0 deletions
25
content/test/data/accessibility/event/aria-selected-changed-new-subtree-expected-win.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
EVENT_OBJECT_LOCATIONCHANGE on <table#Grid> role=ROLE_SYSTEM_TABLE | ||
EVENT_OBJECT_REORDER on <tr> role=ROLE_SYSTEM_ROW | ||
EVENT_OBJECT_SELECTION on <td#GridCell1> role=ROLE_SYSTEM_CELL name="Grid, GridCell3" SELECTED,FOCUSABLE,SELECTABLE | ||
EVENT_OBJECT_SELECTIONREMOVE on <td#GridCell1> role=ROLE_SYSTEM_CELL name="Grid, GridCell1" FOCUSABLE,SELECTABLE | ||
EVENT_OBJECT_SELECTIONWITHIN on <table#Grid> role=ROLE_SYSTEM_TABLE | ||
EVENT_OBJECT_SHOW on <td#GridCell1> role=ROLE_SYSTEM_CELL name="Grid, GridCell3" SELECTED,FOCUSABLE,SELECTABLE | ||
EVENT_OBJECT_STATECHANGE on <td#GridCell1> role=ROLE_SYSTEM_CELL name="Grid, GridCell1" FOCUSABLE,SELECTABLE | ||
EVENT_OBJECT_STATECHANGE on <td#GridCell1> role=ROLE_SYSTEM_CELL name="Grid, GridCell3" SELECTED,FOCUSABLE,SELECTABLE | ||
IA2_EVENT_TEXT_INSERTED on <tr> role=ROLE_SYSTEM_ROW new_text={'<obj>' start=2 end=3} | ||
=== Start Continuation === | ||
EVENT_OBJECT_REORDER on role=ROLE_SYSTEM_LIST INVISIBLE SetSize=3 | ||
EVENT_OBJECT_SELECTION on <option#Option3> role=ROLE_SYSTEM_LISTITEM name="Select, Option3" SELECTED,FOCUSABLE,SELECTABLE PosInSet=3 SetSize=3 | ||
EVENT_OBJECT_SELECTIONWITHIN on role=ROLE_SYSTEM_LIST INVISIBLE SetSize=3 | ||
EVENT_OBJECT_SHOW on <option#Option3> role=ROLE_SYSTEM_LISTITEM name="Select, Option3" SELECTED,FOCUSABLE,SELECTABLE PosInSet=3 SetSize=3 | ||
EVENT_OBJECT_STATECHANGE on <option#Option3> role=ROLE_SYSTEM_LISTITEM name="Select, Option3" SELECTED,FOCUSABLE,SELECTABLE PosInSet=3 SetSize=3 | ||
EVENT_OBJECT_VALUECHANGE on <select#Select> role=ROLE_SYSTEM_COMBOBOX value="Select, Option3" COLLAPSED,FOCUSABLE,HASPOPUP SetSize=3 | ||
IA2_EVENT_TEXT_INSERTED on role=ROLE_SYSTEM_LIST INVISIBLE SetSize=3 new_text={'l' start=2 end=3} | ||
=== Start Continuation === | ||
EVENT_OBJECT_REORDER on <div#DivSelect> role=ROLE_SYSTEM_LIST IA2_STATE_VERTICAL SetSize=3 | ||
EVENT_OBJECT_SELECTION on <div#Option3> role=ROLE_SYSTEM_LISTITEM name="DivSelect, Option3" SELECTED,FOCUSED,SELECTABLE PosInSet=3 SetSize=3 | ||
EVENT_OBJECT_SELECTIONWITHIN on <div#DivSelect> role=ROLE_SYSTEM_LIST IA2_STATE_VERTICAL SetSize=3 | ||
EVENT_OBJECT_SHOW on <div#Option3> role=ROLE_SYSTEM_LISTITEM name="DivSelect, Option3" SELECTED,FOCUSED,SELECTABLE PosInSet=3 SetSize=3 | ||
EVENT_OBJECT_STATECHANGE on <div#Option1> role=ROLE_SYSTEM_LISTITEM name="DivSelect, Option1" SELECTABLE PosInSet=1 SetSize=3 | ||
EVENT_OBJECT_STATECHANGE on <div#Option3> role=ROLE_SYSTEM_LISTITEM name="DivSelect, Option3" SELECTED,FOCUSED,SELECTABLE PosInSet=3 SetSize=3 | ||
IA2_EVENT_TEXT_INSERTED on <div#DivSelect> role=ROLE_SYSTEM_LIST IA2_STATE_VERTICAL SetSize=3 new_text={'<obj>' start=2 end=3} |
62 changes: 62 additions & 0 deletions
62
content/test/data/accessibility/event/aria-selected-changed-new-subtree.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
<!DOCTYPE html> | ||
<table id='Grid' role='grid' aria-multiselectable='false'><tbody> | ||
<tr> | ||
<td id='GridCell1' role='gridcell' aria-selected='true' tabindex='0' | ||
onclick='tdclick(this, event)'>Grid, GridCell1</td> | ||
<td id='GridCell2' role='gridcell' aria-selected='false' tabindex='0' | ||
onclick='tdclick(this, event)'>Grid, GridCell2</td> | ||
</tr> | ||
</tbody></table> | ||
<select id='Select'> | ||
<option id='Option1' value='1' selected | ||
onclick='option_click(this, event)'>Select, Option1</option> | ||
<option id='Option2' value='2' | ||
onclick='option_click(this, event)'>Select, Option2</option> | ||
</select> | ||
<div id='DivSelect' role='listbox'> | ||
<div id='Option1' role='option' aria-selected='true' | ||
onclick='div_option_click(this, event)'>DivSelect, Option1</div> | ||
<div id='Option2' role='option' aria-selected='false' | ||
onclick='div_option_click(this, event)'>DivSelect, Option2</div> | ||
</div> | ||
<script> | ||
function grid_select() { | ||
var selected = document.querySelector('td#GridCell1'); | ||
var new_selection = selected.cloneNode(true); | ||
selected.setAttribute('aria-selected', false); | ||
new_selection.innerHTML = 'Grid, GridCell3'; | ||
new_selection.id - 'GridCell3' | ||
selected.parentElement.appendChild(new_selection); | ||
} | ||
|
||
function option_select() { | ||
var selected = document.querySelector('option#Option1'); | ||
var new_selection = selected.cloneNode(true); | ||
selected.selected = false; | ||
new_selection.value = '3'; | ||
new_selection.innerHTML = 'Select, Option3'; | ||
new_selection.id = 'Option3'; | ||
selected.parentElement.appendChild(new_selection); | ||
} | ||
|
||
function div_select() { | ||
var selected = document.querySelector('div#Option1'); | ||
var new_selection = selected.cloneNode(true); | ||
selected.setAttribute('aria-selected', false); | ||
new_selection.innerHTML = 'DivSelect, Option3'; | ||
new_selection.id = 'Option3'; | ||
selected.parentElement.appendChild(new_selection); | ||
} | ||
|
||
const go_passes = [ | ||
() => grid_select(), | ||
() => option_select(), | ||
() => div_select(), | ||
]; | ||
|
||
var current_pass = 0; | ||
function go() { | ||
go_passes[current_pass++].call(); | ||
return current_pass < go_passes.length; | ||
} | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 2 additions & 0 deletions
2
content/test/data/accessibility/event/selectlist-expected-mac.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,7 @@ | ||
AXExpandedChanged on AXComboBox AXDescription='Combobox A' AXValue='Option 1' | ||
AXFocusedUIElementChanged on AXStaticText AXValue='Option 1' | ||
AXSelectedChildrenChanged on AXList | ||
=== Start Continuation === | ||
AXExpandedChanged on AXComboBox AXDescription='Combobox B' AXValue='Option 4' | ||
AXFocusedUIElementChanged on AXStaticText AXValue='Option 4' | ||
AXSelectedChildrenChanged on AXList |
2 changes: 2 additions & 0 deletions
2
content/test/data/accessibility/event/selectlist-expected-win.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,10 @@ | ||
EVENT_OBJECT_FOCUS on <option> role=ROLE_SYSTEM_LISTITEM name="Option 1" SELECTED,FOCUSED,FOCUSABLE,SELECTABLE PosInSet=1 SetSize=3 | ||
EVENT_OBJECT_SHOW on <div> role=ROLE_SYSTEM_LIST IA2_STATE_VERTICAL SetSize=3 | ||
EVENT_OBJECT_STATECHANGE on <div#ButtonA> role=ROLE_SYSTEM_COMBOBOX name="Combobox A" value="Option 1" EXPANDED,HASPOPUP | ||
EVENT_OBJECT_STATECHANGE on <option> role=ROLE_SYSTEM_LISTITEM name="Option 1" SELECTED,FOCUSED,FOCUSABLE,SELECTABLE PosInSet=1 SetSize=3 | ||
=== Start Continuation === | ||
EVENT_OBJECT_FOCUS on <option> role=ROLE_SYSTEM_LISTITEM name="Option 4" SELECTED,FOCUSED,FOCUSABLE,SELECTABLE PosInSet=1 SetSize=3 | ||
EVENT_OBJECT_HIDE on <div> role=ROLE_SYSTEM_LIST IA2_STATE_VERTICAL SetSize=3 | ||
EVENT_OBJECT_SHOW on <div> role=ROLE_SYSTEM_LIST IA2_STATE_VERTICAL SetSize=3 | ||
EVENT_OBJECT_STATECHANGE on <div#ButtonB> role=ROLE_SYSTEM_COMBOBOX name="Combobox B" value="Option 4" EXPANDED,HASPOPUP | ||
EVENT_OBJECT_STATECHANGE on <option> role=ROLE_SYSTEM_LISTITEM name="Option 4" SELECTED,FOCUSED,FOCUSABLE,SELECTABLE PosInSet=1 SetSize=3 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.