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:

- toolkit/content/widgets/moz-toggle/moz-toggle.mjs


Changes:

=====================================
toolkit/content/widgets/moz-toggle/moz-toggle.mjs
=====================================
@@ -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"
@@ -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>`;



View it on GitLab: 
https://gitlab.torproject.org/tpo/applications/tor-browser/-/commit/87c671c6617fa9be6ba2c74f8eb9822dafb8dc49

-- 
View it on GitLab: 
https://gitlab.torproject.org/tpo/applications/tor-browser/-/commit/87c671c6617fa9be6ba2c74f8eb9822dafb8dc49
You're receiving this email because of your account on gitlab.torproject.org.


_______________________________________________
tor-commits mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to