Loading toolkit/content/widgets/moz-toggle/moz-toggle.mjs +17 −3 Original line number Diff line number Diff line Loading @@ -51,6 +51,22 @@ export default class MozToggle extends MozBaseInputElement { inputTemplate() { const { pressed, disabled, ariaLabel, handleClick } = this; let ariaDescription = undefined; if (!this.hasDescription) { ariaDescription = this.ariaDescription; if ( !ariaDescription && this.title && this.title !== (ariaLabel || this.label) ) { // 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 (ariaLabel || this.label). ariaDescription = this.title; } } return html`<button id="input" part="button" Loading @@ -62,9 +78,7 @@ export default class MozToggle extends MozBaseInputElement { aria-pressed=${pressed} aria-label=${ifDefined(ariaLabel ?? undefined)} aria-describedby="description" aria-description=${ifDefined( this.hasDescription ? undefined : this.ariaDescription )} aria-description=${ifDefined(ariaDescription)} accesskey=${ifDefined(this.accessKey)} @click=${handleClick} ></button>`; Loading Loading
toolkit/content/widgets/moz-toggle/moz-toggle.mjs +17 −3 Original line number Diff line number Diff line Loading @@ -51,6 +51,22 @@ export default class MozToggle extends MozBaseInputElement { inputTemplate() { const { pressed, disabled, ariaLabel, handleClick } = this; let ariaDescription = undefined; if (!this.hasDescription) { ariaDescription = this.ariaDescription; if ( !ariaDescription && this.title && this.title !== (ariaLabel || this.label) ) { // 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 (ariaLabel || this.label). ariaDescription = this.title; } } return html`<button id="input" part="button" Loading @@ -62,9 +78,7 @@ export default class MozToggle extends MozBaseInputElement { aria-pressed=${pressed} aria-label=${ifDefined(ariaLabel ?? undefined)} aria-describedby="description" aria-description=${ifDefined( this.hasDescription ? undefined : this.ariaDescription )} aria-description=${ifDefined(ariaDescription)} accesskey=${ifDefined(this.accessKey)} @click=${handleClick} ></button>`; Loading