Bug 1360166 - Make accessible/ ESLint rules inherit from the mozilla/recommended configuration. r?surkov draft
authorMark Banner <standard8@mozilla.com>
Thu, 27 Apr 2017 11:53:38 +0100
changeset 572696 95d6c02b9e2bcb7526315c88792add47f0599964
parent 572570 33b92d9c40562dab3d7b602368c75619f1d793f7
child 572697 393b8434f669fe80e3b19dce6aa30b6bed514d04
push id57145
push userbmo:standard8@mozilla.com
push dateThu, 04 May 2017 14:21:43 +0000
reviewerssurkov
bugs1360166
milestone55.0a1
Bug 1360166 - Make accessible/ ESLint rules inherit from the mozilla/recommended configuration. r?surkov MozReview-Commit-ID: GJs25x7vNgZ
accessible/.eslintrc.js
accessible/jsat/AccessFu.jsm
accessible/jsat/EventManager.jsm
accessible/jsat/Gestures.jsm
accessible/jsat/OutputGenerator.jsm
accessible/jsat/PointerAdapter.jsm
accessible/jsat/Presentation.jsm
accessible/jsat/Traversal.jsm
accessible/jsat/Utils.jsm
accessible/jsat/content-script.js
accessible/tests/crashtests/.eslintrc.js
accessible/tests/crashtests/448064.xhtml
accessible/tests/mochitest/.eslintrc.js
accessible/tests/mochitest/actions.js
accessible/tests/mochitest/actions/test_media.html
accessible/tests/mochitest/editabletext/editabletext.js
accessible/tests/mochitest/elm/test_canvas.html
accessible/tests/mochitest/events.js
accessible/tests/mochitest/events/test_fromUserInput.html
accessible/tests/mochitest/events/test_text.html
accessible/tests/mochitest/grid.js
accessible/tests/mochitest/hittest/test_canvas_hitregion.html
accessible/tests/mochitest/hittest/test_general.html
accessible/tests/mochitest/hyperlink/test_general.html
accessible/tests/mochitest/jsat/test_live_regions.html
accessible/tests/mochitest/name/markup.js
accessible/tests/mochitest/relations.js
accessible/tests/mochitest/scroll/test_zoom.html
accessible/tests/mochitest/scroll/test_zoom_text.html
accessible/tests/mochitest/selectable.js
accessible/tests/mochitest/states.js
accessible/tests/mochitest/states/test_aria.html
accessible/tests/mochitest/table.js
accessible/tests/mochitest/table/test_table_1.html
accessible/tests/mochitest/test_OuterDocAccessible.html
accessible/tests/mochitest/text.js
accessible/tests/mochitest/tree/test_aria_globals.html
accessible/tests/mochitest/treeupdate/test_list.html
accessible/tests/mochitest/treeupdate/test_list_editabledoc.html
accessible/tests/mochitest/value/test_general.html
--- a/accessible/.eslintrc.js
+++ b/accessible/.eslintrc.js
@@ -1,24 +1,31 @@
 "use strict";
 
 module.exports = {
   "extends": [
-    "../.eslintrc.js"
+    "plugin:mozilla/recommended"
   ],
-  "globals": {
-    "Cc": true,
-    "Ci": true,
-    "Components": true,
-    "console": true,
-    "Cu": true,
-    "dump": true,
-    "Services": true,
-    "XPCOMUtils": true
-  },
   "rules": {
     // Warn about cyclomatic complexity in functions.
     "complexity": ["error", 42],
 
-    // Maximum depth callbacks can be nested.
-    "max-nested-callbacks": ["error", 10],
+    // XXX These are rules that are enabled in the recommended configuration, but
+    // disabled here due to failures when initially implemented. They should be
+    // removed (and hence enabled) at some stage.
+    "brace-style": "off",
+    "consistent-return": "off",
+    "func-call-spacing": "off",
+    "quotes": "off",
+    "object-shorthand": "off",
+    "space-before-function-paren": "off",
+    "space-infix-ops": "off",
+    "key-spacing": "off",
+    "keyword-spacing": "off",
+    "no-else-return": "off",
+    "no-multi-spaces": "off",
+    "no-trailing-spaces": "off",
+    "no-unexpected-multiline": "off",
+    "no-unsafe-finally": "off",
+    "no-useless-call": "off",
+    "spaced-comment": "off",
   }
 };
--- a/accessible/jsat/AccessFu.jsm
+++ b/accessible/jsat/AccessFu.jsm
@@ -1,14 +1,12 @@
 /* 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/. */
 
-/* global AccessFu, Components, Utils, PrefCache, Logger, Services,
-          PointerAdapter, dump, Presentation, Rect */
 /* exported AccessFu */
 
 'use strict';
 
 const {utils: Cu, interfaces: Ci} = Components;
 
 this.EXPORTED_SYMBOLS = ['AccessFu']; // jshint ignore:line
 
