Bug 1429442 - Buttons in "type control" popup in reader mode should have tooltips r=Gijs,MarcoZ
authormonikamaheshwari <monikamaheshwari1996@gmail.com>
Mon, 11 Mar 2019 11:47:49 +0000
changeset 463446 a423e8a5526660b0b84c79d9c7b13a0d1987eaff
parent 463445 61ea8dd28af6085caad76987db931ce2df89be68
child 463447 7f359721143c4c41a8c4a4f299abaec0b9f45bac
push id35682
push userrgurzau@mozilla.com
push dateMon, 11 Mar 2019 16:49:48 +0000
treeherdermozilla-central@6f32ec5e62e3 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersGijs, MarcoZ
bugs1429442
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 1429442 - Buttons in "type control" popup in reader mode should have tooltips r=Gijs,MarcoZ Added tooltips in type control for accessibility Differential Revision: https://phabricator.services.mozilla.com/D22679
toolkit/components/reader/AboutReader.jsm
toolkit/locales/en-US/chrome/global/aboutReader.properties
--- a/toolkit/components/reader/AboutReader.jsm
+++ b/toolkit/components/reader/AboutReader.jsm
@@ -117,16 +117,35 @@ var AboutReader = function(mm, win, arti
 
   this._setupLineHeightButtons();
 
   if (win.speechSynthesis && Services.prefs.getBoolPref("narrate.enabled")) {
     new NarrateControls(mm, win, this._languagePromise);
   }
 
   this._loadArticle();
+
+  let dropdown = this._toolbarElement;
+
+  let elemL10nMap = {
+    ".minus-button": "minus",
+    ".plus-button": "plus",
+    ".content-width-minus-button": "contentwidthminus",
+    ".content-width-plus-button": "contentwidthplus",
+    ".line-height-minus-button": "lineheightminus",
+    ".line-height-plus-button": "lineheightplus",
+    ".light-button": "colorschemelight",
+    ".dark-button": "colorschemedark",
+    ".sepia-button": "colorschemesepia",
+  };
+
+  for (let [selector, stringID] of Object.entries(elemL10nMap)) {
+    dropdown.querySelector(selector).setAttribute("title",
+      gStrings.GetStringFromName("aboutReader.toolbar." + stringID));
+  }
 };
 
 AboutReader.prototype = {
   _BLOCK_IMAGES_SELECTOR: ".content p > img:only-child, " +
                           ".content p > a:only-child > img:only-child, " +
                           ".content .wp-caption img, " +
                           ".content figure img",
 
--- a/toolkit/locales/en-US/chrome/global/aboutReader.properties
+++ b/toolkit/locales/en-US/chrome/global/aboutReader.properties
@@ -41,8 +41,19 @@ aboutReader.toolbar.close=Close Reader V
 aboutReader.toolbar.typeControls=Type controls
 
 # These are used for the Reader View toolbar button and the menuitem within the
 # View menu.
 readerView.enter=Enter Reader View
 readerView.enter.accesskey=R
 readerView.close=Close Reader View
 readerView.close.accesskey=R
+
+# These are used as tooltips in Type Control
+aboutReader.toolbar.minus = Decrease Font Size
+aboutReader.toolbar.plus = Increase Font Size
+aboutReader.toolbar.contentwidthminus = Decrease Content Width
+aboutReader.toolbar.contentwidthplus = Increase Content Width
+aboutReader.toolbar.lineheightminus = Decrease Line Height
+aboutReader.toolbar.lineheightplus = Increase Line Height
+aboutReader.toolbar.colorschemelight = Color Scheme Light
+aboutReader.toolbar.colorschemedark = Color Scheme Dark
+aboutReader.toolbar.colorschemesepia = Color Scheme Sepia