Commit 8773ae8a authored by henry's avatar henry Committed by Pier Angelo Vendrame
Browse files

Customize moz-toggle for tor-browser.

parent fcd9b1f6
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -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"