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:
Jared Hirsch
2025-03-26 16:05:55 +00:00
parent 1f15c60a14
commit 9aa640e622
4 changed files with 0 additions and 21 deletions

View File

@@ -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`;

View File

@@ -55,7 +55,6 @@ export class NewProfileCard extends EditProfileCard {
}
async setInitialInput() {
await super.focusInput();
if (RPMGetBoolPref("browser.profiles.profile-name.updated", false)) {
return;
}

View File

@@ -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");

View File

@@ -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"));