Bug 1533182 - Add Aria attributes to the carat icons in privacy preferences. r=Gijs,flod
authorErica Wright <ewright@mozilla.com>
Tue, 12 Mar 2019 15:30:12 +0000
changeset 521548 f78cbd4bc0307b5fd000195194022613f9d22fc1
parent 521547 4619f517e391d5bfa81d27936a2d0c080e8a90bc
child 521549 5b275de602ae9ecc7fb93dbaf0252747513a0b11
push id10867
push userdvarga@mozilla.com
push dateThu, 14 Mar 2019 15:20:45 +0000
treeherdermozilla-beta@abad13547875 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersGijs, flod
bugs1533182
milestone67.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1533182 - Add Aria attributes to the carat icons in privacy preferences. r=Gijs,flod Add tooltiptext to create a name attribute in accessibility tools, add an expanded and collapsed state. Differential Revision: https://phabricator.services.mozilla.com/D22723
browser/components/preferences/in-content/privacy.js
browser/components/preferences/in-content/privacy.xul
browser/locales/en-US/browser/preferences/preferences.ftl
--- a/browser/components/preferences/in-content/privacy.js
+++ b/browser/components/preferences/in-content/privacy.js
@@ -611,16 +611,17 @@ var gPrivacyPane = {
         break;
     }
   },
 
   toggleExpansion(e) {
     let carat = e.target;
     carat.classList.toggle("up");
     carat.closest(".content-blocking-category").classList.toggle("expanded");
+    carat.setAttribute("aria-expanded", carat.getAttribute("aria-expanded") === "false");
   },
 
   // HISTORY MODE
 
   /**
    * The list of preferences which affect the initial history mode settings.
    * If the auto start private browsing mode pref is active, the initial
    * history mode would be set to "Don't remember anything".
--- a/browser/components/preferences/in-content/privacy.xul
+++ b/browser/components/preferences/in-content/privacy.xul
@@ -52,17 +52,20 @@
                     preference="browser.contentblocking.category"
                     aria-labelledby="trackingProtectionMenuDesc">
           <vbox id="contentBlockingOptionStandard" class="content-blocking-category">
             <hbox>
               <radio id="standardRadio"
                      value="standard"
                      data-l10n-id="content-blocking-setting-standard"
                      flex="1"/>
-              <button id="standardArrow" class="arrowhead default-content-blocking-ui"/>
+              <button id="standardArrow"
+                      class="arrowhead default-content-blocking-ui"
+                      data-l10n-id="content-blocking-expand-section"
+                      aria-expanded="false"/>
             </hbox>
             <vbox class="indent default-content-blocking-ui">
               <description data-l10n-id="content-blocking-standard-desc"></description>
               <vbox class="content-blocking-extra-information">
                 <vbox class="indent">
                   <hbox class="extra-information-label">
                     <image class="content-blocking-trackers-image"/>
                     <label data-l10n-id="content-blocking-private-trackers"/>
@@ -79,17 +82,20 @@
             </vbox>
           </vbox>
           <vbox id="contentBlockingOptionStrict" class="content-blocking-category">
             <hbox>
               <radio id="strictRadio"
                      value="strict"
                      data-l10n-id="content-blocking-setting-strict"
                      flex="1"/>
-              <button id="strictArrow" class="arrowhead"/>
+              <button id="strictArrow"
+                      class="arrowhead"
+                      data-l10n-id="content-blocking-expand-section"
+                      aria-expanded="false"/>
             </hbox>
             <vbox class="indent">
               <label data-l10n-id="content-blocking-strict-desc"></label>
               <vbox class="content-blocking-extra-information">
                 <vbox class="indent">
                   <hbox class="extra-information-label">
                     <image class="content-blocking-trackers-image"/>
                     <label data-l10n-id="content-blocking-all-windows-trackers"/>
@@ -115,17 +121,20 @@
             </vbox>
           </vbox>
         <vbox id="contentBlockingOptionCustom" class="tracking-protection-ui content-blocking-category">
           <hbox>
             <radio id="customRadio"
                    value="custom"
                    data-l10n-id="content-blocking-setting-custom"
                    flex="1"/>
-            <button id="customArrow" class="arrowhead"/>
+            <button id="customArrow"
+                    class="arrowhead"
+                    data-l10n-id="content-blocking-expand-section"
+                    aria-expanded="false"/>
           </hbox>
           <vbox class="indent">
             <description id="contentBlockingCustomDesc" data-l10n-id="content-blocking-custom-desc"></description>
             <vbox class="content-blocking-extra-information">
               <hbox id="contentBlockingTrackingProtectionExtensionContentLabel"
                     align="center" hidden="true" class="extension-controlled">
                 <description control="contentBlockingDisableTrackingProtectionExtension" flex="1"/>
                 <button id="contentBlockingDisableTrackingProtectionExtension"
--- a/browser/locales/en-US/browser/preferences/preferences.ftl
+++ b/browser/locales/en-US/browser/preferences/preferences.ftl
@@ -864,16 +864,19 @@ content-blocking-option-private =
   .label = Only in Private Windows
   .accesskey = p
 content-blocking-tracking-protection-change-block-list = Change block list
 
 content-blocking-cookies-label =
   .label = Cookies
   .accesskey = C
 
+content-blocking-expand-section = 
+  .tooltiptext = More information
+
 # Cryptomining refers to using scripts on websites that can use a computer’s resources to mine cryptocurrency without a user’s knowledge.
 content-blocking-cryptominers-label =
   .label = Cryptominers
   .accesskey = y
 
 # Browser fingerprinting is a method of tracking users by the configuration and settings information (their "digital fingerprint")
 # that is visible to websites they browse, rather than traditional tracking methods such as IP addresses and unique cookies.
 content-blocking-fingerprinters-label =