Bug 1093750 - Adds tooltips to icons in Customize mode r?jaws draft
authorKatie Broida <kbroida@gmail.com>
Mon, 02 May 2016 11:33:07 -0400
changeset 358364 48e5bf92467de2d3997218f68dd83ad879924ed1
parent 356103 2045bc8c9e90a7ca0b8c6447ddecd812a71b29e1
child 519832 4222ce43c8bfbd34e1ac69a8511493bbb0d9c6f9
push id16985
push userbmo:kbroida@gmail.com
push dateMon, 02 May 2016 15:39:31 +0000
reviewersjaws
bugs1093750
milestone49.0a1
Bug 1093750 - Adds tooltips to icons in Customize mode r?jaws MozReview-Commit-ID: HYgprjtoOcE
browser/components/customizableui/CustomizeMode.jsm
browser/components/customizableui/test/browser.ini
browser/components/customizableui/test/browser_check_tooltips_in_navbar.js
--- a/browser/components/customizableui/CustomizeMode.jsm
+++ b/browser/components/customizableui/CustomizeMode.jsm
@@ -927,18 +927,20 @@ CustomizeMode.prototype = {
     }
 
     if (aNode.hasAttribute("id")) {
       wrapper.setAttribute("id", "wrapper-" + aNode.getAttribute("id"));
     }
 
     if (aNode.hasAttribute("label")) {
       wrapper.setAttribute("title", aNode.getAttribute("label"));
+      wrapper.setAttribute("tooltiptext", aNode.getAttribute("label"));
     } else if (aNode.hasAttribute("title")) {
       wrapper.setAttribute("title", aNode.getAttribute("title"));
+      wrapper.setAttribute("tooltiptext", aNode.getAttribute("title"));
     }
 
     if (aNode.hasAttribute("flex")) {
       wrapper.setAttribute("flex", aNode.getAttribute("flex"));
     }
 
     if (aPlace == "panel") {
       if (aNode.classList.contains(CustomizableUI.WIDE_PANEL_CLASS)) {
--- a/browser/components/customizableui/test/browser.ini
+++ b/browser/components/customizableui/test/browser.ini
@@ -143,8 +143,9 @@ skip-if = os == "mac"
 [browser_1087303_button_preferences.js]
 [browser_1089591_still_customizable_after_reset.js]
 [browser_1096763_seen_widgets_post_reset.js]
 [browser_1161838_inserted_new_default_buttons.js]
 [browser_bootstrapped_custom_toolbar.js]
 [browser_customizemode_contextmenu_menubuttonstate.js]
 [browser_panel_toggle.js]
 [browser_switch_to_customize_mode.js]
+[browser_check_tooltips_in_navbar.js]
new file mode 100644
--- /dev/null
+++ b/browser/components/customizableui/test/browser_check_tooltips_in_navbar.js
@@ -0,0 +1,14 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+"use strict";
+
+add_task(function* check_tooltips_in_navbar() {
+  yield startCustomizing();
+  let homeButtonWrapper = document.getElementById("wrapper-home-button");
+  let homeButton = document.getElementById("home-button");
+  is(homeButtonWrapper.getAttribute("tooltiptext"), homeButton.getAttribute("label"), "the wrapper's tooltip should match the button's label");
+  ok(homeButtonWrapper.getAttribute("tooltiptext"), "the button should have tooltip text");
+  yield endCustomizing();
+});