[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[tor-commits] [Git][tpo/applications/tor-browser][tor-browser-146.0a1-16.0-1] fixup! Customize moz-toggle for tor-browser.



Title: GitLab

henry pushed to branch tor-browser-146.0a1-16.0-1 at The Tor Project / Applications / Tor Browser

Commits:

  • 87c671c6
    by Henry Wilkes at 2025-12-09T17:19:20+00:00
    fixup! Customize moz-toggle for tor-browser.
    
    TB 44419: Re-add the moz-toggle title attribute patch.
    

1 changed file:

Changes:

  • toolkit/content/widgets/moz-toggle/moz-toggle.mjs
    ... ... @@ -51,6 +51,22 @@ export default class MozToggle extends MozBaseInputElement {
    51 51
     
    
    52 52
       inputTemplate() {
    
    53 53
         const { pressed, disabled, ariaLabel, handleClick } = this;
    
    54
    +    let ariaDescription = undefined;
    
    55
    +    if (!this.hasDescription) {
    
    56
    +      ariaDescription = this.ariaDescription;
    
    57
    +      if (
    
    58
    +        !ariaDescription &&
    
    59
    +        this.title &&
    
    60
    +        this.title !== (ariaLabel || this.label)
    
    61
    +      ) {
    
    62
    +        // For tor-browser, if we have a title we use it as the
    
    63
    +        // aria-description. Used for tor-browser#41333.
    
    64
    +        // Only set the description using the title if it differs from the
    
    65
    +        // accessible name derived from the label (ariaLabel || this.label).
    
    66
    +        ariaDescription = this.title;
    
    67
    +      }
    
    68
    +    }
    
    69
    +
    
    54 70
         return html`<button
    
    55 71
           id="input"
    
    56 72
           part="button"
    
    ... ... @@ -62,9 +78,7 @@ export default class MozToggle extends MozBaseInputElement {
    62 78
           aria-pressed=${pressed}
    
    63 79
           aria-label=${ifDefined(ariaLabel ?? undefined)}
    
    64 80
           aria-describedby="description"
    
    65
    -      aria-description=${ifDefined(
    
    66
    -        this.hasDescription ? undefined : this.ariaDescription
    
    67
    -      )}
    
    81
    +      aria-description=${ifDefined(ariaDescription)}
    
    68 82
           accesskey=${ifDefined(this.accessKey)}
    
    69 83
           @click=${handleClick}
    
    70 84
         ></button>`;
    

  • _______________________________________________
    tor-commits mailing list -- tor-commits@xxxxxxxxxxxxxxxxxxxx
    To unsubscribe send an email to tor-commits-leave@xxxxxxxxxxxxxxxxxxxx