Skip to content
Snippets Groups Projects
Commit 8d7768b5 authored by henry's avatar henry Committed by morgan
Browse files

Customize moz-toggle for tor-browser.

parent 865514c9
Branches
Tags
2 merge requests!1202Bug_43099: 2024 YEC Strings,!1136Bug 43085: Rebased alpha onto 128.2.0esr
......@@ -86,6 +86,12 @@ export default class MozToggle extends MozLitElement {
buttonTemplate() {
const { pressed, disabled, description, ariaLabel, handleClick } = this;
// For tor-browser, if we have a title we use it as the aria-description.
// Used for tor-browser#41333.
// Only set the description using the title if it differs from the
// accessible name derived from the label.
const label = ariaLabel || this.label;
const ariaDescription = label === this.title ? undefined : this.title;
return html`
<button
id="moz-toggle-button"
......@@ -95,6 +101,7 @@ export default class MozToggle extends MozLitElement {
?disabled=${disabled}
aria-pressed=${pressed}
aria-label=${ifDefined(ariaLabel ?? undefined)}
aria-description=${ifDefined(ariaDescription ?? undefined)}
aria-describedby=${ifDefined(
description ? "moz-toggle-description" : undefined
)}
......@@ -104,6 +111,7 @@ export default class MozToggle extends MozLitElement {
}
render() {
// TODO: Reimplement labelAlignAfter!
return html`
<link
rel="stylesheet"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment