Loading toolkit/content/widgets/moz-toggle/moz-toggle.mjs +8 −0 Original line number Diff line number Diff line Loading @@ -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" Loading @@ -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 )} Loading @@ -104,6 +111,7 @@ export default class MozToggle extends MozLitElement { } render() { // TODO: Reimplement labelAlignAfter! return html` <link rel="stylesheet" Loading Loading
toolkit/content/widgets/moz-toggle/moz-toggle.mjs +8 −0 Original line number Diff line number Diff line Loading @@ -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" Loading @@ -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 )} Loading @@ -104,6 +111,7 @@ export default class MozToggle extends MozLitElement { } render() { // TODO: Reimplement labelAlignAfter! return html` <link rel="stylesheet" Loading