-
Notifications
You must be signed in to change notification settings - Fork 28
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
24 additions
and
27 deletions.
There are no files selected for viewing
5 changes: 2 additions & 3 deletions
5
tests/radiogroup-roving-tabindex/data/js/checkFirstRadioButtonAndSetFocusAfterRadioGroup.js
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,11 +1,10 @@ | ||
// sets the state of the first radio button to checked, and sets focus on a link after the radio group | ||
let radioGroup = testPageDocument.querySelector('[role="radiogroup"]'); | ||
let radios = testPageDocument.querySelectorAll('[role="radio"]'); | ||
radios.forEach(r => { | ||
r.setAttribute('tabindex', '-1'); | ||
r.setAttribute('aria-checked', 'false'); | ||
r.classList.remove('focus'); | ||
}); | ||
radios[0].classList.add('focus'); | ||
radios[0].setAttribute('tabindex', '0'); | ||
radios[0].setAttribute('aria-checked', 'true'); | ||
radioGroup.setAttribute('aria-activedescendant', radios[0].id); | ||
testPageDocument.querySelector('#afterlink').focus(); |
5 changes: 2 additions & 3 deletions
5
tests/radiogroup-roving-tabindex/data/js/checkFirstRadioButtonAndSetFocusBeforeRadioGroup.js
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,12 +1,11 @@ | ||
// sets the state of the first radio button to checked, sets focus on a link before the radio group, and hides the group heading | ||
let radioGroup = testPageDocument.querySelector('[role="radiogroup"]'); | ||
let radios = testPageDocument.querySelectorAll('[role="radio"]'); | ||
radios.forEach(r => { | ||
r.setAttribute('tabindex', '-1'); | ||
r.setAttribute('aria-checked', 'false'); | ||
r.classList.remove('focus'); | ||
}); | ||
radios[0].classList.add('focus'); | ||
radios[0].setAttribute('tabindex', '0'); | ||
radios[0].setAttribute('aria-checked', 'true'); | ||
radioGroup.setAttribute('aria-activedescendant', radios[0].id); | ||
testPageDocument.querySelector('#beforelink').focus(); | ||
testPageDocument.querySelector('#group_label_1').style.display = 'none'; |
5 changes: 2 additions & 3 deletions
5
tests/radiogroup-roving-tabindex/data/js/checkThirdRadioButtonAndSetFocusAfterRadioGroup.js
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,11 +1,10 @@ | ||
// sets the state of the third radio button to checked, and sets focus on a link after the radio group | ||
let radioGroup = testPageDocument.querySelector('[role="radiogroup"]'); | ||
let radios = testPageDocument.querySelectorAll('[role="radio"]'); | ||
radios.forEach(r => { | ||
r.setAttribute('tabindex', '-1'); | ||
r.setAttribute('aria-checked', 'false'); | ||
r.classList.remove('focus'); | ||
}); | ||
radios[2].classList.add('focus'); | ||
radios[2].setAttribute('tabindex', '0'); | ||
radios[2].setAttribute('aria-checked', 'true'); | ||
radioGroup.setAttribute('aria-activedescendant', radios[2].id); | ||
testPageDocument.querySelector('#afterlink').focus(); |
6 changes: 3 additions & 3 deletions
6
tests/radiogroup-roving-tabindex/data/js/setFocusOnAndCheckFirstRadioButton.js
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,11 +1,11 @@ | ||
// sets focus on the first radio button, and sets its state to checked | ||
let radioGroup = testPageDocument.querySelector('[role="radiogroup"]'); | ||
let radios = testPageDocument.querySelectorAll('[role="radio"]'); | ||
radios.forEach(r => { | ||
r.setAttribute('tabindex', '-1'); | ||
r.setAttribute('aria-checked', 'false'); | ||
r.classList.remove('focus'); | ||
}); | ||
radios[0].classList.add('focus'); | ||
radios[0].setAttribute('tabindex', '0'); | ||
radios[0].setAttribute('aria-checked', 'true'); | ||
radioGroup.setAttribute('aria-activedescendant', radios[0].id); | ||
radioGroup.focus(); | ||
radios[0].focus(); |
6 changes: 3 additions & 3 deletions
6
tests/radiogroup-roving-tabindex/data/js/setFocusOnFirstRadioButton.js
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,11 +1,11 @@ | ||
// sets focus on the first radio button | ||
let radioGroup = testPageDocument.querySelector('[role="radiogroup"]'); | ||
let radios = testPageDocument.querySelectorAll('[role="radio"]'); | ||
radios.forEach(r => { | ||
r.setAttribute('tabindex', '-1'); | ||
r.setAttribute('aria-checked', 'false'); | ||
r.classList.remove('focus'); | ||
}); | ||
radios[0].classList.add('focus'); | ||
radioGroup.setAttribute('aria-activedescendant', radios[0].id); | ||
radios[0].setAttribute('tabindex', '0'); | ||
testPageDocument.querySelector('#group_label_1').style.display = 'none'; | ||
radioGroup.focus(); | ||
radios[0].focus(); |
6 changes: 3 additions & 3 deletions
6
...radiogroup-roving-tabindex/data/js/setFocusOnFirstRadioButtonAndCheckSecondRadioButton.js
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,11 +1,11 @@ | ||
// sets focus on the first radio button, and checks the second radio button | ||
let radioGroup = testPageDocument.querySelector('[role="radiogroup"]'); | ||
let radios = testPageDocument.querySelectorAll('[role="radio"]'); | ||
radios.forEach(r => { | ||
r.setAttribute('tabindex', '-1'); | ||
r.setAttribute('aria-checked', 'false'); | ||
r.classList.remove('focus'); | ||
}); | ||
radios[0].classList.add('focus'); | ||
radios[0].setAttribute('tabindex', '0'); | ||
radios[1].setAttribute('aria-checked', 'true'); | ||
radioGroup.setAttribute('aria-activedescendant', radios[0].id); | ||
radioGroup.focus(); | ||
radios[0].focus(); |
6 changes: 3 additions & 3 deletions
6
tests/radiogroup-roving-tabindex/data/js/setFocusOnSecondRadioButton.js
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,10 +1,10 @@ | ||
// sets focus on the second radio button | ||
let radioGroup = testPageDocument.querySelector('[role="radiogroup"]'); | ||
let radios = testPageDocument.querySelectorAll('[role="radio"]'); | ||
radios.forEach(r => { | ||
r.setAttribute('tabindex', '-1'); | ||
r.setAttribute('aria-checked', 'false'); | ||
r.classList.remove('focus'); | ||
}); | ||
radios[1].classList.add('focus'); | ||
radioGroup.setAttribute('aria-activedescendant', radios[1].id); | ||
radioGroup.focus(); | ||
radios[1].setAttribute('tabindex', '0'); | ||
radios[1].focus(); |
6 changes: 3 additions & 3 deletions
6
...radiogroup-roving-tabindex/data/js/setFocusOnSecondRadioButtonAndCheckFirstRadioButton.js
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,11 +1,11 @@ | ||
// sets focus on the second radio button, and checks the first radio button | ||
let radioGroup = testPageDocument.querySelector('[role="radiogroup"]'); | ||
let radios = testPageDocument.querySelectorAll('[role="radio"]'); | ||
radios.forEach(r => { | ||
r.setAttribute('tabindex', '-1'); | ||
r.setAttribute('aria-checked', 'false'); | ||
r.classList.remove('focus'); | ||
}); | ||
radios[1].classList.add('focus'); | ||
radios[1].setAttribute('tabindex', '0'); | ||
radios[0].setAttribute('aria-checked', 'true'); | ||
radioGroup.setAttribute('aria-activedescendant', radios[1].id); | ||
radioGroup.focus(); | ||
radios[1].focus(); |
6 changes: 3 additions & 3 deletions
6
tests/radiogroup-roving-tabindex/data/js/setFocusOnThirdRadioButton.js
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,10 +1,10 @@ | ||
// sets focus on the third radio button | ||
let radioGroup = testPageDocument.querySelector('[role="radiogroup"]'); | ||
let radios = testPageDocument.querySelectorAll('[role="radio"]'); | ||
radios.forEach(r => { | ||
r.setAttribute('tabindex', '-1'); | ||
r.setAttribute('aria-checked', 'false'); | ||
r.classList.remove('focus'); | ||
}); | ||
radios[2].classList.add('focus'); | ||
radioGroup.setAttribute('aria-activedescendant', radios[2].id); | ||
radioGroup.focus(); | ||
radios[2].setAttribute('tabindex', '0'); | ||
radios[2].focus(); |