forked from chromium/chromium
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
UIA: Fire UIA_AriaPropertiesPropertyId event, part 4/5
- Implemented firing property changed event for UIA_AriaPropertiesPropertyId and associated unit and browser dump tests for the following AriaProperties: - posinset - pressed - readonly - relevant - Added dump test for testing when multiple aria attributes of one element change at once to test the logic for consolidating UIA_AriaPropertiesPropertyId events introduced in part 1 (CL:1574834) - Modified comments on expected behaviors for various aria-*-changed.html dump test files. - Breakdown of UI Automation AriaProperties need to be implemented: atomic [part 1] busy [part 1] channel [part 2] checked [part 1] disabled [part 3] dropeffect [part 2] expanded [part 1] grabbed [part 2] haspopup [part 1] hidden [not implemented] invalid [part 1] level [part 3] live [part 3] multiline [part 1] multiselectable [part 3] posinset [part 4, this cl] pressed [part 4, this cl] readonly [part 4, this cl] relevant [part 4, this cl] required [part 1] secret [part 2] selected [part 1] setsize [part 5] sort [part 5] tabindex [part 2] valuemax [part 5] valuemin [part 5] valuenow [part 5] valuetext [part 5] - Documentation on UI Automation AriaProperties (see the second table's last column for AriaProperties properties): https://docs.microsoft.com/en-us/windows/desktop/WinAuto/uiauto-ariaspecification - Link to part 1, UIA: Fire UIA_AriaPropertiesPropertyId event: CL:1574834 - Link to part 2, UIA: Fire UIA_AriaPropertiesPropertyId event: CL:1576280 - Link to part 3, UIA: Fire UIA_AriaPropertiesPropertyId event: CL:1589100 - Link to part 4, UIA: Fire UIA_AriaPropertiesPropertyId event: CL:1592640 - Link to part 5, UIA: Fire UIA_AriaPropertiesPropertyId event: CL:1591487 Bug: 928949 Change-Id: Ica97e0a3afc850ad323bee25e6a778a073ac055f Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1592640 Reviewed-by: Katie Dektar <katie@chromium.org> Reviewed-by: Ian Prest <iapres@microsoft.com> Commit-Queue: Victor Fei <vicfei@microsoft.com> Cr-Commit-Position: refs/heads/master@{#659565}
- Loading branch information
Showing
24 changed files
with
256 additions
and
23 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
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
4 changes: 4 additions & 0 deletions
4
content/test/data/accessibility/event/aria-posinset-changed-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,4 @@ | ||
AriaProperties changed on role=option, name=Li1 | ||
AriaProperties changed on role=option, name=Li2 | ||
PositionInSet changed on role=option, name=Li1 | ||
PositionInSet changed on role=option, name=Li2 |
2 changes: 2 additions & 0 deletions
2
content/test/data/accessibility/event/aria-posinset-changed-expected-uia-win7.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,2 @@ | ||
AriaProperties changed on role=option, name=Li1 | ||
AriaProperties changed on role=option, name=Li2 |
22 changes: 22 additions & 0 deletions
22
content/test/data/accessibility/event/aria-posinset-changed.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,22 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<body> | ||
<ul role="listbox"> | ||
<li id="li1" role="option">Li1</li> | ||
<li id="li2" role="option" aria-posinset="2">Li2</li> | ||
<li id="li3" role="option" aria-posinset="3">Li3</li> | ||
</ul> | ||
<script> | ||
function go() { | ||
// Set aria-posinset from default calculation '1'->'2'; should fire an event. | ||
document.getElementById('li1').setAttribute('aria-posinset', '2'); | ||
|
||
// Set aria-posinset from '2'->[removed]; should fire an event. | ||
document.getElementById('li2').removeAttribute('aria-posinset'); | ||
|
||
// Set aria-posinset from '3'->'3; should not fire an event. | ||
document.getElementById('li3').setAttribute('aria-posinset', '3'); | ||
} | ||
</script> | ||
</body> | ||
</html> |
4 changes: 4 additions & 0 deletions
4
content/test/data/accessibility/event/aria-pressed-changed-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,4 @@ | ||
AriaProperties changed on role=button, name=button1 | ||
AriaProperties changed on role=button, name=button2 | ||
ToggleToggleState changed on role=button, name=button1 | ||
ToggleToggleState changed on role=button, name=button2 |
6 changes: 6 additions & 0 deletions
6
content/test/data/accessibility/event/aria-readonly-changed-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,6 @@ | ||
AriaProperties changed on role=textbox, name=textarea2 | ||
AriaProperties changed on role=textbox, name=textarea3 | ||
AriaProperties changed on role=textbox, name=textarea4 | ||
ValueIsReadOnly changed on role=textbox, name=textarea2 | ||
ValueIsReadOnly changed on role=textbox, name=textarea3 | ||
ValueIsReadOnly changed on role=textbox, name=textarea4 |
29 changes: 29 additions & 0 deletions
29
content/test/data/accessibility/event/aria-readonly-changed.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,29 @@ | ||
<!-- | ||
@UIA-WIN-DENY:* | ||
@UIA-WIN-ALLOW:AriaProperties* | ||
@UIA-WIN-ALLOW:ValueIsReadOnly* | ||
--> | ||
<!DOCTYPE html> | ||
<html> | ||
<body> | ||
<textarea id="textarea1" aria-label="textarea1">Textarea1</textarea> | ||
<textarea id="textarea2" aria-label="textarea2">Textarea2</textarea> | ||
<textarea id="textarea3" aria-label="textarea3" aria-readonly="true">Textarea3</textarea> | ||
<textarea id="textarea4" aria-label="textarea4" aria-readonly="true">Textarea4</textarea> | ||
<script> | ||
function go() { | ||
// Set aria-readonly default false->false; should not fire an event. | ||
document.getElementById('textarea1').setAttribute('aria-readonly', false); | ||
|
||
// Set aria-readonly from false->true; should fire an event. | ||
document.getElementById('textarea2').setAttribute('aria-readonly', true); | ||
|
||
// Set aria-readonly from true->false; should fire an event. | ||
document.getElementById('textarea3').setAttribute('aria-readonly', false); | ||
|
||
// Set aria-readonly from true->[removed]; should fire an event. | ||
document.getElementById('textarea4').removeAttribute('aria-readonly'); | ||
} | ||
</script> | ||
</body> | ||
</html> |
6 changes: 6 additions & 0 deletions
6
content/test/data/accessibility/event/aria-relevant-changed-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,6 @@ | ||
AriaProperties changed on role=group, name=Div3 | ||
AriaProperties changed on role=group, name=Div4 | ||
AriaProperties changed on role=group, name=Div5 | ||
AriaProperties changed on role=group, name=Div6 | ||
AriaProperties changed on role=group, name=Div7 | ||
AriaProperties changed on role=group, name=Div8 |
52 changes: 52 additions & 0 deletions
52
content/test/data/accessibility/event/aria-relevant-changed.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,52 @@ | ||
<!-- | ||
@UIA-WIN-DENY:* | ||
@UIA-WIN-ALLOW:AriaProperties* | ||
--> | ||
<!DOCTYPE html> | ||
<html> | ||
<body> | ||
<div id="d1" aria-label="Div1">Div1</div> | ||
<div id="d2" aria-label="Div2" aria-live="polite">Div2</div> | ||
<div id="d3" aria-label="Div3" aria-live="polite">Div3</div> | ||
<div id="d4" aria-label="Div4" aria-live="polite">Div4</div> | ||
<div id="d5" aria-label="Div5" aria-live="polite">Div5</div> | ||
<div id="d6" aria-label="Div6" aria-live="polite">Div6</div> | ||
<div id="d7" aria-label="Div7" aria-live="polite" aria-relevant="true">Div7</div> | ||
<div id="d8" aria-label="Div8" aria-live="polite" aria-relevant="true">Div8</div> | ||
<script> | ||
function go() { | ||
// Set aria-relevant from default 'additions text'->'all' on a non-live region; | ||
// should not fire an event. | ||
document.getElementById('d1').setAttribute('aria-relevant', 'all'); | ||
|
||
// Set aria-relevant from default 'additions text'->'additions text'; | ||
// should not fire an event. | ||
document.getElementById('d2').setAttribute('aria-relevant', 'additions text'); | ||
|
||
// Set aria-relevant from default 'additions text'->'additions'; | ||
// should fire an event. | ||
document.getElementById('d3').setAttribute('aria-relevant', 'additions'); | ||
|
||
// Set aria-relevant from default 'additions text'->'all'; | ||
// should fire an event. | ||
document.getElementById('d4').setAttribute('aria-relevant', 'all'); | ||
|
||
// Set aria-relevant from default 'additions text'->'removals'; | ||
// should fire an event. | ||
document.getElementById('d5').setAttribute('aria-relevant', 'removals'); | ||
|
||
// Set aria-relevant from default 'additions text'->'text'; | ||
// should fire an event. | ||
document.getElementById('d6').setAttribute('aria-relevant', 'text'); | ||
|
||
// Set aria-relevant from 'additions'->'additions text'; | ||
// should fire an event. | ||
document.getElementById('d7').setAttribute('aria-relevant', 'additions text'); | ||
|
||
// Set aria-relevant from 'additions'->[removed]; | ||
// should fire an event. | ||
document.getElementById('d8').removeAttribute('aria-relevant'); | ||
} | ||
</script> | ||
</body> | ||
</html> |
3 changes: 3 additions & 0 deletions
3
content/test/data/accessibility/event/multiple-aria-properties-changed-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,3 @@ | ||
AriaProperties changed on role=checkbox, name=checkbox2 | ||
AriaProperties changed on role=checkbox, name=checkbox3 | ||
AriaProperties changed on role=checkbox, name=checkbox4 |
42 changes: 42 additions & 0 deletions
42
content/test/data/accessibility/event/multiple-aria-properties-changed.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,42 @@ | ||
<!-- | ||
@UIA-WIN-DENY:* | ||
@UIA-WIN-ALLOW:AriaProperties* | ||
--> | ||
<!DOCTYPE html> | ||
<form> | ||
<div aria-label="checkbox1" role="checkbox"></div> | ||
<div aria-label="checkbox2" role="checkbox" aria-checked="false" aria-required="false" aria-readonly="false"></div> | ||
<div aria-label="checkbox3" role="checkbox" aria-checked="true" aria-required="true" aria-readonly="true"></div> | ||
<div aria-label="checkbox4" role="checkbox" aria-checked="true" aria-required="true" aria-readonly="true"></div> | ||
</form> | ||
<script> | ||
function go() { | ||
// Tests below modify multiple aria attributes on a single element at | ||
// a time and the expected behavior is to fire UIA_AriaPropertiesPropertyId | ||
// event once rather than multiple times. | ||
|
||
// Multiple aria attributes change, default[false]->false; | ||
// should not fire any event. | ||
document.querySelector('div[aria-label=checkbox1]').setAttribute('aria-checked', false); | ||
document.querySelector('div[aria-label=checkbox1]').setAttribute('aria-required', false); | ||
document.querySelector('div[aria-label=checkbox1]').setAttribute('aria-readonly', false); | ||
|
||
// Multiple aria attributes change, false->true; | ||
// should fire only one event. | ||
document.querySelector('div[aria-label=checkbox2]').setAttribute('aria-checked', true); | ||
document.querySelector('div[aria-label=checkbox2]').setAttribute('aria-required', true); | ||
document.querySelector('div[aria-label=checkbox2]').setAttribute('aria-readonly', true); | ||
|
||
// Multiple aria attributes change, true->false; | ||
// should fire only one event. | ||
document.querySelector('div[aria-label=checkbox3]').setAttribute('aria-checked', false); | ||
document.querySelector('div[aria-label=checkbox3]').setAttribute('aria-required', false); | ||
document.querySelector('div[aria-label=checkbox3]').setAttribute('aria-readonly', false); | ||
|
||
// Multiple aria attributes change, true->removed; | ||
// should fire only one event. | ||
document.querySelector('div[aria-label=checkbox4]').removeAttribute('aria-checked'); | ||
document.querySelector('div[aria-label=checkbox4]').removeAttribute('aria-required'); | ||
document.querySelector('div[aria-label=checkbox4]').removeAttribute('aria-readonly'); | ||
} | ||
</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
Oops, something went wrong.