--- a/accessible/jsat/EventManager.jsm
+++ b/accessible/jsat/EventManager.jsm
@@ -93,17 +93,16 @@ this.EventManager.prototype = {
     Logger.debug(() => {
       return ['DOMEvent', aEvent.type];
     });
 
     try {
       switch (aEvent.type) {
       case 'wheel':
       {
-        let attempts = 0;
         let delta = aEvent.deltaX || aEvent.deltaY;
         this.contentControl.autoMove(
          null,
          { moveMethod: delta > 0 ? 'moveNext' : 'movePrevious',
            onScreenOnly: true, noOpIfOnScreen: true, delay: 500 });
         break;
       }
       case 'scroll':
@@ -266,17 +265,16 @@ this.EventManager.prototype = {
           this._handleText(aEvent, liveRegion, isPolite);
         }
         break;
       }
       case Events.FOCUS:
       {
         // Put vc where the focus is at
         let acc = aEvent.accessible;
-        let doc = aEvent.accessibleDocument;
         this._setEditingMode(aEvent);
         if ([Roles.CHROME_WINDOW,
              Roles.DOCUMENT,
              Roles.APPLICATION].indexOf(acc.role) < 0) {
           this.contentControl.autoMove(acc);
        }
 
        if (this.inTest) {
@@ -481,17 +479,17 @@ this.EventManager.prototype = {
         liveAttrs = parseLiveAttrs(parent);
         if (liveAttrs) {
           return liveAttrs;
         }
         parent = parent.parent
       }
       return {};
     };
-    let {live, relevant, busy, atomic, memberOf} = getLiveAttributes(aEvent);
+    let {live, relevant, /* busy, atomic, memberOf */ } = getLiveAttributes(aEvent);
     // If container-live is not present or is set to |off| ignore the event.
     if (!live || live === 'off') {
       return {};
     }
     // XXX: support busy and atomic.
 
     // Determine if the type of the mutation is relevant. Default is additions
     // and text.
--- a/accessible/jsat/Gestures.jsm
+++ b/accessible/jsat/Gestures.jsm
@@ -1,13 +1,12 @@
 /* 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/. */
 
-/* global Components, GestureSettings, XPCOMUtils, Utils, Promise, Logger */
 /* exported GestureSettings, GestureTracker */
 
 /******************************************************************************
   All gestures have the following pathways when being resolved(v)/rejected(x):
                Tap -> DoubleTap        (x)
                    -> Dwell            (x)
                    -> Swipe            (x)
 
--- a/accessible/jsat/OutputGenerator.jsm
+++ b/accessible/jsat/OutputGenerator.jsm
@@ -1,13 +1,12 @@
 /* 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/. */
 
-/* global Components, XPCOMUtils, Utils, PrefCache, States, Roles, Logger */
 /* exported UtteranceGenerator, BrailleGenerator */
 
 'use strict';
 
 const {utils: Cu, interfaces: Ci} = Components;
 
 const INCLUDE_DESC = 0x01;
 const INCLUDE_NAME = 0x02;
--- a/accessible/jsat/PointerAdapter.jsm
+++ b/accessible/jsat/PointerAdapter.jsm
@@ -1,14 +1,12 @@
 /* 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/. */
 
-/* global Components, XPCOMUtils, Utils, Logger, GestureSettings,
-   GestureTracker */
 /* exported PointerRelay, PointerAdapter */
 
 'use strict';
 
 const Ci = Components.interfaces;
 const Cu = Components.utils;
 
 this.EXPORTED_SYMBOLS = ['PointerRelay', 'PointerAdapter']; // jshint ignore:line
--- a/accessible/jsat/Presentation.jsm
+++ b/accessible/jsat/Presentation.jsm
@@ -1,14 +1,12 @@
 /* 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/. */
 
-/* global Components, XPCOMUtils, Utils, Logger, BraillePresenter, Presentation,
-          UtteranceGenerator, BrailleGenerator, States, Roles, PivotContext */
 /* exported Presentation */
 
 'use strict';
 
 const {utils: Cu, interfaces: Ci} = Components;
 
 Cu.import('resource://gre/modules/XPCOMUtils.jsm');
 Cu.import('resource://gre/modules/accessibility/Utils.jsm');
--- a/accessible/jsat/Traversal.jsm
+++ b/accessible/jsat/Traversal.jsm
@@ -1,14 +1,12 @@
 /* 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/. */
 
-/* global PrefCache, Roles, Prefilters, States, Filters, Utils,
-   TraversalRules, Components, XPCOMUtils */
 /* exported TraversalRules, TraversalHelper */
 
 'use strict';
 
 const Ci = Components.interfaces;
 const Cu = Components.utils;
 
 this.EXPORTED_SYMBOLS = ['TraversalRules', 'TraversalHelper']; // jshint ignore:line
--- a/accessible/jsat/Utils.jsm
+++ b/accessible/jsat/Utils.jsm
@@ -1,14 +1,12 @@
 /* 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/. */
 
-/* global Components, XPCOMUtils, Services, PluralForm, Logger, Rect, Utils,
-          States, Relations, Roles, dump, Events, PivotContext, PrefCache */
 /* exported Utils, Logger, PivotContext, PrefCache */
 
 'use strict';
 
 const {classes: Cc, utils: Cu, interfaces: Ci} = Components;
 
 Cu.import('resource://gre/modules/XPCOMUtils.jsm');
 XPCOMUtils.defineLazyModuleGetter(this, 'Services', // jshint ignore:line
--- a/accessible/jsat/content-script.js
+++ b/accessible/jsat/content-script.js
@@ -1,12 +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/. */
 
+/* eslint-env mozilla/frame-script */
+
 var Ci = Components.interfaces;
 var Cu = Components.utils;
 
 Cu.import('resource://gre/modules/XPCOMUtils.jsm');
 XPCOMUtils.defineLazyModuleGetter(this, 'Logger',
   'resource://gre/modules/accessibility/Utils.jsm');
 XPCOMUtils.defineLazyModuleGetter(this, 'Presentation',
   'resource://gre/modules/accessibility/Presentation.jsm');
new file mode 100644
--- /dev/null
+++ b/accessible/tests/crashtests/.eslintrc.js
@@ -0,0 +1,7 @@
+"use strict";
+
+module.exports = {
+  "extends": [
+    "plugin:mozilla/mochitest-test"
+  ],
+};
--- a/accessible/tests/crashtests/448064.xhtml
+++ b/accessible/tests/crashtests/448064.xhtml
@@ -15,56 +15,56 @@
 </div>
 
 <input id="mw_a"/>
 
 
 <script>
 function dumpAccessibleNode(aNode, level) {
 	var msg = "";
-	
+
 	try {
 		msg += "name=\"" + aNode.name + "\" ";
 	} catch (e) {
 		msg += " noName ";
 	}
-	
+
 	dump(msg + '\n');
 }
 
 
 function dumpAccessibleTree(aNode, level) {
 	level = level || 0;
 
 	dumpAccessibleNode(aNode, level);
-	try {	
+	try {
 		var child = aNode.firstChild;
 		while (child) {
 			dumpAccessibleTree(child, level + 1);
 			child = child.nextSibling;
 		}
 	} catch (e) {
 		dump("Error visiting child nodes: " + e + '\n');
 	}
 }
 
-function A(o) { 
+function A(o) {
   var acc = SpecialPowers.Cc['@mozilla.org/accessibilityService;1']
                          .getService(SpecialPowers.Ci.nsIAccessibilityService);
   return acc.getAccessibleFor(o);
 }
 
 function beginAccessible() {
-  dumpAccessibleTree(A(document),0);
+  dumpAccessibleTree(A(document), 0);
 }
 setTimeout(beginAccessible, 100);
 
 
 setTimeout(doe, 200);
 function doe() {
    document.getElementById('mw_a').appendChild(document.getElementById('mw_b'));
    document.getElementById('mw_c').appendChild(document.getElementById('mw_d'));
-   document.getElementById('mw_e').appendChild(document.getElementById('mw_f')); 
-   document.getElementById('mw_g').appendChild(document.getElementById('mw_b')); 
+   document.getElementById('mw_e').appendChild(document.getElementById('mw_f'));
+   document.getElementById('mw_g').appendChild(document.getElementById('mw_b'));
 }
 </script>
 </body>
-</html>
\ No newline at end of file
+</html>
new file mode 100644
--- /dev/null
+++ b/accessible/tests/mochitest/.eslintrc.js
@@ -0,0 +1,24 @@
+"use strict";
+
+module.exports = {
+  "extends": [
+    "plugin:mozilla/mochitest-test"
+  ],
+  "rules": {
+    "mozilla/no-cpows-in-tests": "error",
+    "mozilla/reject-importGlobalProperties": "error",
+
+    // XXX These are rules that are enabled in the recommended configuration, but
+    // disabled here due to failures when initially implemented. They should be
+    // removed (and hence enabled) at some stage.
+    "comma-spacing": "off",
+    "no-cond-assign": "off",
+    "no-lonely-if": "off",
+    "no-nested-ternary": "off",
+    "no-new-object": "off",
+    "no-redeclare": "off",
+    "no-shadow": "off",
+    "no-undef": "off",
+    "space-unary-ops": "off",
+  }
+};
--- a/accessible/tests/mochitest/actions.js
+++ b/accessible/tests/mochitest/actions.js
@@ -36,17 +36,17 @@ const XUL_EVENTS = CLICK_EVENTS | COMMAN
  *    get targetID() {},
  *
  *    // [optional] perform checks when 'click' event is handled if 'events'
  *    // is used.
  *    checkOnClickEvent: function() {},
  *
  *    // [optional] an array of invoker's checker objects (see eventQueue
  *    // constructor events.js)
- *    get eventSeq() {} 
+ *    get eventSeq() {}
  *  };
  *
  *
  * @param  aArray [in] an array of action cheker objects
  */
 function testActions(aArray)
 {
   gActionsQueue = new eventQueue();
@@ -129,17 +129,17 @@ function actionInvoker(aAccOrElmOrId, aA
       return INVOKER_ACTION_FAILED;
 
     is(acc.getActionName(aActionIndex), aActionName,
        "Wrong action name of the accessible for " + prettyName(aAccOrElmOrId));
 
     try {
       acc.doAction(aActionIndex);
     }
-    catch (e){
+    catch (e) {
       ok(false, "doAction(" + aActionIndex + ") failed with: " + e.name);
       return INVOKER_ACTION_FAILED;
     }
   }
 
   this.eventSeq = aEventSeq;
 
   this.getID = function actionInvoker_getID()
--- a/accessible/tests/mochitest/actions/test_media.html
+++ b/accessible/tests/mochitest/actions/test_media.html
@@ -59,17 +59,17 @@ https://bugzilla.mozilla.org/show_bug.cg
     {
       //////////////////////////////////////////////////////////////////////////
       // test actions of audio controls
 
       todo(false, "Focus test are disabled until bug 494175 is fixed.");
 
       var audioElm = getAccessible("audio");
       var playBtn = audioElm.firstChild;
-      var scrubber = playBtn.nextSibling.nextSibling.nextSibling;
+      // var scrubber = playBtn.nextSibling.nextSibling.nextSibling;
       var muteBtn = audioElm.lastChild.previousSibling;
 
       var actions = [
         {
           ID: muteBtn,
           actionName: "press",
           events: CLICK_EVENTS,
           eventSeq: [
--- a/accessible/tests/mochitest/editabletext/editabletext.js
+++ b/accessible/tests/mochitest/editabletext/editabletext.js
@@ -128,17 +128,17 @@ function editableTextTest(aID)
     function copyNPasteTextInvoke()
     {
       var acc = getAccessible(aID, nsIAccessibleEditableText);
       acc.copyText(aStartPos, aEndPos);
       acc.pasteText(aPos);
     }
 
     this.generateTest(aID, null, [aStartPos, aEndPos, getTextFromClipboard],
-                      copyNPasteInvoke, getValueChecker(aID, aResStr), testID);
+                      copyNPasteTextInvoke, getValueChecker(aID, aResStr), testID);
   }
 
   /**
    * cutText test.
    */
   this.cutText = function cutText(aStartPos, aEndPos, aResStr,
                                   aResStartPos, aResEndPos)
   {
@@ -217,17 +217,16 @@ function editableTextTest(aID)
                       getValueChecker(aID, aResStr), testID);
   }
 
   //////////////////////////////////////////////////////////////////////////////
   // Implementation details.
 
   function getValue(aID)
   {
-    var value = "";
     var elm = getNode(aID);
     if (elm instanceof Components.interfaces.nsIDOMNSEditableElement)
       return elm.value;
 
     if (elm instanceof Components.interfaces.nsIDOMHTMLDocument)
       return elm.body.textContent;
 
     return elm.textContent;
@@ -253,31 +252,16 @@ function editableTextTest(aID)
       check: function clipboardChecker_check()
       {
         is(getTextFromClipboard(), aText, "Wrong text in clipboard.");
       }
     };
     return checker;
   }
 
-  function getValueNClipboardChecker(aID, aValue, aText)
-  {
-    var valueChecker = getValueChecker(aID, aValue);
-    var clipboardChecker = getClipboardChecker(aID, aText);
-
-    var checker = {
-      check: function()
-      {
-        valueChecker.check();
-        clipboardChecker.check();
-      }
-    };
-    return checker;
-  }
-
   /**
    * Process next scheduled test.
    */
   this.unwrapNextTest = function unwrapNextTest()
   {
     var data = this.mEventQueue.mInvokers[this.mEventQueue.mIndex + 1];
     if (data)
       data.func.apply(this, data.funcArgs);
@@ -345,9 +329,8 @@ function editableTextTest(aID)
     }
 
     this.mEventQueue.invoke();
   }
 
   this.mEventQueue = new eventQueue();
   this.mEventQueueReady = false;
 }
-
--- a/accessible/tests/mochitest/elm/test_canvas.html
+++ b/accessible/tests/mochitest/elm/test_canvas.html
@@ -24,17 +24,17 @@
       var canv = document.getElementById("c");
       var context = canv.getContext('2d');
       var element = document.getElementById("showA");
       context.beginPath();
       context.rect(kX, kY, kWidth, kHeight);
       context.addHitRegion({control: element});
 
       var input = getAccessible("showA");
-      var [cnvX, cnvY, cnvWidth, cnvHeight] = getBoundsForDOMElm(canv);
+      var [cnvX, cnvY, /*cnvWidth*/, /*cnvHeight*/] = getBoundsForDOMElm(canv);
       var [accX, accY, accWidth, accHeight] = getBounds(input);
 
       var [x, y, w, h] = CSSToDevicePixels(window, kX, kY, kWidth, kHeight);
       is(accX, cnvX + x, "wrong accX");
       is(accY, cnvY + y, "wrong accY");
       is(accWidth, w, "wrong accWidth");
       is(accHeight, h, "wrong accHeight");
 
--- a/accessible/tests/mochitest/events.js
+++ b/accessible/tests/mochitest/events.js
@@ -500,17 +500,17 @@ function eventQueue(aEventType)
           checker.wasCaught++;
           continue;
         }
 
         // Report an error if we hanlded not expected event of unique type
         // (i.e. event types are matched, targets differs).
         if (!checker.unexpected && checker.unique &&
             eventQueue.compareEventTypes(checker, aEvent)) {
-          var isExppected = false;
+          var isExpected = false;
           for (var jdx = 0; jdx < eventSeq.length; jdx++) {
             isExpected = eventQueue.compareEvents(eventSeq[jdx], aEvent);
             if (isExpected)
               break;
           }
 
           if (!isExpected) {
             ok(false,
@@ -964,17 +964,17 @@ eventQueue.logEvent = function eventQueu
     gLogger.logToDOM(info);
   }
 
   var infoMsg = "unhandled expected events: " + aAreExpectedEventsLeft +
     ", "  + eventQueue.invokerStatusToMsg(aInvokerStatus);
 
   var currType = eventQueue.getEventTypeAsString(aMatchedChecker);
   var currTargetDescr = eventQueue.getEventTargetDescr(aMatchedChecker);
-  var consoleMsg = "*****\nScenario " + aScenarioIdx + 
+  var consoleMsg = "*****\nScenario " + aScenarioIdx +
     ", event " + aEventIdx + " matched: " + currType + "\n" + infoMsg + "\n*****";
   gLogger.logToConsole(consoleMsg);
 
   var emphText = "matched ";
   var msg = "EQ event, type: " + currType + ", target: " + currTargetDescr +
     ", " + infoMsg;
   gLogger.logToDOM(msg, true, emphText);
 }
@@ -1310,18 +1310,18 @@ function synthFocus(aNodeOrID, aCheckerO
     if (this.DOMNode instanceof Components.interfaces.nsIDOMNSEditableElement &&
         this.DOMNode.editor ||
         this.DOMNode instanceof Components.interfaces.nsIDOMXULTextBoxElement) {
       this.DOMNode.selectionStart = this.DOMNode.selectionEnd = this.DOMNode.value.length;
     }
     this.DOMNode.focus();
   }
 
-  this.getID = function synthFocus_getID() 
-  { 
+  this.getID = function synthFocus_getID()
+  {
     return prettyName(aNodeOrID) + " focus";
   }
 }
 
 /**
  * Focus invoker. Focus the HTML body of content document of iframe.
  */
 function synthFocusOnFrame(aNodeOrID, aCheckerOrEventSeq)
@@ -1331,18 +1331,18 @@ function synthFocusOnFrame(aNodeOrID, aC
     aCheckerOrEventSeq ? aCheckerOrEventSeq : new focusChecker(frameDoc);
   this.__proto__ = new synthAction(frameDoc, checkerOrEventSeq);
 
   this.invoke = function synthFocus_invoke()
   {
     this.DOMNode.body.focus();
   }
 
-  this.getID = function synthFocus_getID() 
-  { 
+  this.getID = function synthFocus_getID()
+  {
     return prettyName(aNodeOrID) + " frame document focus";
   }
 }
 
 /**
  * Change the current item when the widget doesn't have a focus.
  */
 function changeCurrentItem(aID, aItemID)
@@ -1986,17 +1986,17 @@ function selChangeSeq(aUnselectedID, aSe
   if (!aUnselectedID) {
     return [
       new stateChangeChecker(STATE_SELECTED, false, true, aSelectedID),
       new invokerChecker(EVENT_SELECTION, aSelectedID)
     ];
   }
 
   // Return two possible scenarios: depending on widget type when selection is
-  // moved the the order of items that get selected and unselected may vary. 
+  // moved the the order of items that get selected and unselected may vary.
   return [
     [
       new stateChangeChecker(STATE_SELECTED, false, false, aUnselectedID),
       new stateChangeChecker(STATE_SELECTED, false, true, aSelectedID),
       new invokerChecker(EVENT_SELECTION, aSelectedID)
     ],
     [
       new stateChangeChecker(STATE_SELECTED, false, true, aSelectedID),
@@ -2146,17 +2146,17 @@ function removeA11yEventListener(aEventT
   if (!listenersArray)
     return false;
 
   var index = listenersArray.indexOf(aEventHandler);
   if (index == -1)
     return false;
 
   listenersArray.splice(index, 1);
-  
+
   if (!listenersArray.length) {
     gA11yEventListeners[aEventType] = null;
     delete gA11yEventListeners[aEventType];
   }
 
   return true;
 }
 
@@ -2265,42 +2265,40 @@ var gLogger =
 // Sequence
 
 /**
  * Base class of sequence item.
  */
 function sequenceItem(aProcessor, aEventType, aTarget, aItemID)
 {
   // private
-  
+
   this.startProcess = function sequenceItem_startProcess()
   {
     this.queue.invoke();
   }
-  
-  var item = this;
-  
+
   this.queue = new eventQueue();
   this.queue.onFinish = function()
   {
     aProcessor.onProcessed();
     return DO_NOT_FINISH_TEST;
   }
-  
+
   var invoker = {
     invoke: function invoker_invoke() {
       return aProcessor.process();
     },
     getID: function invoker_getID()
     {
       return aItemID;
     },
     eventSeq: [ new invokerChecker(aEventType, aTarget) ]
   };
-  
+
   this.queue.push(invoker);
 }
 
 ////////////////////////////////////////////////////////////////////////////////
 // Event queue invokers
 
 /**
  * Invoker base class for prepare an action.
--- a/accessible/tests/mochitest/events/test_fromUserInput.html
+++ b/accessible/tests/mochitest/events/test_fromUserInput.html
@@ -26,19 +26,16 @@
       this.DOMNode = getNode(aID);
 
       this.eventSeq = [
         new textChangeChecker(aID, aStart, aEnd, aText, false, aFromUser)
       ];
 
       this.invoke = function removeTextFromInput_invoke()
       {
-        const nsIDOMNSEditableElement =
-          Components.interfaces.nsIDOMNSEditableElement;
-
         this.DOMNode.focus();
         this.DOMNode.setSelectionRange(aStart, aEnd);
 
         synthesizeKey("VK_DELETE", {});
       }
 
       this.getID = function removeTextFromInput_getID()
       {
@@ -55,19 +52,16 @@
       this.DOMNode = getNode(aID);
 
       this.eventSeq = [
         new textChangeChecker(aID, aStart, aEnd, aText, false, aFromUser)
       ];
 
       this.invoke = function removeTextFromContentEditable_invoke()
       {
-        const nsIDOMNSEditableElement =
-          Components.interfaces.nsIDOMNSEditableElement;
-
         this.DOMNode.focus();
         this.textNode = getNode(aID).firstChild;
         var selection = window.getSelection();
         var range = document.createRange();
         range.setStart(this.textNode, aStart);
         range.setEnd(this.textNode, aEnd);
         selection.addRange(range);
 
--- a/accessible/tests/mochitest/events/test_text.html
+++ b/accessible/tests/mochitest/events/test_text.html
@@ -180,19 +180,16 @@
     {
       this.__proto__ = new textRemoveInvoker(aID, aStart, aEnd, aText);
 
       this.eventSeq.push(new invokerChecker(EVENT_TEXT_VALUE_CHANGE,
                                             this.DOMNode));
 
       this.invoke = function removeTextFromInput_invoke()
       {
-        const nsIDOMNSEditableElement =
-          Components.interfaces.nsIDOMNSEditableElement;
-
         this.DOMNode.focus();
         this.DOMNode.setSelectionRange(aStart, aEnd);
 
         synthesizeKey("VK_DELETE", {});
       }
 
       this.getID = function removeTextFromInput_getID()
       {
--- a/accessible/tests/mochitest/grid.js
+++ b/accessible/tests/mochitest/grid.js
@@ -21,17 +21,16 @@ function grid(aTableIdentifier)
 
   this.getMaxIndex = function getMaxIndex()
   {
     return this.getRowCount() * this.getColsCount() - 1;
   }
 
   this.getCellAtIndex = function getCellAtIndex(aIndex)
   {
-    var rowCount = this.getRowCount();
     var colsCount = this.getColsCount();
 
     var rowIdx = Math.floor(aIndex / colsCount);
     var colIdx = aIndex % colsCount;
 
     var row = this.getRowAtIndex(rowIdx);
     return row.cells[colIdx];
   }
@@ -128,17 +127,17 @@ function grid(aTableIdentifier)
         break;
     }
   }
 
   this.handleClickEvent = function handleClickEvent(aEvent)
   {
     if (aEvent.target.localName != "td")
       return;
-    
+
     var curCell = this.getCurrentCell();
     var cell = aEvent.target;
 
     if (cell != curCell) {
       curCell.removeAttribute("tabindex");
       cell.setAttribute("tabindex", "0");
       cell.focus();
     }
--- a/accessible/tests/mochitest/hittest/test_canvas_hitregion.html
+++ b/accessible/tests/mochitest/hittest/test_canvas_hitregion.html
@@ -46,17 +46,17 @@
 
       var context = document.getElementById("hitcanvas").getContext('2d');
       redrawCheckbox(context, document.getElementById('hitcheck'),
                      offsetX, offsetY);
 
       var hitcanvas = getAccessible("hitcanvas");
       var hitcheck = getAccessible("hitcheck");
 
-      var [hitX, hitY, hitWidth, hitHeight] = getBounds(hitcanvas);
+      var [hitX, hitY, /*hitWidth, hitHeight */] = getBounds(hitcanvas);
       var [deltaX, deltaY] = CSSToDevicePixels(window, offsetX, offsetY);
 
       var docAcc = getAccessible(document);
 
       // test if we hit the region associated with the shadow dom checkbox
       var tgtX = hitX + deltaX;
       var tgtY = hitY + deltaY;
       hitAcc = docAcc.getDeepestChildAtPoint(tgtX, tgtY);
--- a/accessible/tests/mochitest/hittest/test_general.html
+++ b/accessible/tests/mochitest/hittest/test_general.html
@@ -43,19 +43,18 @@ if (!MAC) {
       // document.
       testChildAtPoint(txt, -1, 1, null, null);
 
       // ::MustPrune case, point is outside of root accessible.
       testChildAtPoint(txt, -10000, 10000, null, null);
 
       // Not specific case, point is inside of btn accessible.
       var btn = getAccessible("btn");
-      var btnText = btn.firstChild;
       testChildAtPoint(btn, 1, 1, btn, btn);
-  
+
       // Not specific case, point is outside of btn accessible.
       testChildAtPoint(btn, -1, 1, null, null);
 
       // Out of flow accessible testing, do not return out of flow accessible
       // because it's not a child of the accessible even visually it is.
       var rectArea = getNode("area").getBoundingClientRect();
       var outOfFlow = getNode("outofflow");
       outOfFlow.style.left = rectArea.left + "px";
--- a/accessible/tests/mochitest/hyperlink/test_general.html
+++ b/accessible/tests/mochitest/hyperlink/test_general.html
@@ -67,17 +67,17 @@ https://bugzilla.mozilla.org/show_bug.cg
     function doTest()
     {
       //////////////////////////////////////////////////////////////////////////
       // normal hyperlink
       var normalHyperlinkAcc = getAccessible("NormalHyperlink",
                                              [nsIAccessibleHyperLink]);
       testThis("NormalHyperlink", normalHyperlinkAcc, ROLE_LINK, 1,
                "Mozilla Foundation", true, 17, 18);
-      is(normalHyperlinkAcc.getURI(0).spec, "http://www.mozilla.org/", 
+      is(normalHyperlinkAcc.getURI(0).spec, "http://www.mozilla.org/",
          "URI wrong for normalHyperlinkElement!");
       testStates(normalHyperlinkAcc, STATE_LINKED, 0);
 
       //////////////////////////////////////////////////////////////////////////
       // ARIA hyperlink
       var ariaHyperlinkAcc = getAccessible("AriaHyperlink",
                                            [nsIAccessibleHyperLink]);
       testThis("AriaHyperlink", ariaHyperlinkAcc, ROLE_LINK, 1,
@@ -128,17 +128,17 @@ https://bugzilla.mozilla.org/show_bug.cg
       testAction("emptyLink", EmptyHLAcc, "jump");
 
       //////////////////////////////////////////////////////////////////////////
       // normal hyperlink with embedded span
       var hyperlinkWithSpanAcc = getAccessible("LinkWithSpan",
                                                [nsIAccessibleHyperLink]);
       testThis("LinkWithSpan", hyperlinkWithSpanAcc, ROLE_LINK, 1,
                "Heise Online", true, 119, 120);
-      is(hyperlinkWithSpanAcc.getURI(0).spec, "http://www.heise.de/", 
+      is(hyperlinkWithSpanAcc.getURI(0).spec, "http://www.heise.de/",
          "URI wrong for hyperlinkElementWithSpan!");
       testStates(hyperlinkWithSpanAcc, STATE_LINKED, 0);
       testAction("LinkWithSpan", hyperlinkWithSpanAcc, "jump");
 
       //////////////////////////////////////////////////////////////////////////
       // Named anchor, should never have state_linked
       var namedAnchorAcc = getAccessible("namedAnchor",
                                          [nsIAccessibleHyperLink]);
@@ -163,17 +163,17 @@ https://bugzilla.mozilla.org/show_bug.cg
                                            [nsIAccessibleHyperLink]);
       testThis("linkWithClick", linkWithClickAcc, ROLE_LINK, 1,
                "This should have state_linked", true, 292, 293);
       testStates(linkWithClickAcc, STATE_LINKED, 0);
       testAction("linkWithClick", linkWithClickAcc, "click");
 
       //////////////////////////////////////////////////////////////////////////
       // Maps to group links (bug 431615).
-      var linksMapAcc = getAccessible("linksmap");
+      // var linksMapAcc = getAccessible("linksmap");
 
       //////////////////////////////////////////////////////////////////////////
       // Link with title attribute, no name from the subtree (bug 438325).
       var id = "linkWithTitleNoNameFromSubtree";
       var linkAcc = getAccessible(id, [nsIAccessibleHyperLink]);
       testThis(id, linkAcc, ROLE_LINK, 1, "Link with title", true, 344, 345);
       testStates(linkAcc, STATE_LINKED, 0);
       testAction(id, linkAcc, "jump");
@@ -255,23 +255,23 @@ https://bugzilla.mozilla.org/show_bug.cg
   ><br>Link with embedded span<br
   ><a id="LinkWithSpan" href="http://www.heise.de/"><span lang="de">Heise Online</span></a
   ><br>Named anchor, must not have "linked" state for it to be exposed correctly:<br
   ><a id="namedAnchor" name="named_anchor">This should never be of state_linked</a
   ><br>Link having no attributes, must not have "linked" state:<a id="noLink"
   >This should never be of state_linked</a
   ><br>Link with registered 'click' event: <a id="linkWithClick" onclick="var clicked = true;"
   >This should have state_linked</a
-  ><br>Link with title attribute (no name from subtree): <a 
+  ><br>Link with title attribute (no name from subtree): <a
       id="linkWithTitleNoNameFromSubtree" href="http://www.heise.de/"
       title="Link with title"><img src=""/></a
-  ><br>Link with title attribute (name from subtree): <a 
+  ><br>Link with title attribute (name from subtree): <a
       id="linkWithTitleNameFromSubtree" href="http://www.heise.de/"
       title="Link with title">the name from subtree</a
-  ><br>Link with title attribute (name from nested image): <a 
+  ><br>Link with title attribute (name from nested image): <a
       id="linkWithTitleNameFromImg" href="http://www.heise.de/"
       title="Link with title"><img src="" alt="The title for link"/></a
   ><br><br>Map that is used to group links (www.w3.org/TR/WCAG10-HTML-TECHS/#group-bypass), also see the bug 431615:<br
   ><map id="linksmap" title="Site navigation"><ul
     ><li><a href="http://mozilla.org">About the project</a></li
     ><li><a href="http://mozilla.org">Sites and sounds</a></li
     ></ul
   ></map
--- a/accessible/tests/mochitest/jsat/test_live_regions.html
+++ b/accessible/tests/mochitest/jsat/test_live_regions.html
@@ -295,17 +295,16 @@
       expected: {
         "eventType": "liveregion-change",
         "data": ["I am replaced", {"string": "main"}],
         "options": {
           "enqueue": true
         }
       },
       action: function action() {
-        var region = document.getElementById("to_replace_region");
         var child = document.getElementById("to_replace");
         child.setAttribute("role", "main");
       }
     }, {
       expected: {
         "eventType": "liveregion-change",
         "data": ["I am a replaced text"],
         "options": {
--- a/accessible/tests/mochitest/name/markup.js
+++ b/accessible/tests/mochitest/name/markup.js
@@ -134,18 +134,16 @@ function testNamesForMarkup(aMarkupElm)
 }
 
 function testNamesForMarkupRules(aMarkupElm, aContainer)
 {
   var testID = aMarkupElm.getAttribute("id");
   if (gDumpToConsole)
     dump("\nProcessing markup rules '" + testID + "'\n");
 
-  var serializer = new XMLSerializer();
-
   var expr = "//html/body/div[@id='test']/" + aMarkupElm.getAttribute("ref");
   var elm = evaluateXPath(document, expr, htmlDocResolver)[0];
 
   var ruleId = aMarkupElm.getAttribute("ruleset");
   var ruleElm = gRuleDoc.querySelector("[id='" + ruleId + "']");
   var ruleElms = getRuleElmsByRulesetId(ruleId);
 
   var processMarkupRules =
--- a/accessible/tests/mochitest/relations.js
+++ b/accessible/tests/mochitest/relations.js
@@ -110,17 +110,16 @@ function testRelation(aIdentifier, aRelT
  *                              accessibles that shouldn't exist for this
  *                              relation.
  */
 function testAbsentRelation(aIdentifier, aRelType, aUnrelatedIdentifiers)
 {
   var relation = getRelationByType(aIdentifier, aRelType);
 
   var relDescr = getRelationErrorMsg(aIdentifier, aRelType);
-  var relDescrStart = getRelationErrorMsg(aIdentifier, aRelType, true);
 
   if (!aUnrelatedIdentifiers) {
     ok(false, "No identifiers given for unrelated accessibles.");
     return;
   }
 
   if (!relation || !relation.targetsCount) {
     ok(true, "No relations exist.");
--- a/accessible/tests/mochitest/scroll/test_zoom.html
+++ b/accessible/tests/mochitest/scroll/test_zoom.html
@@ -17,35 +17,35 @@
   <script type="application/javascript"
           src="../layout.js"></script>
 
   <script type="application/javascript">
     function testScrollToPoint()
     {
       // scrollToPoint relative screen
       var anchor = getAccessible("bottom1");
-      var [x, y] = getPos(anchor);
+      var [x, /*y*/] = getPos(anchor);
       var [docX, docY] = getPos(document);
 
       anchor.scrollToPoint(COORDTYPE_SCREEN_RELATIVE, docX, docY);
       testPos(anchor, [x, docY]);
 
       // scrollToPoint relative window
       anchor = getAccessible("bottom2");
-      var [x, y] = getPos(anchor);
+      var [x, /*y*/] = getPos(anchor);
       var wnd = getRootAccessible().DOMDocument.defaultView;
       var [screenX, screenY] = CSSToDevicePixels(wnd, wnd.screenX, wnd.screenY);
       var scrollToX = docX - screenX, scrollToY = docY - screenY;
 
       anchor.scrollToPoint(COORDTYPE_WINDOW_RELATIVE, scrollToX, scrollToY);
       testPos(anchor, [x, docY]);
 
       // scrollToPoint relative parent
       anchor = getAccessible("bottom3");
-      var [x, y] = getPos(anchor);
+      var [x, /*y*/] = getPos(anchor);
       var [parentX, parentY] = getPos(anchor.parent);
       var scrollToX = parentX - docX, scrollToY = parentY - docY;
 
       anchor.scrollToPoint(COORDTYPE_PARENT_RELATIVE, scrollToX, scrollToY);
       testPos(anchor, [x, docY]);
     }
 
     function doTest()
--- a/accessible/tests/mochitest/scroll/test_zoom_text.html
+++ b/accessible/tests/mochitest/scroll/test_zoom_text.html
@@ -22,29 +22,29 @@
   <script type="application/javascript">
     function doTest()
     {
       var tabDocument = currentTabDocument();
       var paragraphNode = tabDocument.getElementById("paragraph");
       var paragraph = getAccessible(paragraphNode, [nsIAccessibleText]);
       var offset = 64; // beginning of 4th stanza
 
-      var [x, y] = getPos(paragraph);
+      var [x, /*y*/] = getPos(paragraph);
       var [docX, docY] = getPos(tabDocument);
 
       paragraph.scrollSubstringToPoint(offset, offset,
                                        COORDTYPE_SCREEN_RELATIVE, docX, docY);
       testTextPos(paragraph, offset, [x, docY], COORDTYPE_SCREEN_RELATIVE);
 
       zoomDocument(tabDocument, 2.0);
 
       paragraphNode = tabDocument.getElementById("paragraph2");
       paragraph = getAccessible(paragraphNode, [nsIAccessibleText]);
       offset = 52; // // beginning of 4th stanza
-      var [x, y] = getPos(paragraph);
+      var [x, /*y*/] = getPos(paragraph);
       paragraph.scrollSubstringToPoint(offset, offset,
                                        COORDTYPE_SCREEN_RELATIVE, docX, docY);
       testTextPos(paragraph, offset, [x, docY], COORDTYPE_SCREEN_RELATIVE);
 
       closeBrowserWindow();
       SimpleTest.finish();
     }
 
--- a/accessible/tests/mochitest/selectable.js
+++ b/accessible/tests/mochitest/selectable.js
@@ -47,17 +47,17 @@ function testSelectableSelection(aIdenti
 /**
  * Test isItemSelected method, helper for testSelectableSelection
  */
 function testIsItemSelected(aSelectAcc, aTraversedAcc, aIndexObj, aSelectedChildren, aMsg)
 {
   var childCount = aTraversedAcc.childCount;
   for (var idx = 0; idx < childCount; idx++) {
     var child = aTraversedAcc.getChildAt(idx);
-    var [state, extraState] = getStates(child);
+    var [state, /*extraState*/] = getStates(child);
     if (state & STATE_SELECTABLE) {
       var isSelected = false;
       var len = aSelectedChildren.length;
       for (var jdx = 0; jdx < len; jdx++) {
         if (child == getAccessible(aSelectedChildren[jdx])) {
           isSelected = true;
           break;
         }
--- a/accessible/tests/mochitest/states.js
+++ b/accessible/tests/mochitest/states.js
@@ -199,17 +199,17 @@ function testStatesInSubtree(aAccOrElmOr
 }
 
 /**
  * Fails if no defunct state on the accessible.
  */
 function testIsDefunct(aAccessible, aTestName)
 {
   var id = prettyName(aAccessible) + (aTestName ? " [" + aTestName + "]" : "");
-  var [state, extraState] = getStates(aAccessible);
+  var [/*state*/, extraState] = getStates(aAccessible);
   isState(extraState & EXT_STATE_DEFUNCT, EXT_STATE_DEFUNCT, true,
           "no defuct state for " + id + "!");
 }
 
 function getStringStates(aAccOrElmOrID)
 {
   var [state, extraState] = getStates(aAccOrElmOrID);
   return statesToString(state, extraState);
--- a/accessible/tests/mochitest/states/test_aria.html
+++ b/accessible/tests/mochitest/states/test_aria.html
@@ -29,17 +29,17 @@
   <script type="application/javascript">
     function testAriaDisabledTree(aAccOrElmOrID)
     {
       // test accessible and its subtree for propagated state.
       var acc = getAccessible(aAccOrElmOrID);
       if (!acc)
         return;
 
-      var [state, extraState] = getStates(aAccOrElmOrID);
+      var [state, /*extraState*/] = getStates(aAccOrElmOrID);
       if (state & STATE_UNAVAILABLE) {
         var role = getRole(acc);
         if (role != ROLE_GROUPING) {
           testStates(acc, STATE_FOCUSABLE);
         }
       }
 
       // Iterate over its children to see if the state got propagated.
--- a/accessible/tests/mochitest/table.js
+++ b/accessible/tests/mochitest/table.js
@@ -11,17 +11,17 @@
 /**
  * Constants used to describe cells array.
  */
 const kDataCell = 1; // Indicates the cell is origin data cell
 const kRowHeaderCell = 2; // Indicates the cell is row header cell
 const kColHeaderCell = 4; // Indicated the cell is column header cell
 const kOrigin = kDataCell | kRowHeaderCell | kColHeaderCell;
 
-const kRowSpanned = 8; // Indicates the cell is not origin and row spanned 
+const kRowSpanned = 8; // Indicates the cell is not origin and row spanned
 const kColSpanned = 16; // Indicates the cell is not origin and column spanned
 const kSpanned = kRowSpanned | kColSpanned;
 
 /**
  * Constants to define column header type.
  */
 const kNoColumnHeader = 0;
 const kListboxColumnHeader = 1;
@@ -412,17 +412,16 @@ function testTableSelection(aIdentifier,
     is (actualSelCols[i], selCols[i],
         msg + "Column at index " + selCols[i] + " should be selected.");
   }
 
   // Rows selection tests.
   var selRows = new Array();
 
   // isRowSelected test
-  var selrowCount = 0;
   for (var rowIdx = 0; rowIdx < rowCount; rowIdx++) {
     var isRowSelected = true;
     for (var colIdx = 0; colIdx < colsCount; colIdx++) {
       if (aCellsArray[rowIdx][colIdx] == false ||
           aCellsArray[rowIdx][colIdx] == undefined) {
         isRowSelected = false;
         break;
       }
@@ -534,17 +533,16 @@ function testTableSelection(aIdentifier,
 function testUnselectTableColumn(aIdentifier, aColIdx, aCellsArray)
 {
   var acc = getAccessible(aIdentifier, [nsIAccessibleTable]);
   if (!acc)
     return;
 
   var rowCount = aCellsArray.length;
   for (var rowIdx = 0; rowIdx < rowCount; rowIdx++) {
-    var cellState = aCellsArray[rowIdx][aColIdx];
     // Unselect origin cell.
     var [origRowIdx, origColIdx] =
       getOrigRowAndColumn(aCellsArray, rowIdx, aColIdx);
     aCellsArray[origRowIdx][origColIdx] = false;
   }
 
   acc.unselectColumn(aColIdx);
   testTableSelection(aIdentifier, aCellsArray,
--- a/accessible/tests/mochitest/table/test_table_1.html
+++ b/accessible/tests/mochitest/table/test_table_1.html
@@ -45,19 +45,23 @@ function doTest()
   s.addRange(range);
   range = document.createRange();
   cell = getNode("row2c");
   range.selectNode(cell);
   s.addRange(range);
 
   is(accTable.selectedRowCount, 1, "no cells selected");
 
-  var columnDescription = accTable.getColumnDescription(1);
-  var rowDescription = accTable.getRowDescription(1);
-
+  // These shouldn't throw.
+  try {
+    accTable.getColumnDescription(1);
+    accTable.getRowDescription(1);
+  } catch (ex) {
+    ok(false, "getColumnDescription/getRowDescription shouldn't throw.");
+  }
   SimpleTest.finish();
 }
 SimpleTest.waitForExplicitFinish();
 addA11yLoadEvent(doTest);
   </script>
  </head>
  <body >
 
--- a/accessible/tests/mochitest/test_OuterDocAccessible.html
+++ b/accessible/tests/mochitest/test_OuterDocAccessible.html
@@ -35,19 +35,19 @@ https://bugzilla.mozilla.org/show_bug.cg
           testStates(outerDocAcc, STATE_FOCUSABLE, 0);
 
           // see bug 428954: No name wanted for internal frame
           is(outerDocAcc.name, null, "Wrong name for internal frame!");
 
           // see bug 440770, no actions wanted on outer doc
           is(outerDocAcc.actionCount, 0,
              "Wrong number of actions for internal frame!");
-          var actionTempStr; // not really used, just needs to receive a value
+
           try {
-            actionTempStr = outerDocAcc.getActionName(0);
+            outerDocAcc.getActionName(0);
             do_throw("No exception thrown for actionName!");
           } catch(e) {
             ok(e.result, ns_error_invalid_arg,
                "Wrong return value for actionName call!");
           }
 
           try {
             actionTempStr = outerDocAcc.getActionDescription(0);
--- a/accessible/tests/mochitest/text.js
+++ b/accessible/tests/mochitest/text.js
@@ -256,18 +256,18 @@ function testWordCount(aElement, aCount,
 {
   var isFunc = (aToDoFlag == kTodo) ? todo_is : is;
   var acc = getAccessible(aElement, nsIAccessibleText);
   var startOffsetObj = {}, endOffsetObj = {};
   var length = acc.characterCount;
   var offset = 0;
   var wordCount = 0;
   while (true) {
-    var text = acc.getTextAtOffset(offset, BOUNDARY_WORD_START,
-                                   startOffsetObj, endOffsetObj);
+    acc.getTextAtOffset(offset, BOUNDARY_WORD_START,
+                        startOffsetObj, endOffsetObj);
     if (offset >= length)
       break;
 
     wordCount++;
     offset = endOffsetObj.value;
   }
   isFunc(wordCount, aCount,
         "wrong words count for '" + acc.getText(0, -1) + "': " + wordCount +
--- a/accessible/tests/mochitest/tree/test_aria_globals.html
+++ b/accessible/tests/mochitest/tree/test_aria_globals.html
@@ -37,17 +37,17 @@
 
       // Elements having ARIA global state or properties or referred by another
       // element must be accessible.
       ok(isAccessible("pawn"),
          "Must be accessible because referred by another element.");
 
       for (var idx = 0; idx < globalIds.length; idx++) {
         ok(isAccessible(globalIds[idx]),
-           "Must be accessible becuase of " + "aria-" + globalIds[idx] +
+           "Must be accessible becuase of aria-" + globalIds[idx] +
            " presence");
       }
 
       // Unfocusable elements, having ARIA global state or property with a valid
       // IDREF value, and an inherited presentation role. A generic accessible
       // is created (to prevent table cells text jamming).
       ok(!isAccessible("td_nothing", nsIAccessibleTableCell),
          "inherited presentation role takes a place");
--- a/accessible/tests/mochitest/treeupdate/test_list.html
+++ b/accessible/tests/mochitest/treeupdate/test_list.html
@@ -63,33 +63,33 @@
             testDefunctAccessible(aLiAcc, aLiNode);
             testDefunctAccessible(aBulletAcc);
 
             gSequence.processNext();
           },
           0, this.li, this.liNode, this.bullet
         );
       }
-    };
+    }
 
     function showProcessor()
     {
       this.liNode = getNode("li");
 
       this.process = function showProcessor_process()
       {
         this.liNode.style.display = "list-item";
       }
 
       this.onProcessed = function showProcessor_onProcessed()
       {
         testLiAccessibleTree();
         gSequence.processNext();
       }
-    };
+    }
 
     function textReplaceProcessor()
     {
       this.liNode = getNode("li");
 
       this.process = function textReplaceProcessor_process()
       {
         this.liNode.textContent = "hey";
@@ -101,17 +101,17 @@
           LISTITEM: [
             { STATICTEXT: [] },
             { TEXT_LEAF: [] }
           ]
         };
         testAccessibleTree(this.liNode, tree);
         SimpleTest.finish();
       }
-    };
+    }
 
     ////////////////////////////////////////////////////////////////////////////
     // Test
 
     //gA11yEventDumpToConsole = true;
 
     var gSequence = null;
     function doTest()
--- a/accessible/tests/mochitest/treeupdate/test_list_editabledoc.html
+++ b/accessible/tests/mochitest/treeupdate/test_list_editabledoc.html
@@ -60,17 +60,17 @@
         };
         testAccessibleTree(aID, tree);
       }
 
       this.getID = function addLi_getID()
       {
         return "add li";
       }
-    };
+    }
 
     ////////////////////////////////////////////////////////////////////////////
     // Test
 
     //gA11yEventDumpID = "eventdump"; // debug stuff
 
     var gQueue = null;
 
--- a/accessible/tests/mochitest/value/test_general.html
+++ b/accessible/tests/mochitest/value/test_general.html
@@ -31,17 +31,16 @@
       function testValue(aID, aValue)
       {
         var acc = getAccessible(aID);
         if (!acc)
           return;
         is(acc.value, aValue, "Wrong value for " + aID + "!");
       }
 
-      var rootDir = getRootDirectory(window.location.href);
       var href = getRootDirectory(window.location.href) + "foo";
 
       // roles that can't live as HTMLLinkAccessibles
       testValue("aria_menuitem_link", "");
       testValue("aria_button_link", "");
       testValue("aria_checkbox_link", "");
       testValue("aria_application_link", "");