Bug 1955222 - To improve accessibility for screen reader users, do not autofocus name input on about:newprofile and about:editprofile pages. r=profiles-reviewers,mossop
Differential Revision: https://phabricator.services.mozilla.com/D242956
This commit is contained in:
@@ -140,7 +140,6 @@ export class EditProfileCard extends MozLitElement {
|
||||
this.themes = themes;
|
||||
|
||||
this.setFavicon();
|
||||
this.focusInput();
|
||||
}
|
||||
|
||||
async getUpdateComplete() {
|
||||
@@ -155,13 +154,6 @@ export class EditProfileCard extends MozLitElement {
|
||||
return result;
|
||||
}
|
||||
|
||||
async focusInput() {
|
||||
await this.getUpdateComplete();
|
||||
this.nameInput.focus();
|
||||
this.nameInput.value = "";
|
||||
this.nameInput.value = this.profile.name;
|
||||
}
|
||||
|
||||
setFavicon() {
|
||||
let favicon = document.getElementById("favicon");
|
||||
favicon.href = `chrome://browser/content/profiles/assets/16_${this.profile.avatar}.svg`;
|
||||
|
||||
@@ -55,7 +55,6 @@ export class NewProfileCard extends EditProfileCard {
|
||||
}
|
||||
|
||||
async setInitialInput() {
|
||||
await super.focusInput();
|
||||
if (RPMGetBoolPref("browser.profiles.profile-name.updated", false)) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -123,12 +123,6 @@ add_task(async function test_create_profile_name() {
|
||||
|
||||
await newProfileCard.getUpdateComplete();
|
||||
|
||||
Assert.equal(
|
||||
Services.focus.focusedElement.id,
|
||||
newProfileCard.nameInput.id,
|
||||
"Name input is focused"
|
||||
);
|
||||
|
||||
let nameInput = newProfileCard.nameInput;
|
||||
Assert.equal(nameInput.value, "", "Profile name is empty to start");
|
||||
|
||||
|
||||
@@ -106,12 +106,6 @@ add_task(async function test_edit_profile_name() {
|
||||
|
||||
await editProfileCard.getUpdateComplete();
|
||||
|
||||
Assert.equal(
|
||||
Services.focus.focusedElement.id,
|
||||
editProfileCard.nameInput.id,
|
||||
"Name input is focused"
|
||||
);
|
||||
|
||||
let nameInput = editProfileCard.nameInput;
|
||||
nameInput.value = newProfileName;
|
||||
nameInput.dispatchEvent(new content.Event("input"));
|
||||
|
||||
Reference in New Issue
Block a user