Bug 570321 - spell-check-dictionary name is not displayed in context menu; r=gavin
authorEhsan Akhgari <ehsan@mozilla.com>
Sat, 05 Jun 2010 23:48:30 -0400
changeset 43299 0ba3b3e08dfb94bc7948314c13dfb67276a89709
parent 43298 855a585cfa2ec52bed04d9246c93979d43d4895b
child 43300 4d483ce6ee1a6edd0508ccfeead0ccec43022fc7
push id13643
push usereakhgari@mozilla.com
push dateTue, 08 Jun 2010 14:35:20 +0000
treeherdermozilla-central@8a37644190b7 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersgavin
bugs570321
milestone1.9.3a5pre
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 570321 - spell-check-dictionary name is not displayed in context menu; r=gavin
browser/base/content/test/test_contextmenu.html
toolkit/content/InlineSpellChecker.jsm
--- a/browser/base/content/test/test_contextmenu.html
+++ b/browser/base/content/test/test_contextmenu.html
@@ -50,20 +50,21 @@ function getVisibleMenuItems(aMenu) {
 
         if (item.nodeName == "menuitem") {
             var isSpellSuggestion = item.className == "spell-suggestion";
             if (isSpellSuggestion) {
               is(item.id, "", "child menuitem #" + i + " is a spelling suggestion");
             } else {
               ok(item.id, "child menuitem #" + i + " has an ID");
             }
-            ok(item.label.length, "menuitem " + item.id + " has a label");
+            var label = item.getAttribute("label");
+            ok(label.length, "menuitem " + item.id + " has a label");
             if (isSpellSuggestion) {
               is(key, "", "Spell suggestions shouldn't have an access key");
-              items.push("*" + item.label);
+              items.push("*" + label);
             } else if (item.id.indexOf("spell-check-dictionary-") != 0 &&
                        item.id != "spell-no-suggestions") {
               ok(key, "menuitem " + item.id + " has an access key");
               if (accessKeys[key])
                   ok(false, "menuitem " + item.id + " has same accesskey as " + accessKeys[key]);
               else
                   accessKeys[key] = item.id;
             }
--- a/toolkit/content/InlineSpellChecker.jsm
+++ b/toolkit/content/InlineSpellChecker.jsm
@@ -214,17 +214,17 @@ InlineSpellChecker.prototype = {
 
       // if we didn't get a name, just use the raw dictionary name
       if (displayName.length == 0)
         displayName = list[i];
 
       this.mDictionaryNames.push(list[i]);
       var item = menu.ownerDocument.createElement("menuitem");
       item.setAttribute("id", "spell-check-dictionary-" + list[i]);
-      item.label = displayName;
+      item.setAttribute("label", displayName);
       item.setAttribute("type", "checkbox");
       this.mDictionaryItems.push(item);
       if (curlang == list[i]) {
         item.setAttribute("checked", "true");
       } else {
         var callback = function(me, val) { return function(evt) { me.selectDictionary(val); } };
         item.addEventListener("command", callback(this, i), true);
       }