Bug 1385817 - Enable brace-style and no-else-return ESLint rules for accessible/ r?yzen draft
authorDan Banner <dbugs@thebanners.uk>
Tue, 01 Aug 2017 19:08:02 +0100
changeset 620551 e54804891b19172792afe476cba54471e50b53c5
parent 620550 224daacb2fa395ab9a7c63a9cd9e9a17624e4527
child 640736 478afdf67c504cbc20d38fef74eb0f77405820c7
push id72079
push userbmo:dbugs@thebanners.uk
push dateThu, 03 Aug 2017 15:15:22 +0000
reviewersyzen
bugs1385817
milestone57.0a1
Bug 1385817 - Enable brace-style and no-else-return ESLint rules for accessible/ r?yzen MozReview-Commit-ID: DeVusjK4kt0
accessible/.eslintrc.js
accessible/jsat/AccessFu.jsm
accessible/jsat/OutputGenerator.jsm
accessible/jsat/Traversal.jsm
accessible/jsat/Utils.jsm
accessible/tests/mochitest/actions.js
accessible/tests/mochitest/actions/test_anchors.html
accessible/tests/mochitest/actions/test_aria.html
accessible/tests/mochitest/actions/test_controls.html
accessible/tests/mochitest/actions/test_general.html
accessible/tests/mochitest/actions/test_keys.html
accessible/tests/mochitest/actions/test_link.html
accessible/tests/mochitest/actions/test_media.html
accessible/tests/mochitest/actions/test_select.html
accessible/tests/mochitest/attributes.js
accessible/tests/mochitest/attributes/test_dpub_aria_xml-roles.html
accessible/tests/mochitest/attributes/test_obj.html
accessible/tests/mochitest/attributes/test_obj_css.html
accessible/tests/mochitest/attributes/test_obj_group.html
accessible/tests/mochitest/attributes/test_tag.html
accessible/tests/mochitest/attributes/test_xml-roles.html
accessible/tests/mochitest/autocomplete.js
accessible/tests/mochitest/bounds/test_list.html
accessible/tests/mochitest/bounds/test_select.html
accessible/tests/mochitest/browser.js
accessible/tests/mochitest/common.js
accessible/tests/mochitest/editabletext/editabletext.js
accessible/tests/mochitest/editabletext/test_1.html
accessible/tests/mochitest/editabletext/test_2.html
accessible/tests/mochitest/elm/test_HTMLSpec.html
accessible/tests/mochitest/elm/test_MathMLSpec.html
accessible/tests/mochitest/elm/test_canvas.html
accessible/tests/mochitest/elm/test_figure.html
accessible/tests/mochitest/elm/test_nsApplicationAcc.html
accessible/tests/mochitest/elm/test_plugin.html
accessible/tests/mochitest/elm/test_shadowroot.html
accessible/tests/mochitest/events.js
accessible/tests/mochitest/events/docload_wnd.html
accessible/tests/mochitest/events/test_aria_alert.html
accessible/tests/mochitest/events/test_aria_menu.html
accessible/tests/mochitest/events/test_aria_objattr.html
accessible/tests/mochitest/events/test_aria_owns.html
accessible/tests/mochitest/events/test_aria_statechange.html
accessible/tests/mochitest/events/test_attrs.html
accessible/tests/mochitest/events/test_bug1322593-2.html
accessible/tests/mochitest/events/test_bug1322593.html
accessible/tests/mochitest/events/test_caretmove.html
accessible/tests/mochitest/events/test_coalescence.html
accessible/tests/mochitest/events/test_contextmenu.html
accessible/tests/mochitest/events/test_descrchange.html
accessible/tests/mochitest/events/test_docload.html
accessible/tests/mochitest/events/test_docload_aria.html
accessible/tests/mochitest/events/test_dragndrop.html
accessible/tests/mochitest/events/test_flush.html
accessible/tests/mochitest/events/test_focus_aria_activedescendant.html
accessible/tests/mochitest/events/test_focus_canvas.html
accessible/tests/mochitest/events/test_focus_controls.html
accessible/tests/mochitest/events/test_focus_doc.html
accessible/tests/mochitest/events/test_focus_general.html
accessible/tests/mochitest/events/test_focus_name.html
accessible/tests/mochitest/events/test_focus_selects.html
accessible/tests/mochitest/events/test_fromUserInput.html
accessible/tests/mochitest/events/test_mutation.html
accessible/tests/mochitest/events/test_mutation.xhtml
accessible/tests/mochitest/events/test_namechange.html
accessible/tests/mochitest/events/test_selection.html
accessible/tests/mochitest/events/test_selection_aria.html
accessible/tests/mochitest/events/test_statechange.html
accessible/tests/mochitest/events/test_text.html
accessible/tests/mochitest/events/test_text_alg.html
accessible/tests/mochitest/events/test_textattrchange.html
accessible/tests/mochitest/events/test_textselchange.html
accessible/tests/mochitest/events/test_valuechange.html
accessible/tests/mochitest/focus/test_focusedChild.html
accessible/tests/mochitest/focus/test_takeFocus.html
accessible/tests/mochitest/grid.js
accessible/tests/mochitest/hittest/test_browser.html
accessible/tests/mochitest/hittest/test_canvas_hitregion.html
accessible/tests/mochitest/hittest/test_general.html
accessible/tests/mochitest/hittest/test_shadowroot.html
accessible/tests/mochitest/hittest/test_zoom.html
accessible/tests/mochitest/hittest/test_zoom_text.html
accessible/tests/mochitest/hyperlink/hyperlink.js
accessible/tests/mochitest/hyperlink/test_general.html
accessible/tests/mochitest/hypertext/test_general.html
accessible/tests/mochitest/hypertext/test_update.html
accessible/tests/mochitest/jsat/test_content_integration.html
accessible/tests/mochitest/jsat/test_traversal.html
accessible/tests/mochitest/jsat/test_traversal_helper.html
accessible/tests/mochitest/layout.js
accessible/tests/mochitest/name.js
accessible/tests/mochitest/name/markup.js
accessible/tests/mochitest/name/test_counterstyle.html
accessible/tests/mochitest/name/test_general.html
accessible/tests/mochitest/name/test_link.html
accessible/tests/mochitest/name/test_list.html
accessible/tests/mochitest/name/test_svg.html
accessible/tests/mochitest/pivot.js
accessible/tests/mochitest/pivot/test_virtualcursor.html
accessible/tests/mochitest/pivot/test_virtualcursor_text.html
accessible/tests/mochitest/relations.js
accessible/tests/mochitest/relations/test_bindings.xhtml
accessible/tests/mochitest/relations/test_general.html
accessible/tests/mochitest/relations/test_ui_modalprompt.html
accessible/tests/mochitest/relations/test_update.html
accessible/tests/mochitest/role.js
accessible/tests/mochitest/role/test_aria.html
accessible/tests/mochitest/role/test_dpub_aria.html
accessible/tests/mochitest/role/test_general.html
accessible/tests/mochitest/role/test_svg.html
accessible/tests/mochitest/scroll/test_zoom.html
accessible/tests/mochitest/selectable.js
accessible/tests/mochitest/selectable/test_aria.html
accessible/tests/mochitest/selectable/test_select.html
accessible/tests/mochitest/states.js
accessible/tests/mochitest/states/test_aria.html
accessible/tests/mochitest/states/test_aria_imgmap.html
accessible/tests/mochitest/states/test_aria_widgetitems.html
accessible/tests/mochitest/states/test_buttons.html
accessible/tests/mochitest/states/test_controls.html
accessible/tests/mochitest/states/test_doc.html
accessible/tests/mochitest/states/test_doc_busy.html
accessible/tests/mochitest/states/test_docarticle.html
accessible/tests/mochitest/states/test_editablebody.html
accessible/tests/mochitest/states/test_frames.html
accessible/tests/mochitest/states/test_inputs.html
accessible/tests/mochitest/states/test_link.html
accessible/tests/mochitest/states/test_selects.html
accessible/tests/mochitest/states/test_stale.html
accessible/tests/mochitest/states/test_visibility.html
accessible/tests/mochitest/states/z_frames_update.html
accessible/tests/mochitest/table.js
accessible/tests/mochitest/table/test_css_tables.html
accessible/tests/mochitest/table/test_headers_ariagrid.html
accessible/tests/mochitest/table/test_headers_ariatable.html
accessible/tests/mochitest/table/test_headers_table.html
accessible/tests/mochitest/table/test_indexes_ariagrid.html
accessible/tests/mochitest/table/test_indexes_table.html
accessible/tests/mochitest/table/test_layoutguess.html
accessible/tests/mochitest/table/test_mtable.html
accessible/tests/mochitest/table/test_sels_ariagrid.html
accessible/tests/mochitest/table/test_sels_table.html
accessible/tests/mochitest/table/test_struct_ariagrid.html
accessible/tests/mochitest/table/test_struct_ariatreegrid.html
accessible/tests/mochitest/table/test_struct_table.html
accessible/tests/mochitest/table/test_table_1.html
accessible/tests/mochitest/table/test_table_2.html
accessible/tests/mochitest/test_OuterDocAccessible.html
accessible/tests/mochitest/test_aria_token_attrs.html
accessible/tests/mochitest/test_bug420863.html
accessible/tests/mochitest/test_descr.html
accessible/tests/mochitest/test_nsIAccessibleDocument.html
accessible/tests/mochitest/test_nsIAccessibleImage.html
accessible/tests/mochitest/text.js
accessible/tests/mochitest/text/test_atcaretoffset.html
accessible/tests/mochitest/text/test_charboundary.html
accessible/tests/mochitest/text/test_doc.html
accessible/tests/mochitest/text/test_dynamic.html
accessible/tests/mochitest/text/test_gettext.html
accessible/tests/mochitest/text/test_hypertext.html
accessible/tests/mochitest/text/test_lineboundary.html
accessible/tests/mochitest/text/test_passwords.html
accessible/tests/mochitest/text/test_selection.html
accessible/tests/mochitest/text/test_wordboundary.html
accessible/tests/mochitest/text/test_words.html
accessible/tests/mochitest/textattrs/test_general.html
accessible/tests/mochitest/textattrs/test_invalid.html
accessible/tests/mochitest/textcaret/test_general.html
accessible/tests/mochitest/textrange/test_general.html
accessible/tests/mochitest/textrange/test_selection.html
accessible/tests/mochitest/textselection/test_general.html
accessible/tests/mochitest/textselection/test_userinput.html
accessible/tests/mochitest/tree/test_aria_globals.html
accessible/tests/mochitest/tree/test_aria_grid.html
accessible/tests/mochitest/tree/test_aria_imgmap.html
accessible/tests/mochitest/tree/test_aria_list.html
accessible/tests/mochitest/tree/test_aria_menu.html
accessible/tests/mochitest/tree/test_aria_owns.html
accessible/tests/mochitest/tree/test_aria_presentation.html
accessible/tests/mochitest/tree/test_aria_table.html
accessible/tests/mochitest/tree/test_brokencontext.html
accessible/tests/mochitest/tree/test_canvas.html
accessible/tests/mochitest/tree/test_cssflexbox.html
accessible/tests/mochitest/tree/test_cssoverflow.html
accessible/tests/mochitest/tree/test_dochierarchy.html
accessible/tests/mochitest/tree/test_dockids.html
accessible/tests/mochitest/tree/test_filectrl.html
accessible/tests/mochitest/tree/test_formctrl.html
accessible/tests/mochitest/tree/test_gencontent.html
accessible/tests/mochitest/tree/test_iframe.html
accessible/tests/mochitest/tree/test_img.html
accessible/tests/mochitest/tree/test_invalid_img.xhtml
accessible/tests/mochitest/tree/test_invalidationlist.html
accessible/tests/mochitest/tree/test_list.html
accessible/tests/mochitest/tree/test_map.html
accessible/tests/mochitest/tree/test_media.html
accessible/tests/mochitest/tree/test_select.html
accessible/tests/mochitest/tree/test_table.html
accessible/tests/mochitest/tree/test_txtcntr.html
accessible/tests/mochitest/tree/test_txtctrl.html
accessible/tests/mochitest/treeupdate/test_ariadialog.html
accessible/tests/mochitest/treeupdate/test_ariaowns.html
accessible/tests/mochitest/treeupdate/test_bug1040735.html
accessible/tests/mochitest/treeupdate/test_bug1100602.html
accessible/tests/mochitest/treeupdate/test_bug1175913.html
accessible/tests/mochitest/treeupdate/test_bug1189277.html
accessible/tests/mochitest/treeupdate/test_bug1276857.html
accessible/tests/mochitest/treeupdate/test_bug852150.xhtml
accessible/tests/mochitest/treeupdate/test_bug883708.xhtml
accessible/tests/mochitest/treeupdate/test_bug884251.xhtml
accessible/tests/mochitest/treeupdate/test_bug895082.html
accessible/tests/mochitest/treeupdate/test_canvas.html
accessible/tests/mochitest/treeupdate/test_cssoverflow.html
accessible/tests/mochitest/treeupdate/test_doc.html
accessible/tests/mochitest/treeupdate/test_gencontent.html
accessible/tests/mochitest/treeupdate/test_general.html
accessible/tests/mochitest/treeupdate/test_hidden.html
accessible/tests/mochitest/treeupdate/test_imagemap.html
accessible/tests/mochitest/treeupdate/test_list.html
accessible/tests/mochitest/treeupdate/test_list_editabledoc.html
accessible/tests/mochitest/treeupdate/test_optgroup.html
accessible/tests/mochitest/treeupdate/test_recreation.html
accessible/tests/mochitest/treeupdate/test_select.html
accessible/tests/mochitest/treeupdate/test_table.html
accessible/tests/mochitest/treeupdate/test_textleaf.html
accessible/tests/mochitest/treeupdate/test_visibility.html
accessible/tests/mochitest/treeupdate/test_whitespace.html
accessible/tests/mochitest/treeview.js
accessible/tests/mochitest/value.js
accessible/tests/mochitest/value/test_general.html
accessible/tests/mochitest/value/test_number.html
accessible/tests/mochitest/value/test_progress.html
accessible/tests/mochitest/value/test_range.html
--- a/accessible/.eslintrc.js
+++ b/accessible/.eslintrc.js
@@ -3,17 +3,15 @@
 module.exports = {
   "rules": {
     // Warn about cyclomatic complexity in functions.
     "complexity": ["error", 42],
 
     // 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",
     "object-shorthand": "off",
-    "no-else-return": "off",
     "no-unexpected-multiline": "off",
     "no-unsafe-finally": "off",
     "no-useless-call": "off",
   }
 };
--- a/accessible/jsat/AccessFu.jsm
+++ b/accessible/jsat/AccessFu.jsm
@@ -768,44 +768,44 @@ var Input = {
         }
         break;
       case aEvent.DOM_VK_RIGHT:
         if (this.editState.editing) {
           if (!this.editState.atEnd) {
             // Don't move forward if caret is not at end of entry.
             // XXX: Fix for rtl
             return;
-          } else {
-            target.blur();
           }
+          target.blur();
+
         }
         this.moveCursor(aEvent.shiftKey ?
           "moveLast" : "moveNext", "Simple", "keyboard");
         break;
       case aEvent.DOM_VK_LEFT:
         if (this.editState.editing) {
           if (!this.editState.atStart) {
             // Don't move backward if caret is not at start of entry.
             // XXX: Fix for rtl
             return;
-          } else {
-            target.blur();
           }
+          target.blur();
+
         }
         this.moveCursor(aEvent.shiftKey ?
           "moveFirst" : "movePrevious", "Simple", "keyboard");
         break;
       case aEvent.DOM_VK_UP:
         if (this.editState.multiline) {
           if (!this.editState.atStart) {
             // Don't blur content if caret is not at start of text area.
             return;
-          } else {
-            target.blur();
           }
+          target.blur();
+
         }
 
         if (Utils.MozBuildApp == "mobile/android") {
           // Return focus to native Android browser chrome.
           Utils.win.WindowEventDispatcher.dispatch("ToggleChrome:Focus");
         }
         break;
       case aEvent.DOM_VK_RETURN:
--- a/accessible/jsat/OutputGenerator.jsm
+++ b/accessible/jsat/OutputGenerator.jsm
@@ -666,18 +666,17 @@ this.UtteranceGenerator = {  // jshint i
     listitem: function listitem(aAccessible, aRoleStr, aState, aFlags) {
       let itemno = {};
       let itemof = {};
       aAccessible.groupPosition({}, itemof, itemno);
       let utterance = [];
       if (itemno.value == 1) {
         // Start of list
         utterance.push({string: "listStart"});
-      }
-      else if (itemno.value == itemof.value) {
+      } else if (itemno.value == itemof.value) {
         // last item
         utterance.push({string: "listEnd"});
       }
 
       this._addName(utterance, aAccessible, aFlags);
       this._addLandmark(utterance, aAccessible);
 
       return utterance;
--- a/accessible/jsat/Traversal.jsm
+++ b/accessible/jsat/Traversal.jsm
@@ -42,18 +42,17 @@ function BaseTraversalRule(aRoles, aMatc
 }
 
 BaseTraversalRule.prototype = {
     getMatchRoles: function BaseTraversalRule_getmatchRoles(aRoles) {
       aRoles.value = this._matchRoles;
       return aRoles.value.length;
     },
 
-    match: function BaseTraversalRule_match(aAccessible)
-    {
+    match: function BaseTraversalRule_match(aAccessible) {
       let role = aAccessible.role;
       if (role == Roles.INTERNAL_FRAME) {
         return (Utils.getMessageManager(aAccessible.DOMNode)) ?
           Filters.MATCH | Filters.IGNORE_SUBTREE : Filters.IGNORE;
       }
 
       let matchResult =
         (this._explicitMatchRoles.has(role) || !this._explicitMatchRoles.size) ?
@@ -189,24 +188,23 @@ this.TraversalRules = { // jshint ignore
 
   SimpleOnScreen: new BaseTraversalRule(
     gSimpleTraversalRoles, gSimpleMatchFunc,
     Prefilters.DEFUNCT | Prefilters.INVISIBLE | Prefilters.ARIA_HIDDEN |
     Prefilters.TRANSPARENT | Prefilters.OFFSCREEN),
 
   Anchor: new BaseTraversalRule(
     [Roles.LINK],
-    function Anchor_match(aAccessible)
-    {
+    function Anchor_match(aAccessible) {
       // We want to ignore links, only focus named anchors.
       if (Utils.getState(aAccessible).contains(States.LINKED)) {
         return Filters.IGNORE;
-      } else {
-        return Filters.MATCH;
       }
+      return Filters.MATCH;
+
     }),
 
   Button: new BaseTraversalRule(
     [Roles.PUSHBUTTON,
      Roles.SPINBUTTON,
      Roles.TOGGLE_BUTTON,
      Roles.BUTTONDROPDOWN,
      Roles.BUTTONDROPDOWNGRID]),
@@ -279,24 +277,23 @@ this.TraversalRules = { // jshint ignore
     }),
 
   ListItem: new BaseTraversalRule(
     [Roles.LISTITEM,
      Roles.TERM]),
 
   Link: new BaseTraversalRule(
     [Roles.LINK],
-    function Link_match(aAccessible)
-    {
+    function Link_match(aAccessible) {
       // We want to ignore anchors, only focus real links.
       if (Utils.getState(aAccessible).contains(States.LINKED)) {
         return Filters.MATCH;
-      } else {
-        return Filters.IGNORE;
       }
+      return Filters.IGNORE;
+
     }),
 
   /* For TalkBack's "Control" granularity. Form conrols and links */
   Control: new BaseTraversalRule(
     [Roles.PUSHBUTTON,
      Roles.SPINBUTTON,
      Roles.TOGGLE_BUTTON,
      Roles.BUTTONDROPDOWN,
@@ -309,18 +306,17 @@ this.TraversalRules = { // jshint ignore
      Roles.RADIOBUTTON,
      Roles.RADIO_MENU_ITEM,
      Roles.SLIDER,
      Roles.CHECKBUTTON,
      Roles.CHECK_MENU_ITEM,
      Roles.SWITCH,
      Roles.LINK,
      Roles.MENUITEM],
-    function Control_match(aAccessible)
-    {
+    function Control_match(aAccessible) {
       // We want to ignore anchors, only focus real links.
       if (aAccessible.role == Roles.LINK &&
           !Utils.getState(aAccessible).contains(States.LINKED)) {
         return Filters.IGNORE;
       }
       return Filters.MATCH;
     }),
 
@@ -404,14 +400,14 @@ this.TraversalHelper = {
           aVirtualCursor.modalRoot = null;
         } else {
           // If we failed to step to another container, break and return false.
           break;
         }
       }
 
       return moved;
-    } else {
-      return aVirtualCursor[aMethod](rule);
     }
+    return aVirtualCursor[aMethod](rule);
+
   }
 
 };
--- a/accessible/jsat/Utils.jsm
+++ b/accessible/jsat/Utils.jsm
@@ -259,22 +259,22 @@ this.Utils = { // jshint ignore:line
     }
   },
 
   getState: function getState(aAccessibleOrEvent) {
     if (aAccessibleOrEvent instanceof Ci.nsIAccessibleStateChangeEvent) {
       return new State(
         aAccessibleOrEvent.isExtraState ? 0 : aAccessibleOrEvent.state,
         aAccessibleOrEvent.isExtraState ? aAccessibleOrEvent.state : 0);
-    } else {
+    }
       let state = {};
       let extState = {};
       aAccessibleOrEvent.getState(state, extState);
       return new State(state.value, extState.value);
-    }
+
   },
 
   getAttributes: function getAttributes(aAccessible) {
     let attributes = {};
 
     if (aAccessible && aAccessible.attributes) {
       let attributesEnum = aAccessible.attributes.enumerate();
 
--- a/accessible/tests/mochitest/actions.js
+++ b/accessible/tests/mochitest/actions.js
@@ -42,18 +42,17 @@ const XUL_EVENTS = CLICK_EVENTS | COMMAN
  *    // [optional] an array of invoker's checker objects (see eventQueue
  *    // constructor events.js)
  *    get eventSeq() {}
  *  };
  *
  *
  * @param  aArray [in] an array of action cheker objects
  */
-function testActions(aArray)
-{
+function testActions(aArray) {
   gActionsQueue = new eventQueue();
 
   for (var idx = 0; idx < aArray.length; idx++) {
 
     var actionObj = aArray[idx];
     var accOrElmOrID = actionObj.ID;
     var actionIndex = actionObj.actionIndex;
     var actionName = actionObj.actionName;
@@ -89,18 +88,17 @@ function testActions(aArray)
   }
 
   gActionsQueue.invoke();
 }
 
 /**
  * Test action names and descriptions.
  */
-function testActionNames(aID, aActions)
-{
+function testActionNames(aID, aActions) {
   var actions = (typeof aActions == "string") ?
     [ aActions ] : (aActions || []);
 
   var acc = getAccessible(aID);
   is(acc.actionCount, actions.length, "Wong number of actions.");
   for (var i = 0; i < actions.length; i++ ) {
     is(acc.getActionName(i), actions[i], "Wrong action name at " + i + " index.");
     is(acc.getActionDescription(0), gActionDescrMap[actions[i]],
@@ -108,67 +106,60 @@ function testActionNames(aID, aActions)
   }
 }
 
 // //////////////////////////////////////////////////////////////////////////////
 // Private
 
 var gActionsQueue = null;
 
-function actionInvoker(aAccOrElmOrId, aActionIndex, aActionName, aEventSeq)
-{
-  this.invoke = function actionInvoker_invoke()
-  {
+function actionInvoker(aAccOrElmOrId, aActionIndex, aActionName, aEventSeq) {
+  this.invoke = function actionInvoker_invoke() {
     var acc = getAccessible(aAccOrElmOrId);
     if (!acc)
       return INVOKER_ACTION_FAILED;
 
     var isThereActions = acc.actionCount > 0;
     ok(isThereActions,
        "No actions on the accessible for " + prettyName(aAccOrElmOrId));
 
     if (!isThereActions)
       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()
-  {
+  this.getID = function actionInvoker_getID() {
     return "invoke an action " + aActionName + " at index " + aActionIndex +
       " on " + prettyName(aAccOrElmOrId);
   }
 }
 
-function checkerOfActionInvoker(aType, aTarget, aActionObj)
-{
+function checkerOfActionInvoker(aType, aTarget, aActionObj) {
   this.type = aType;
 
   this.target = aTarget;
 
   this.phase = false;
 
-  this.getID = function getID()
-  {
+  this.getID = function getID() {
     return aType + " event handling";
   }
 
-  this.check = function check(aEvent)
-  {
+  this.check = function check(aEvent) {
     if (aActionObj && "checkOnClickEvent" in aActionObj)
       aActionObj.checkOnClickEvent(aEvent);
   }
 }
 
 var gActionDescrMap =
 {
   jump: "Jump",
--- a/accessible/tests/mochitest/actions/test_anchors.html
+++ b/accessible/tests/mochitest/actions/test_anchors.html
@@ -16,34 +16,31 @@
           src="../events.js"></script>
   <script type="application/javascript"
           src="../actions.js"></script>
 
   <script type="application/javascript">
     // //////////////////////////////////////////////////////////////////////////
     // Event checkers
 
-    function scrollingChecker(aAcc)
-    {
+    function scrollingChecker(aAcc) {
       this.type = EVENT_SCROLLING_START;
       this.target = aAcc;
-      this.getID = function scrollingChecker_getID()
-      {
+      this.getID = function scrollingChecker_getID() {
         return "scrolling start handling for " + prettyName(aAcc);
       }
     }
 
     // //////////////////////////////////////////////////////////////////////////
     // Test
 
     // gA11yEventDumpID = "debug"; // debug stuff
     // gA11yEventDumpToConsole = true; // debug stuff
 
-    function doTest()
-    {
+    function doTest() {
       var actionsArray = [
         {
           ID: "anchor1",
           actionName: "jump",
           actionIndex: 0,
           events: CLICK_EVENTS,
           eventSeq: [
             new scrollingChecker(getAccessible("bottom1"))
--- a/accessible/tests/mochitest/actions/test_aria.html
+++ b/accessible/tests/mochitest/actions/test_aria.html
@@ -12,18 +12,17 @@
   <script type="application/javascript"
           src="../common.js"></script>
   <script type="application/javascript"
           src="../events.js"></script>
   <script type="application/javascript"
           src="../actions.js"></script>
 
   <script type="application/javascript">
-    function doTest()
-    {
+    function doTest() {
       var actionsArray = [
         {
           ID: "clickable",
           actionName: "click",
           events: CLICK_EVENTS
         },
         {
           ID: "button",
--- a/accessible/tests/mochitest/actions/test_controls.html
+++ b/accessible/tests/mochitest/actions/test_controls.html
@@ -16,18 +16,17 @@
   <script type="application/javascript"
           src="../states.js"></script>
   <script type="application/javascript"
           src="../events.js"></script>
   <script type="application/javascript"
           src="../actions.js"></script>
 
   <script type="application/javascript">
-    function doTest()
-    {
+    function doTest() {
       var actionsArray = [
         {
           ID: "button",
           actionName: "press",
           events: CLICK_EVENTS
         },
         {
           ID: "input_button",
--- a/accessible/tests/mochitest/actions/test_general.html
+++ b/accessible/tests/mochitest/actions/test_general.html
@@ -12,18 +12,17 @@
   <script type="application/javascript"
           src="../common.js"></script>
   <script type="application/javascript"
           src="../events.js"></script>
   <script type="application/javascript"
           src="../actions.js"></script>
 
   <script type="application/javascript">
-    function doTest()
-    {
+    function doTest() {
       var actionsArray = [
         {
           ID: "li_clickable1",
           actionName: "click",
           events: CLICK_EVENTS
         },
         {
           ID: "li_clickable2",
--- a/accessible/tests/mochitest/actions/test_keys.html
+++ b/accessible/tests/mochitest/actions/test_keys.html
@@ -8,28 +8,26 @@
 
   <script type="application/javascript"
           src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
 
   <script type="application/javascript"
           src="../common.js"></script>
 
   <script type="application/javascript">
-    function testAcessKey(aAccOrElmOrID, aKey)
-    {
+    function testAcessKey(aAccOrElmOrID, aKey) {
       var acc = getAccessible(aAccOrElmOrID);
       if (!acc)
         return;
 
       is(acc.accessKey, aKey,
          "Wrong keyboard shortcut on " + prettyName(aAccOrElmOrID));
     }
 
-    function doTest()
-    {
+    function doTest() {
       testAcessKey("input1", "");
       testAcessKey("input2", MAC ? "⌃⌥b" : "Alt+Shift+b");
       testAcessKey("link", MAC ? "⌃⌥l" : "Alt+Shift+l");
 
       SimpleTest.finish();
     }
 
     SimpleTest.waitForExplicitFinish();
--- a/accessible/tests/mochitest/actions/test_link.html
+++ b/accessible/tests/mochitest/actions/test_link.html
@@ -12,58 +12,53 @@
   <script type="application/javascript"
           src="../common.js"></script>
   <script type="application/javascript"
           src="../events.js"></script>
   <script type="application/javascript"
           src="../actions.js"></script>
 
   <script type="application/javascript">
-    function getAnchorTargetDocumentAcc()
-    {
+    function getAnchorTargetDocumentAcc() {
       var thisTabDocAcc = getTabDocAccessible();
       var thisDocTabPanelAcc = thisTabDocAcc.parent.parent;
       var tabPanelsAcc = thisDocTabPanelAcc.parent;
       var newDocTabPanelAcc = tabPanelsAcc.firstChild;
       var nextAcc = newDocTabPanelAcc;
 
       while (nextAcc = nextAcc.nextSibling) {
         // Find the last accessible for a browser with about:mozilla loaded.
         if (nextAcc.firstChild.DOMNode.currentURI.spec == "about:mozilla") {
           newDocTabPanelAcc = nextAcc;
         }
       }
 
       return newDocTabPanelAcc.firstChild.firstChild;
     }
 
-    function linkChecker(aID)
-    {
+    function linkChecker(aID) {
       this.type = EVENT_DOCUMENT_LOAD_COMPLETE;
       this.__defineGetter__("target", getAnchorTargetDocumentAcc);
 
-      this.check = function linkChecker_check()
-      {
+      this.check = function linkChecker_check() {
         var anchorTargetWindow =
           getAccessible(getAnchorTargetDocumentAcc(), [nsIAccessibleDocument]).
           window;
         anchorTargetWindow.close();
       }
 
-      this.getID = function linkChecker_getID()
-      {
+      this.getID = function linkChecker_getID() {
         return "link '" + aID + "' states check ";
       }
     }
 
     // gA11yEventDumpToConsole = true;
     // enableLogging("tree,eventTree,verbose");
 
-    function doTest()
-    {
+    function doTest() {
       var actionsArray = [
         {
           ID: "link1",
           actionName: "jump",
           events: CLICK_EVENTS,
           eventSeq: [
             new linkChecker("link1")
           ]
--- a/accessible/tests/mochitest/actions/test_media.html
+++ b/accessible/tests/mochitest/actions/test_media.html
@@ -21,47 +21,40 @@ https://bugzilla.mozilla.org/show_bug.cg
   <script type="application/javascript"
           src="../states.js"></script>
 
   <script type="application/javascript">
 
     // gA11yEventDumpID = "eventDump";
     // gA11yEventDumpToConsole = true; // debug stuff
 
-    function focusChecker(aAcc)
-    {
+    function focusChecker(aAcc) {
       this.type = EVENT_FOCUS;
       this.target = aAcc;
-      this.getID = function focusChecker_getID()
-      {
+      this.getID = function focusChecker_getID() {
         return "focus handling";
       }
-      this.check = function focusChecker_check(aEvent)
-      {
+      this.check = function focusChecker_check(aEvent) {
         testStates(this.target, STATE_FOCUSED);
       }
     }
 
-    function nameChecker(aAcc, aName)
-    {
+    function nameChecker(aAcc, aName) {
       this.type = EVENT_NAME_CHANGE;
       this.target = aAcc;
-      this.getID = function nameChecker_getID()
-      {
+      this.getID = function nameChecker_getID() {
         return "name change handling";
       },
-      this.check = function nameChecker_check(aEvent)
-      {
+      this.check = function nameChecker_check(aEvent) {
         is(aEvent.accessible.name, aName,
            "Wrong name of " + prettyName(aEvent.accessible) + " on focus");
       }
     }
 
-    function doTest()
-    {
+    function doTest() {
       // ////////////////////////////////////////////////////////////////////////
       // 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;
--- a/accessible/tests/mochitest/actions/test_select.html
+++ b/accessible/tests/mochitest/actions/test_select.html
@@ -17,18 +17,17 @@
           src="../states.js"></script>
   <script type="application/javascript"
           src="../events.js"></script>
   <script type="application/javascript"
           src="../actions.js"></script>
 
   <script type="application/javascript">
     // gA11yEventDumpToConsole = true; // debugging
-    function doTest()
-    {
+    function doTest() {
       var actionsArray = [
         {
           ID: "lb_apple",
           actionIndex: 0,
           actionName: "select",
           events: CLICK_EVENTS,
           eventSeq: [
             new focusChecker("lb_apple")
--- a/accessible/tests/mochitest/attributes.js
+++ b/accessible/tests/mochitest/attributes.js
@@ -5,38 +5,35 @@
  * Test object attributes.
  *
  * @param aAccOrElmOrID         [in] the accessible identifier
  * @param aAttrs                [in] the map of expected object attributes
  *                              (name/value pairs)
  * @param aSkipUnexpectedAttrs  [in] points this function doesn't fail if
  *                              unexpected attribute is encountered
  */
-function testAttrs(aAccOrElmOrID, aAttrs, aSkipUnexpectedAttrs)
-{
+function testAttrs(aAccOrElmOrID, aAttrs, aSkipUnexpectedAttrs) {
   testAttrsInternal(aAccOrElmOrID, aAttrs, aSkipUnexpectedAttrs);
 }
 
 /**
  * Test object attributes that must not be present.
  *
  * @param aAccOrElmOrID         [in] the accessible identifier
  * @param aAbsentAttrs          [in] map of attributes that should not be
  *                              present (name/value pairs)
  */
-function testAbsentAttrs(aAccOrElmOrID, aAbsentAttrs)
-{
+function testAbsentAttrs(aAccOrElmOrID, aAbsentAttrs) {
   testAttrsInternal(aAccOrElmOrID, {}, true, aAbsentAttrs);
 }
 
 /**
  * Test CSS based object attributes.
  */
-function testCSSAttrs(aID)
-{
+function testCSSAttrs(aID) {
   var node = document.getElementById(aID);
   var computedStyle = document.defaultView.getComputedStyle(node);
 
   var attrs = {
     "display": computedStyle.display,
     "text-align": computedStyle.textAlign,
     "text-indent": computedStyle.textIndent,
     "margin-left": computedStyle.marginLeft,
@@ -45,18 +42,17 @@ function testCSSAttrs(aID)
     "margin-bottom": computedStyle.marginBottom
   };
   testAttrs(aID, attrs, true);
 }
 
 /**
  * Test the accessible that it doesn't have CSS-based object attributes.
  */
-function testAbsentCSSAttrs(aID)
-{
+function testAbsentCSSAttrs(aID) {
   var attrs = {
     "display": "",
     "text-align": "",
     "text-indent": "",
     "margin-left": "",
     "margin-right": "",
     "margin-top": "",
     "margin-bottom": ""
@@ -68,18 +64,17 @@ function testAbsentCSSAttrs(aID)
  * Test group object attributes (posinset, setsize and level) and
  * nsIAccessible::groupPosition() method.
  *
  * @param aAccOrElmOrID  [in] the ID, DOM node or accessible
  * @param aPosInSet      [in] the value of 'posinset' attribute
  * @param aSetSize       [in] the value of 'setsize' attribute
  * @param aLevel         [in, optional] the value of 'level' attribute
  */
-function testGroupAttrs(aAccOrElmOrID, aPosInSet, aSetSize, aLevel)
-{
+function testGroupAttrs(aAccOrElmOrID, aPosInSet, aSetSize, aLevel) {
   var acc = getAccessible(aAccOrElmOrID);
   var levelObj = {}, posInSetObj = {}, setSizeObj = {};
   acc.groupPosition(levelObj, setSizeObj, posInSetObj);
 
   if (aPosInSet && aSetSize) {
     is(posInSetObj.value, aPosInSet,
        "Wrong group position (posinset) for " + prettyName(aAccOrElmOrID));
     is(setSizeObj.value, aSetSize,
@@ -119,18 +114,17 @@ function testGroupAttrs(aAccOrElmOrID, a
  * @param aStartOffset          [in] expected start offset where text attributes
  *                              are applied
  * @param aEndOffset            [in] expected end offset where text attribute
  *                              are applied
  * @param aSkipUnexpectedAttrs  [in] points the function doesn't fail if
  *                              unexpected attribute is encountered
  */
 function testTextAttrs(aID, aOffset, aAttrs, aDefAttrs,
-                       aStartOffset, aEndOffset, aSkipUnexpectedAttrs)
-{
+                       aStartOffset, aEndOffset, aSkipUnexpectedAttrs) {
   var accessible = getAccessible(aID, [nsIAccessibleText]);
   if (!accessible)
     return;
 
   var startOffset = { value: -1 };
   var endOffset = { value: -1 };
 
   // do not include attributes exposed on hyper text accessible
@@ -171,18 +165,17 @@ function testTextAttrs(aID, aOffset, aAt
  *
  * @param aID                   [in] the ID of DOM element having text
  *                              accessible
  * @param aDefAttrs             [in] the map of expected text attributes
  *                              (name/value pairs)
  * @param aSkipUnexpectedAttrs  [in] points the function doesn't fail if
  *                              unexpected attribute is encountered
  */
-function testDefaultTextAttrs(aID, aDefAttrs, aSkipUnexpectedAttrs)
-{
+function testDefaultTextAttrs(aID, aDefAttrs, aSkipUnexpectedAttrs) {
   var accessible = getAccessible(aID, [nsIAccessibleText]);
   if (!accessible)
     return;
 
   var defAttrs = null;
   try {
     defAttrs = accessible.defaultTextAttributes;
   } catch (e) {
@@ -195,18 +188,17 @@ function testDefaultTextAttrs(aID, aDefA
 
   var errorMsg = ". Getting default text attributes for " + aID;
   compareAttrs(errorMsg, defAttrs, aDefAttrs, aSkipUnexpectedAttrs);
 }
 
 /**
  * Test text attributes for wrong offset.
  */
-function testTextAttrsWrongOffset(aID, aOffset)
-{
+function testTextAttrsWrongOffset(aID, aOffset) {
   var res = false;
   try {
   var s = {}, e = {};
   var acc = getAccessible(ID, [nsIAccessibleText]);
     acc.getTextAttributes(false, 157, s, e);
   } catch (e) {
     res = true;
   }
@@ -237,18 +229,17 @@ const kSansSerifFontFamily =
 const kSerifFontFamily =
   function(aFontFamily) { return aFontFamily != "serif"; }
 
 const kCursiveFontFamily = LINUX ? "DejaVu Serif" : "Comic Sans MS";
 
 /**
  * Return used font from the given computed style.
  */
-function fontFamily(aComputedStyle)
-{
+function fontFamily(aComputedStyle) {
   var name = aComputedStyle.fontFamily;
   switch (name) {
     case "monospace":
       return kMonospaceFontFamily;
     case "sans-serif":
       return kSansSerifFontFamily;
     case "serif":
       return kSerifFontFamily;
@@ -260,18 +251,17 @@ function fontFamily(aComputedStyle)
 /**
  * Build an object of default text attributes expected for the given accessible.
  *
  * @param aID          [in] identifier of accessible
  * @param aFontSize    [in] font size
  * @param aFontWeight  [in, optional] kBoldFontWeight or kNormalFontWeight,
  *                      default value is kNormalFontWeight
  */
-function buildDefaultTextAttrs(aID, aFontSize, aFontWeight, aFontFamily)
-{
+function buildDefaultTextAttrs(aID, aFontSize, aFontWeight, aFontFamily) {
   var elm = getNode(aID);
   var computedStyle = document.defaultView.getComputedStyle(elm);
   var bgColor = computedStyle.backgroundColor == "rgba(0, 0, 0, 0)" ?
     "rgb(255, 255, 255)" : computedStyle.backgroundColor;
 
   var defAttrs = {
     "font-style": computedStyle.fontStyle,
     "font-size": aFontSize,
@@ -284,18 +274,17 @@ function buildDefaultTextAttrs(aID, aFon
 
   return defAttrs;
 }
 
 // //////////////////////////////////////////////////////////////////////////////
 // Private.
 
 function getTextAttributes(aID, aAccessible, aIncludeDefAttrs, aOffset,
-                           aStartOffset, aEndOffset)
-{
+                           aStartOffset, aEndOffset) {
   // This function expects the passed in accessible to already be queried for
   // nsIAccessibleText.
   var attrs = null;
   try {
     attrs = aAccessible.getTextAttributes(aIncludeDefAttrs, aOffset,
                                           aStartOffset, aEndOffset);
   } catch (e) {
   }
@@ -303,18 +292,17 @@ function getTextAttributes(aID, aAccessi
   if (attrs)
     return attrs;
 
   ok(false, "Can't get text attributes for " + aID);
   return null;
 }
 
 function testAttrsInternal(aAccOrElmOrID, aAttrs, aSkipUnexpectedAttrs,
-                   aAbsentAttrs)
-{
+                   aAbsentAttrs) {
   var accessible = getAccessible(aAccOrElmOrID);
   if (!accessible)
     return;
 
   var attrs = null;
   try {
     attrs = accessible.attributes;
   } catch (e) { }
@@ -324,18 +312,17 @@ function testAttrsInternal(aAccOrElmOrID
     return;
   }
 
   var errorMsg = " for " + prettyName(aAccOrElmOrID);
   compareAttrs(errorMsg, attrs, aAttrs, aSkipUnexpectedAttrs, aAbsentAttrs);
 }
 
 function compareAttrs(aErrorMsg, aAttrs, aExpectedAttrs, aSkipUnexpectedAttrs,
-                      aAbsentAttrs)
-{
+                      aAbsentAttrs) {
   // Check if all obtained attributes are expected and have expected value.
   var enumerate = aAttrs.enumerate();
   while (enumerate.hasMoreElements()) {
     var prop = enumerate.getNext().QueryInterface(nsIPropertyElement);
 
     if (!(prop.key in aExpectedAttrs)) {
       if (!aSkipUnexpectedAttrs)
         ok(false, "Unexpected attribute '" + prop.key + "' having '" +
--- a/accessible/tests/mochitest/attributes/test_dpub_aria_xml-roles.html
+++ b/accessible/tests/mochitest/attributes/test_dpub_aria_xml-roles.html
@@ -12,18 +12,17 @@
           src="../common.js"></script>
   <script type="application/javascript"
           src="../role.js"></script>
   <script type="application/javascript"
           src="../attributes.js"></script>
 
   <script type="application/javascript">
 
-    function doTest()
-    {
+    function doTest() {
       // DPub ARIA roles should be exposed via the xml-roles object attribute.
       let dpub_attrs = [
         "doc-abstract",
         "doc-acknowledgments",
         "doc-afterword",
         "doc-appendix",
         "doc-backlink",
         "doc-biblioentry",
--- a/accessible/tests/mochitest/attributes/test_obj.html
+++ b/accessible/tests/mochitest/attributes/test_obj.html
@@ -14,18 +14,17 @@ https://bugzilla.mozilla.org/show_bug.cg
           src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
 
   <script type="application/javascript"
           src="../common.js"></script>
   <script type="application/javascript"
           src="../attributes.js"></script>
 
   <script type="application/javascript">
-    function doTest()
-    {
+    function doTest() {
       // aria
       testAttrs("atomic", {"atomic": "true", "container-atomic": "true"}, true);
       testAttrs(getNode("atomic").firstChild, {"container-atomic": "true"}, true);
       testAbsentAttrs("atomic_false", {"atomic": "false", "container-atomic": "false"});
       testAbsentAttrs(getNode("atomic_false").firstChild, {"container-atomic": "false"});
 
       testAttrs("autocomplete", {"autocomplete": "true"}, true);
       testAttrs("checkbox", {"checkable": "true"}, true);
--- a/accessible/tests/mochitest/attributes/test_obj_css.html
+++ b/accessible/tests/mochitest/attributes/test_obj_css.html
@@ -12,43 +12,38 @@
   <script type="application/javascript"
           src="../attributes.js"></script>
   <script type="application/javascript"
           src="../events.js"></script>
 
   <script type="application/javascript">
     var gQueue = null;
 
-    function removeElm(aID)
-    {
+    function removeElm(aID) {
       this.node = getNode(aID);
       this.accessible = getAccessible(aID);
 
       this.eventSeq = [
         new invokerChecker(EVENT_HIDE, this.accessible)
       ];
 
-      this.invoke = function removeElm_invoke()
-      {
+      this.invoke = function removeElm_invoke() {
         this.node.remove();
       }
 
-      this.check = function removeElm_check()
-      {
+      this.check = function removeElm_check() {
         testAbsentCSSAttrs(this.accessible);
       }
 
-      this.getID = function removeElm_getID()
-      {
+      this.getID = function removeElm_getID() {
         return "test CSS-based attributes on removed accessible";
       }
     }
 
-    function doTest()
-    {
+    function doTest() {
       // CSS display
       testCSSAttrs("display_block");
       testCSSAttrs("display_inline");
       testCSSAttrs("display_inline-block");
       testCSSAttrs("display_list-item");
       testCSSAttrs("display_table");
       testCSSAttrs("display_inline-table");
       testCSSAttrs("display_table-row-group");
--- a/accessible/tests/mochitest/attributes/test_obj_group.html
+++ b/accessible/tests/mochitest/attributes/test_obj_group.html
@@ -11,18 +11,17 @@
   <script type="application/javascript"
           src="../common.js"></script>
   <script type="application/javascript"
           src="../attributes.js"></script>
   <script type="application/javascript"
           src="../events.js"></script>
 
   <script type="application/javascript">
-    function doTest()
-    {
+    function doTest() {
       // ////////////////////////////////////////////////////////////////////////
       // HTML select with no size attribute.
       testGroupAttrs("opt1-nosize", 1, 4);
       testGroupAttrs("opt2-nosize", 2, 4);
       testGroupAttrs("opt3-nosize", 3, 4);
       testGroupAttrs("opt4-nosize", 4, 4);
 
       // ////////////////////////////////////////////////////////////////////////
--- a/accessible/tests/mochitest/attributes/test_tag.html
+++ b/accessible/tests/mochitest/attributes/test_tag.html
@@ -12,18 +12,17 @@
           src="../common.js"></script>
   <script type="application/javascript"
           src="../role.js"></script>
   <script type="application/javascript"
           src="../attributes.js"></script>
 
   <script type="application/javascript">
 
-    function doTest()
-    {
+    function doTest() {
       // And some AT may look for this
       testAttrs("nav", {"tag": "nav"}, true);
       testAttrs("header", {"tag": "header"}, true);
       testAttrs("footer", {"tag": "footer"}, true);
       testAttrs("article", {"tag": "article"}, true);
       testAttrs("aside", {"tag": "aside"}, true);
       testAttrs("section", {"tag": "section"}, true);
       testAttrs("main", {"tag": "article"}, true);
--- a/accessible/tests/mochitest/attributes/test_xml-roles.html
+++ b/accessible/tests/mochitest/attributes/test_xml-roles.html
@@ -12,18 +12,17 @@
           src="../common.js"></script>
   <script type="application/javascript"
           src="../role.js"></script>
   <script type="application/javascript"
           src="../attributes.js"></script>
 
   <script type="application/javascript">
 
-    function doTest()
-    {
+    function doTest() {
       // Some AT may look for this
       testAttrs("nav", {"xml-roles": "navigation"}, true);
       testAttrs("header", {"xml-roles": "banner"}, true);
       testAbsentAttrs("article_header", {"xml-roles": "banner"});
       testAbsentAttrs("section_header", {"xml-roles": "banner"});
       testAttrs("footer", {"xml-roles": "contentinfo"}, true);
       testAbsentAttrs("article_footer", {"xml-roles": "contentinfo"});
       testAbsentAttrs("section_footer", {"xml-roles": "contentinfo"});
--- a/accessible/tests/mochitest/autocomplete.js
+++ b/accessible/tests/mochitest/autocomplete.js
@@ -9,85 +9,79 @@ const nsIComponentRegistrar = Components
 var gDefaultAutoCompleteSearch = null;
 
 /**
  * Register 'test-a11y-search' AutoCompleteSearch.
  *
  * @param aValues [in] set of possible results values
  * @param aComments [in] set of possible results descriptions
  */
-function initAutoComplete(aValues, aComments)
-{
+function initAutoComplete(aValues, aComments) {
   var allResults = new ResultsHeap(aValues, aComments);
   gDefaultAutoCompleteSearch =
     new AutoCompleteSearch("test-a11y-search", allResults);
   registerAutoCompleteSearch(gDefaultAutoCompleteSearch,
                              "Accessibility Test AutoCompleteSearch");
 }
 
 /**
  * Unregister 'test-a11y-search' AutoCompleteSearch.
  */
-function shutdownAutoComplete()
-{
+function shutdownAutoComplete() {
   unregisterAutoCompleteSearch(gDefaultAutoCompleteSearch);
   gDefaultAutoCompleteSearch.cid = null;
   gDefaultAutoCompleteSearch = null;
 }
 
 
 /**
  * Register the given AutoCompleteSearch.
  *
  * @param aSearch       [in] AutoCompleteSearch object
  * @param aDescription  [in] description of the search object
  */
-function registerAutoCompleteSearch(aSearch, aDescription)
-{
+function registerAutoCompleteSearch(aSearch, aDescription) {
   var name = "@mozilla.org/autocomplete/search;1?name=" + aSearch.name;
 
   var uuidGenerator = Components.classes["@mozilla.org/uuid-generator;1"].
     getService(nsIUUIDGenerator);
   var cid = uuidGenerator.generateUUID();
 
   var componentManager = Components.manager.QueryInterface(nsIComponentRegistrar);
   componentManager.registerFactory(cid, aDescription, name, aSearch);
 
   // Keep the id on the object so we can unregister later.
   aSearch.cid = cid;
 }
 
 /**
  * Unregister the given AutoCompleteSearch.
  */
-function unregisterAutoCompleteSearch(aSearch)
-{
+function unregisterAutoCompleteSearch(aSearch) {
   var componentManager = Components.manager.QueryInterface(nsIComponentRegistrar);
   componentManager.unregisterFactory(aSearch.cid, aSearch);
 }
 
 
 /**
  * A container to keep all possible results of autocomplete search.
  */
-function ResultsHeap(aValues, aComments)
-{
+function ResultsHeap(aValues, aComments) {
   this.values = aValues;
   this.comments = aComments;
 }
 
 ResultsHeap.prototype =
 {
   constructor: ResultsHeap,
 
   /**
    * Return AutoCompleteResult for the given search string.
    */
-  getAutoCompleteResultFor: function(aSearchString)
-  {
+  getAutoCompleteResultFor: function(aSearchString) {
     var values = [], comments = [];
     for (var idx = 0; idx < this.values.length; idx++) {
       if (this.values[idx].indexOf(aSearchString) != -1) {
         values.push(this.values[idx]);
         comments.push(this.comments[idx]);
       }
     }
     return new AutoCompleteResult(values, comments);
@@ -96,66 +90,61 @@ ResultsHeap.prototype =
 
 
 /**
  * nsIAutoCompleteSearch implementation.
  *
  * @param aName       [in] the name of autocomplete search
  * @param aAllResults [in] ResultsHeap object
  */
-function AutoCompleteSearch(aName, aAllResults)
-{
+function AutoCompleteSearch(aName, aAllResults) {
   this.name = aName;
   this.allResults = aAllResults;
 }
 
 AutoCompleteSearch.prototype =
 {
   constructor: AutoCompleteSearch,
 
   // nsIAutoCompleteSearch implementation
   startSearch: function(aSearchString, aSearchParam, aPreviousResult,
-                        aListener)
-  {
+                        aListener) {
     var result = this.allResults.getAutoCompleteResultFor(aSearchString);
     aListener.onSearchResult(this, result);
   },
 
   stopSearch: function() {},
 
   // nsISupports implementation
-  QueryInterface: function(iid)
-  {
+  QueryInterface: function(iid) {
     if (iid.equals(nsISupports) ||
         iid.equals(nsIFactory) ||
         iid.equals(nsIAutoCompleteSearch))
       return this;
 
     throw Components.results.NS_ERROR_NO_INTERFACE;
   },
 
   // nsIFactory implementation
-  createInstance: function(outer, iid)
-  {
+  createInstance: function(outer, iid) {
     return this.QueryInterface(iid);
   },
 
   // Search name. Used by AutoCompleteController.
   name: null,
 
   // Results heap.
   allResults: null
 }
 
 
 /**
  * nsIAutoCompleteResult implementation.
  */
-function AutoCompleteResult(aValues, aComments)
-{
+function AutoCompleteResult(aValues, aComments) {
   this.values = aValues;
   this.comments = aComments;
 
   if (this.values.length > 0)
     this.searchResult = nsIAutoCompleteResult.RESULT_SUCCESS;
   else
     this.searchResult = nsIAutoCompleteResult.NOMATCH;
 }
@@ -164,48 +153,41 @@ AutoCompleteResult.prototype =
 {
   constructor: AutoCompleteResult,
 
   searchString: "",
   searchResult: null,
 
   defaultIndex: 0,
 
-  get matchCount()
-  {
+  get matchCount() {
     return this.values.length;
   },
 
-  getValueAt: function(aIndex)
-  {
+  getValueAt: function(aIndex) {
     return this.values[aIndex];
   },
 
-  getLabelAt: function(aIndex)
-  {
+  getLabelAt: function(aIndex) {
     return this.getValueAt(aIndex);
   },
 
-  getCommentAt: function(aIndex)
-  {
+  getCommentAt: function(aIndex) {
     return this.comments[aIndex];
   },
 
-  getStyleAt: function(aIndex)
-  {
+  getStyleAt: function(aIndex) {
     return null;
   },
 
-  getImageAt: function(aIndex)
-  {
+  getImageAt: function(aIndex) {
     return "";
   },
 
-  getFinalCompleteValueAt: function(aIndex)
-  {
+  getFinalCompleteValueAt: function(aIndex) {
     return this.getValueAt(aIndex);
   },
 
   removeValueAt: function(aRowIndex, aRemoveFromDb) {},
 
   // nsISupports implementation
   QueryInterface: function(iid) {
     if (iid.equals(nsISupports) ||
--- a/accessible/tests/mochitest/bounds/test_list.html
+++ b/accessible/tests/mochitest/bounds/test_list.html
@@ -13,18 +13,17 @@
   <script type="application/javascript"
           src="../common.js"></script>
   <script type="application/javascript"
           src="../role.js"></script>
   <script type="application/javascript"
           src="../layout.js"></script>
 
   <script type="application/javascript">
-    function doTest()
-    {
+    function doTest() {
       // Inside list
       var li = getAccessible("insidelist_item");
       testBounds(li);
 
       var [xLI, yLI, widthLI, heightLI] = getBounds(li);
       var bullet = li.firstChild;
       var [x, y, width, height] = getBounds(bullet);
       is(x, xLI,
--- a/accessible/tests/mochitest/bounds/test_select.html
+++ b/accessible/tests/mochitest/bounds/test_select.html
@@ -15,49 +15,44 @@
   <script type="application/javascript"
           src="../role.js"></script>
   <script type="application/javascript"
           src="../layout.js"></script>
   <script type="application/javascript"
           src="../events.js"></script>
 
   <script type="application/javascript">
-    function openComboboxNCheckBounds(aID)
-    {
+    function openComboboxNCheckBounds(aID) {
       this.combobox = getAccessible(aID);
       this.comboboxList = this.combobox.firstChild;
       this.comboboxOption = this.comboboxList.firstChild;
 
       this.eventSeq = [
         new invokerChecker(EVENT_FOCUS, this.comboboxOption)
       ];
 
-      this.invoke = function openComboboxNCheckBounds_invoke()
-      {
+      this.invoke = function openComboboxNCheckBounds_invoke() {
         getNode(aID).focus();
         synthesizeKey("VK_DOWN", { altKey: true });
       }
 
-      this.finalCheck = function openComboboxNCheckBounds_invoke()
-      {
+      this.finalCheck = function openComboboxNCheckBounds_invoke() {
         testBounds(this.comboboxOption);
       }
 
-      this.getID = function openComboboxNCheckBounds_getID()
-      {
+      this.getID = function openComboboxNCheckBounds_getID() {
         return "open combobox and test boundaries";
       }
     }
 
     // gA11yEventDumpToConsole = true;
 
     var gQueue = null;
 
-    function doTest()
-    {
+    function doTest() {
       // Combobox
       testBounds("combobox");
 
       // Option boundaries matches to combobox boundaries when collapsed.
       var selectBounds = getBoundsForDOMElm("combobox");
       testBounds("option1", selectBounds);
 
       // Open combobox and test option boundaries.
--- a/accessible/tests/mochitest/browser.js
+++ b/accessible/tests/mochitest/browser.js
@@ -1,122 +1,109 @@
 /**
  * Load the browser with the given url and then invokes the given function.
  */
-function openBrowserWindow(aFunc, aURL, aRect)
-{
+function openBrowserWindow(aFunc, aURL, aRect) {
   gBrowserContext.testFunc = aFunc;
   gBrowserContext.startURL = aURL;
   gBrowserContext.browserRect = aRect;
 
   addLoadEvent(openBrowserWindowIntl);
 }
 
 /**
  * Close the browser window.
  */
-function closeBrowserWindow()
-{
+function closeBrowserWindow() {
   gBrowserContext.browserWnd.close();
 }
 
 /**
  * Return the browser window object.
  */
-function browserWindow()
-{
+function browserWindow() {
   return gBrowserContext.browserWnd;
 }
 
 /**
  * Return the document of the browser window.
  */
-function browserDocument()
-{
+function browserDocument() {
   return browserWindow().document;
 }
 
 /**
  * Return tab browser object.
  */
-function tabBrowser()
-{
+function tabBrowser() {
   return browserWindow().gBrowser;
 }
 
 /**
  * Return browser element of the current tab.
  */
-function currentBrowser()
-{
+function currentBrowser() {
   return tabBrowser().selectedBrowser;
 }
 
 /**
  * Return DOM document of the current tab.
  */
-function currentTabDocument()
-{
+function currentTabDocument() {
   return currentBrowser().contentDocument;
 }
 
 /**
  * Return window of the current tab.
  */
-function currentTabWindow()
-{
+function currentTabWindow() {
   return currentTabDocument().defaultView;
 }
 
 /**
  * Return browser element of the tab at the given index.
  */
-function browserAt(aIndex)
-{
+function browserAt(aIndex) {
   return tabBrowser().getBrowserAtIndex(aIndex);
 }
 
 /**
  * Return DOM document of the tab at the given index.
  */
-function tabDocumentAt(aIndex)
-{
+function tabDocumentAt(aIndex) {
   return browserAt(aIndex).contentDocument;
 }
 
 /**
  * Return input element of address bar.
  */
-function urlbarInput()
-{
+function urlbarInput() {
   return browserWindow().document.getElementById("urlbar").inputField;
 }
 
 /**
  * Return reload button.
  */
-function reloadButton()
-{
+function reloadButton() {
   return browserWindow().document.getElementById("urlbar-reload-button");
 }
 
 // //////////////////////////////////////////////////////////////////////////////
 // private section
 
 Components.utils.import("resource://gre/modules/Services.jsm");
 
 var gBrowserContext =
 {
   browserWnd: null,
   testFunc: null,
   startURL: ""
 };
 
-function openBrowserWindowIntl()
-{
+function openBrowserWindowIntl() {
   var params = "chrome,all,dialog=no";
   var rect = gBrowserContext.browserRect;
   if (rect) {
     if ("left" in rect)
       params += ",left=" + rect.left;
     if ("top" in rect)
       params += ",top=" + rect.top;
     if ("width" in rect)
@@ -130,18 +117,17 @@ function openBrowserWindowIntl()
                       "_blank", params,
                       gBrowserContext.startURL);
 
   whenDelayedStartupFinished(browserWindow(), function() {
     addA11yLoadEvent(startBrowserTests, browserWindow());
   });
 }
 
-function startBrowserTests()
-{
+function startBrowserTests() {
   if (gBrowserContext.startURL) // wait for load
     addA11yLoadEvent(gBrowserContext.testFunc, currentBrowser().contentWindow);
   else
     gBrowserContext.testFunc();
 }
 
 function whenDelayedStartupFinished(aWindow, aCallback) {
   Services.obs.addObserver(function observer(aSubject, aTopic) {
--- a/accessible/tests/mochitest/common.js
+++ b/accessible/tests/mochitest/common.js
@@ -97,47 +97,41 @@ Components.utils.import("resource://gre/
  * nsIAccessibilityService service.
  */
 var gAccService = Components.classes["@mozilla.org/accessibilityService;1"].
   getService(nsIAccessibilityService);
 
 /**
  * Enable/disable logging.
  */
-function enableLogging(aModules)
-{
+function enableLogging(aModules) {
   gAccService.setLogging(aModules);
 }
-function disableLogging()
-{
+function disableLogging() {
   gAccService.setLogging("");
 }
-function isLogged(aModule)
-{
+function isLogged(aModule) {
   return gAccService.isLogged(aModule);
 }
 
 /**
  * Dumps the accessible tree into console.
  */
-function dumpTree(aId, aMsg)
-{
-  function dumpTreeIntl(acc, indent)
-  {
+function dumpTree(aId, aMsg) {
+  function dumpTreeIntl(acc, indent) {
     dump(indent + prettyName(acc) + "\n");
 
     var children = acc.children;
     for (var i = 0; i < children.length; i++) {
       var child = children.queryElementAt(i, nsIAccessible);
       dumpTreeIntl(child, indent + "  ");
     }
   }
 
-  function dumpDOMTreeIntl(node, indent)
-  {
+  function dumpDOMTreeIntl(node, indent) {
     dump(indent + prettyName(node) + "\n");
 
     var children = node.childNodes;
     for (var i = 0; i < children.length; i++) {
       var child = children.item(i);
       dumpDOMTreeIntl(child, indent + "  ");
     }
   }
@@ -152,23 +146,20 @@ function dumpTree(aId, aMsg)
 
 /**
  * Invokes the given function when document is loaded and focused. Preferable
  * to mochitests 'addLoadEvent' function -- additionally ensures state of the
  * document accessible is not busy.
  *
  * @param aFunc  the function to invoke
  */
-function addA11yLoadEvent(aFunc, aWindow)
-{
-  function waitForDocLoad()
-  {
+function addA11yLoadEvent(aFunc, aWindow) {
+  function waitForDocLoad() {
     window.setTimeout(
-      function()
-      {
+      function() {
         var targetDocument = aWindow ? aWindow.document : document;
         var accDoc = getAccessible(targetDocument);
         var state = {};
         accDoc.getState(state, {});
         if (state.value & STATE_BUSY)
           return waitForDocLoad();
 
         window.setTimeout(aFunc, 0);
@@ -178,36 +169,34 @@ function addA11yLoadEvent(aFunc, aWindow
   }
 
   SimpleTest.waitForFocus(waitForDocLoad, aWindow);
 }
 
 /**
  * Analogy of SimpleTest.is function used to compare objects.
  */
-function isObject(aObj, aExpectedObj, aMsg)
-{
+function isObject(aObj, aExpectedObj, aMsg) {
   if (aObj == aExpectedObj) {
     ok(true, aMsg);
     return;
   }
 
   ok(false,
      aMsg + " - got '" + prettyName(aObj) +
             "', expected '" + prettyName(aExpectedObj) + "'");
 }
 
 // //////////////////////////////////////////////////////////////////////////////
 // Helpers for getting DOM node/accessible
 
 /**
  * Return the DOM node by identifier (may be accessible, DOM node or ID).
  */
-function getNode(aAccOrNodeOrID, aDocument)
-{
+function getNode(aAccOrNodeOrID, aDocument) {
   if (!aAccOrNodeOrID)
     return null;
 
   if (aAccOrNodeOrID instanceof nsIDOMNode)
     return aAccOrNodeOrID;
 
   if (aAccOrNodeOrID instanceof nsIAccessible)
     return aAccOrNodeOrID.DOMNode;
@@ -240,18 +229,17 @@ const DONOTFAIL_IF_NO_INTERFACE = 2;
  *                           the given interfaces
  * @param aInterfaces        [in, optional] the interface or an array interfaces
  *                           to query it/them from obtained accessible
  * @param aElmObj            [out, optional] object to store DOM element which
  *                           accessible is obtained for
  * @param aDoNotFailIf       [in, optional] no error for special cases (see
  *                            constants above)
  */
-function getAccessible(aAccOrElmOrID, aInterfaces, aElmObj, aDoNotFailIf)
-{
+function getAccessible(aAccOrElmOrID, aInterfaces, aElmObj, aDoNotFailIf) {
   if (!aAccOrElmOrID)
     return null;
 
   var elm = null;
 
   if (aAccOrElmOrID instanceof nsIAccessible) {
     try { elm = aAccOrElmOrID.DOMNode; } catch (e) { }
 
@@ -306,76 +294,70 @@ function getAccessible(aAccOrElmOrID, aI
 
   return acc;
 }
 
 /**
  * Return true if the given identifier has an accessible, or exposes the wanted
  * interfaces.
  */
-function isAccessible(aAccOrElmOrID, aInterfaces)
-{
+function isAccessible(aAccOrElmOrID, aInterfaces) {
   return !!getAccessible(aAccOrElmOrID, aInterfaces, null,
                          DONOTFAIL_IF_NO_ACC | DONOTFAIL_IF_NO_INTERFACE);
 }
 
 /**
  * Return an accessible that contains the DOM node for the given identifier.
  */
-function getContainerAccessible(aAccOrElmOrID)
-{
+function getContainerAccessible(aAccOrElmOrID) {
   var node = getNode(aAccOrElmOrID);
   if (!node)
     return null;
 
   while ((node = node.parentNode) && !isAccessible(node));
   return node ? getAccessible(node) : null;
 }
 
 /**
  * Return root accessible for the given identifier.
  */
-function getRootAccessible(aAccOrElmOrID)
-{
+function getRootAccessible(aAccOrElmOrID) {
   var acc = getAccessible(aAccOrElmOrID ? aAccOrElmOrID : document);
   return acc ? acc.rootDocument.QueryInterface(nsIAccessible) : null;
 }
 
 /**
  * Return tab document accessible the given accessible is contained by.
  */
-function getTabDocAccessible(aAccOrElmOrID)
-{
+function getTabDocAccessible(aAccOrElmOrID) {
   var acc = getAccessible(aAccOrElmOrID ? aAccOrElmOrID : document);
 
   var docAcc = acc.document.QueryInterface(nsIAccessible);
   var containerDocAcc = docAcc.parent.document;
 
   // Test is running is stand-alone mode.
   if (acc.rootDocument == containerDocAcc)
     return docAcc;
 
   // In the case of running all tests together.
   return containerDocAcc.QueryInterface(nsIAccessible);
 }
 
 /**
  * Return application accessible.
  */
-function getApplicationAccessible()
-{
+function getApplicationAccessible() {
   return gAccService.getApplicationAccessible().
     QueryInterface(nsIAccessibleApplication);
 }
 
 /**
  * A version of accessible tree testing, doesn't fail if tree is not complete.
  */
-function testElm(aID, aTreeObj)
-{
+function testElm(aID, aTreeObj) {
   testAccessibleTree(aID, aTreeObj, kSkipTreeFullCheck);
 }
 
 /**
  * Flags used for testAccessibleTree
  */
 const kSkipTreeFullCheck = 1;
 
@@ -387,18 +369,17 @@ const kSkipTreeFullCheck = 1;
  *                         accessible object. Additionally special properties
  *                         are presented:
  *                          children - an array of JS objects representing
  *                                      children of accessible
  *                          states   - an object having states and extraStates
  *                                      fields
  * @param aFlags          [in, optional] flags, see constants above
  */
-function testAccessibleTree(aAccOrElmOrID, aAccTree, aFlags)
-{
+function testAccessibleTree(aAccOrElmOrID, aAccTree, aFlags) {
   var acc = getAccessible(aAccOrElmOrID);
   if (!acc)
     return;
 
   var accTree = aAccTree;
 
   // Support of simplified accessible tree object.
   accTree = normalizeAccTreeObj(accTree);
@@ -575,30 +556,28 @@ function testAccessibleTree(aAccOrElmOrI
       }
     }
   }
 }
 
 /**
  * Return true if accessible for the given node is in cache.
  */
-function isAccessibleInCache(aNodeOrId)
-{
+function isAccessibleInCache(aNodeOrId) {
   var node = getNode(aNodeOrId);
   return !!gAccService.getAccessibleFromCache(node);
 }
 
 /**
  * Test accessible tree for defunct accessible.
  *
  * @param  aAcc       [in] the defunct accessible
  * @param  aNodeOrId  [in] the DOM node identifier for the defunct accessible
  */
-function testDefunctAccessible(aAcc, aNodeOrId)
-{
+function testDefunctAccessible(aAcc, aNodeOrId) {
   if (aNodeOrId)
     ok(!isAccessible(aNodeOrId),
        "Accessible for " + aNodeOrId + " wasn't properly shut down!");
 
   var msg = " doesn't fail for shut down accessible " +
              prettyName(aNodeOrId) + "!";
 
   // firstChild
@@ -663,66 +642,61 @@ function testDefunctAccessible(aAcc, aNo
     success = (e.result == Components.results.NS_ERROR_FAILURE);
   }
   ok(success, "parent" + msg);
 }
 
 /**
  * Convert role to human readable string.
  */
-function roleToString(aRole)
-{
+function roleToString(aRole) {
   return gAccService.getStringRole(aRole);
 }
 
 /**
  * Convert states to human readable string.
  */
-function statesToString(aStates, aExtraStates)
-{
+function statesToString(aStates, aExtraStates) {
   var list = gAccService.getStringStates(aStates, aExtraStates);
 
   var str = "";
   for (var index = 0; index < list.length - 1; index++)
     str += list.item(index) + ", ";
 
   if (list.length != 0)
     str += list.item(index)
 
   return str;
 }
 
 /**
  * Convert event type to human readable string.
  */
-function eventTypeToString(aEventType)
-{
+function eventTypeToString(aEventType) {
   return gAccService.getStringEventType(aEventType);
 }
 
 /**
  * Convert relation type to human readable string.
  */
-function relationTypeToString(aRelationType)
-{
+function relationTypeToString(aRelationType) {
   return gAccService.getStringRelationType(aRelationType);
 }
 
 function getLoadContext() {
   const Ci = Components.interfaces;
   return window.QueryInterface(Ci.nsIInterfaceRequestor)
                .getInterface(Ci.nsIWebNavigation)
                .QueryInterface(Ci.nsILoadContext);
 }
 
 /**
  * Return text from clipboard.
  */
-function getTextFromClipboard()
-{
+function getTextFromClipboard() {
   var clip = Components.classes["@mozilla.org/widget/clipboard;1"].
     getService(Components.interfaces.nsIClipboard);
   if (!clip)
     return "";
 
   var trans = Components.classes["@mozilla.org/widget/transferable;1"].
     createInstance(Components.interfaces.nsITransferable);
   trans.init(getLoadContext());
@@ -767,18 +741,17 @@ function getAccessibleDOMNodeID(accessib
     // property corresponds to the "id" of its body element.
     return accessible.id;
   } catch (e) { /* This will fail if accessible is not a proxy. */ }
 }
 
 /**
  * Return pretty name for identifier, it may be ID, DOM node or accessible.
  */
-function prettyName(aIdentifier)
-{
+function prettyName(aIdentifier) {
   if (aIdentifier instanceof Array) {
     var msg = "";
     for (var idx = 0; idx < aIdentifier.length; idx++) {
       if (msg != "")
         msg += ", ";
 
       msg += prettyName(aIdentifier[idx]);
     }
@@ -838,112 +811,105 @@ function prettyName(aIdentifier)
   return " '" + aIdentifier + "' ";
 }
 
 /**
  * Shorten a long string if it exceeds MAX_TRIM_LENGTH.
  * @param aString the string to shorten.
  * @returns the shortened string.
  */
-function shortenString(aString, aMaxLength)
-{
+function shortenString(aString, aMaxLength) {
   if (aString.length <= MAX_TRIM_LENGTH)
     return aString;
 
   // Trim the string if its length is > MAX_TRIM_LENGTH characters.
   var trimOffset = MAX_TRIM_LENGTH / 2;
   return aString.substring(0, trimOffset - 1) + "..." +
     aString.substring(aString.length - trimOffset, aString.length);
 }
 
 // //////////////////////////////////////////////////////////////////////////////
 // General Utils
 // //////////////////////////////////////////////////////////////////////////////
 /**
  * Return main chrome window (crosses chrome boundary)
  */
-function getMainChromeWindow(aWindow)
-{
+function getMainChromeWindow(aWindow) {
   return aWindow.QueryInterface(Components.interfaces.nsIInterfaceRequestor)
                 .getInterface(Components.interfaces.nsIWebNavigation)
                 .QueryInterface(Components.interfaces.nsIDocShellTreeItem)
                 .rootTreeItem
                 .QueryInterface(Components.interfaces.nsIInterfaceRequestor)
                 .getInterface(Components.interfaces.nsIDOMWindow);
 }
 
 /** Sets the test plugin(s) initially expected enabled state.
  * It will automatically be reset to it's previous value after the test
  * ends.
  * @param aNewEnabledState [in] the enabled state, e.g. SpecialPowers.Ci.nsIPluginTag.STATE_ENABLED
  * @param aPluginName [in, optional] The name of the plugin, defaults to "Test Plug-in"
  */
-function setTestPluginEnabledState(aNewEnabledState, aPluginName)
-{
+function setTestPluginEnabledState(aNewEnabledState, aPluginName) {
   var plugin = getTestPluginTag(aPluginName);
   var oldEnabledState = plugin.enabledState;
   plugin.enabledState = aNewEnabledState;
   SimpleTest.registerCleanupFunction(function() {
     getTestPluginTag(aPluginName).enabledState = oldEnabledState;
   });
 }
 
 // //////////////////////////////////////////////////////////////////////////////
 // Private
 // //////////////////////////////////////////////////////////////////////////////
 
 // //////////////////////////////////////////////////////////////////////////////
 // Accessible general
 
-function getNodePrettyName(aNode)
-{
+function getNodePrettyName(aNode) {
   try {
     var tag = "";
     if (aNode.nodeType == nsIDOMNode.DOCUMENT_NODE) {
       tag = "document";
     } else {
       tag = aNode.localName;
       if (aNode.nodeType == nsIDOMNode.ELEMENT_NODE && aNode.hasAttribute("id"))
         tag += "@id=\"" + aNode.getAttribute("id") + "\"";
     }
 
     return "'" + tag + " node', address: " + getObjAddress(aNode);
   } catch (e) {
     return "' no node info '";
   }
 }
 
-function getObjAddress(aObj)
-{
+function getObjAddress(aObj) {
   var exp = /native\s*@\s*(0x[a-f0-9]+)/g;
   var match = exp.exec(aObj.toString());
   if (match)
     return match[1];
 
   return aObj.toString();
 }
 
-function getTestPluginTag(aPluginName)
-{
+function getTestPluginTag(aPluginName) {
   var ph = SpecialPowers.Cc["@mozilla.org/plugin/host;1"]
                         .getService(SpecialPowers.Ci.nsIPluginHost);
   var tags = ph.getPluginTags();
   var name = aPluginName || "Test Plug-in";
   for (var tag of tags) {
     if (tag.name == name) {
       return tag;
     }
   }
 
   ok(false, "Could not find plugin tag with plugin name '" + name + "'");
   return null;
 }
 
-function normalizeAccTreeObj(aObj)
-{
+function normalizeAccTreeObj(aObj) {
   var key = Object.keys(aObj)[0];
   var roleName = "ROLE_" + key;
   if (roleName in nsIAccessibleRole) {
     return {
       role: nsIAccessibleRole[roleName],
       children: aObj[key]
     };
   }
--- a/accessible/tests/mochitest/editabletext/editabletext.js
+++ b/accessible/tests/mochitest/editabletext/editabletext.js
@@ -1,49 +1,43 @@
 /**
  * Perform all editable text tests.
  */
-function editableTextTestRun()
-{
-  this.add = function add(aTest)
-  {
+function editableTextTestRun() {
+  this.add = function add(aTest) {
     this.seq.push(aTest);
   }
 
-  this.run = function run()
-  {
+  this.run = function run() {
     this.iterate();
   }
 
   this.index = 0;
   this.seq = [];
 
-  this.iterate = function iterate()
-  {
+  this.iterate = function iterate() {
     if (this.index < this.seq.length) {
       this.seq[this.index++].startTest(this);
       return;
     }
 
     this.seq = null;
     SimpleTest.finish();
   }
 }
 
 /**
  * Used to test nsIEditableTextAccessible methods.
  */
-function editableTextTest(aID)
-{
+function editableTextTest(aID) {
   /**
    * Schedule a test, the given function with its arguments will be executed
    * when preceding test is complete.
    */
-  this.scheduleTest = function scheduleTest(aFunc)
-  {
+  this.scheduleTest = function scheduleTest(aFunc) {
     // A data container acts like a dummy invoker, it's never invoked but
     // it's used to generate real invoker when previous invoker was handled.
     var dataContainer = {
       func: aFunc,
       funcArgs: Array.slice(arguments, 1)
     };
     this.mEventQueue.push(dataContainer);
 
@@ -51,22 +45,20 @@ function editableTextTest(aID)
       this.unwrapNextTest();
       this.mEventQueueReady = true;
     }
   }
 
   /**
    * setTextContents test.
    */
-  this.setTextContents = function setTextContents(aValue, aSkipStartOffset)
-  {
+  this.setTextContents = function setTextContents(aValue, aSkipStartOffset) {
     var testID = "setTextContents '" + aValue + "' for " + prettyName(aID);
 
-    function setTextContentsInvoke()
-    {
+    function setTextContentsInvoke() {
       dump(`\nsetTextContents '${aValue}'\n`);
       var acc = getAccessible(aID, nsIAccessibleEditableText);
       acc.setTextContents(aValue);
     }
 
     aSkipStartOffset = aSkipStartOffset || 0;
     var insertTripple = aValue ?
       [ aSkipStartOffset, aSkipStartOffset + aValue.length, aValue ] : null;
@@ -76,215 +68,193 @@ function editableTextTest(aID)
 
     this.generateTest(aID, removeTripple, insertTripple, setTextContentsInvoke,
                       getValueChecker(aID, aValue), testID);
   }
 
   /**
    * insertText test.
    */
-  this.insertText = function insertText(aStr, aPos, aResStr, aResPos)
-  {
+  this.insertText = function insertText(aStr, aPos, aResStr, aResPos) {
     var testID = "insertText '" + aStr + "' at " + aPos + " for " +
       prettyName(aID);
 
-    function insertTextInvoke()
-    {
+    function insertTextInvoke() {
       dump(`\ninsertText '${aStr}' at ${aPos} pos\n`);
       var acc = getAccessible(aID, nsIAccessibleEditableText);
       acc.insertText(aStr, aPos);
     }
 
     var resPos = (aResPos != undefined) ? aResPos : aPos;
     this.generateTest(aID, null, [resPos, resPos + aStr.length, aStr],
                       insertTextInvoke, getValueChecker(aID, aResStr), testID);
   }
 
   /**
    * copyText test.
    */
-  this.copyText = function copyText(aStartPos, aEndPos, aClipboardStr)
-  {
+  this.copyText = function copyText(aStartPos, aEndPos, aClipboardStr) {
     var testID = "copyText from " + aStartPos + " to " + aEndPos + " for " +
       prettyName(aID);
 
-    function copyTextInvoke()
-    {
+    function copyTextInvoke() {
       var acc = getAccessible(aID, nsIAccessibleEditableText);
       acc.copyText(aStartPos, aEndPos);
     }
 
     this.generateTest(aID, null, null, copyTextInvoke,
                       getClipboardChecker(aID, aClipboardStr), testID);
   }
 
   /**
    * copyText and pasteText test.
    */
   this.copyNPasteText = function copyNPasteText(aStartPos, aEndPos,
-                                                aPos, aResStr)
-  {
+                                                aPos, aResStr) {
     var testID = "copyText from " + aStartPos + " to " + aEndPos +
       "and pasteText at " + aPos + " for " + prettyName(aID);
 
-    function copyNPasteTextInvoke()
-    {
+    function copyNPasteTextInvoke() {
       var acc = getAccessible(aID, nsIAccessibleEditableText);
       acc.copyText(aStartPos, aEndPos);
       acc.pasteText(aPos);
     }
 
     this.generateTest(aID, null, [aStartPos, aEndPos, getTextFromClipboard],
                       copyNPasteTextInvoke, getValueChecker(aID, aResStr), testID);
   }
 
   /**
    * cutText test.
    */
   this.cutText = function cutText(aStartPos, aEndPos, aResStr,
-                                  aResStartPos, aResEndPos)
-  {
+                                  aResStartPos, aResEndPos) {
     var testID = "cutText from " + aStartPos + " to " + aEndPos + " for " +
       prettyName(aID);
 
-    function cutTextInvoke()
-    {
+    function cutTextInvoke() {
       var acc = getAccessible(aID, nsIAccessibleEditableText);
       acc.cutText(aStartPos, aEndPos);
     }
 
     var resStartPos = (aResStartPos != undefined) ? aResStartPos : aStartPos;
     var resEndPos = (aResEndPos != undefined) ? aResEndPos : aEndPos;
     this.generateTest(aID, [resStartPos, resEndPos, getTextFromClipboard], null,
                       cutTextInvoke, getValueChecker(aID, aResStr), testID);
   }
 
   /**
    * cutText and pasteText test.
    */
   this.cutNPasteText = function copyNPasteText(aStartPos, aEndPos,
-                                               aPos, aResStr)
-  {
+                                               aPos, aResStr) {
     var testID = "cutText from " + aStartPos + " to " + aEndPos +
       " and pasteText at " + aPos + " for " + prettyName(aID);
 
-    function cutNPasteTextInvoke()
-    {
+    function cutNPasteTextInvoke() {
       var acc = getAccessible(aID, nsIAccessibleEditableText);
       acc.cutText(aStartPos, aEndPos);
       acc.pasteText(aPos);
     }
 
     this.generateTest(aID, [aStartPos, aEndPos, getTextFromClipboard],
                       [aPos, -1, getTextFromClipboard],
                       cutNPasteTextInvoke, getValueChecker(aID, aResStr),
                       testID);
   }
 
   /**
    * pasteText test.
    */
-  this.pasteText = function pasteText(aPos, aResStr)
-  {
+  this.pasteText = function pasteText(aPos, aResStr) {
     var testID = "pasteText at " + aPos + " for " + prettyName(aID);
 
-    function pasteTextInvoke()
-    {
+    function pasteTextInvoke() {
       var acc = getAccessible(aID, nsIAccessibleEditableText);
       acc.pasteText(aPos);
     }
 
     this.generateTest(aID, null, [aPos, -1, getTextFromClipboard],
                       pasteTextInvoke, getValueChecker(aID, aResStr), testID);
   }
 
   /**
    * deleteText test.
    */
-  this.deleteText = function deleteText(aStartPos, aEndPos, aResStr)
-  {
+  this.deleteText = function deleteText(aStartPos, aEndPos, aResStr) {
     var testID = "deleteText from " + aStartPos + " to " + aEndPos +
       " for " + prettyName(aID);
 
     var oldValue = getValue(aID).substring(aStartPos, aEndPos);
     var removeTripple = oldValue ? [aStartPos, aEndPos, oldValue] : null;
 
-    function deleteTextInvoke()
-    {
+    function deleteTextInvoke() {
       var acc = getAccessible(aID, [nsIAccessibleEditableText]);
       acc.deleteText(aStartPos, aEndPos);
     }
 
     this.generateTest(aID, removeTripple, null, deleteTextInvoke,
                       getValueChecker(aID, aResStr), testID);
   }
 
   // ////////////////////////////////////////////////////////////////////////////
   // Implementation details.
 
-  function getValue(aID)
-  {
+  function getValue(aID) {
     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;
   }
 
   /**
    * Common checkers.
    */
-  function getValueChecker(aID, aValue)
-  {
+  function getValueChecker(aID, aValue) {
     var checker = {
-      check: function valueChecker_check()
-      {
+      check: function valueChecker_check() {
         is(getValue(aID), aValue, "Wrong value " + aValue);
       }
     };
     return checker;
   }
 
-  function getClipboardChecker(aID, aText)
-  {
+  function getClipboardChecker(aID, aText) {
     var checker = {
-      check: function clipboardChecker_check()
-      {
+      check: function clipboardChecker_check() {
         is(getTextFromClipboard(), aText, "Wrong text in clipboard.");
       }
     };
     return checker;
   }
 
   /**
    * Process next scheduled test.
    */
-  this.unwrapNextTest = function unwrapNextTest()
-  {
+  this.unwrapNextTest = function unwrapNextTest() {
     var data = this.mEventQueue.mInvokers[this.mEventQueue.mIndex + 1];
     if (data)
       data.func.apply(this, data.funcArgs);
   }
 
   /**
    * Used to generate an invoker object for the sheduled test.
    */
   this.generateTest = function generateTest(aID, aRemoveTriple, aInsertTriple,
-                                            aInvokeFunc, aChecker, aInvokerID)
-  {
+                                            aInvokeFunc, aChecker, aInvokerID) {
     var et = this;
     var invoker = {
       eventSeq: [],
 
       invoke: aInvokeFunc,
-      finalCheck: function finalCheck()
-      {
+      finalCheck: function finalCheck() {
         // dumpTree(aID, `'${aID}' tree:`);
 
         aChecker.check();
         et.unwrapNextTest(); // replace dummy invoker on real invoker object.
       },
       getID: function getID() { return aInvokerID; }
     };
 
@@ -307,22 +277,20 @@ function editableTextTest(aID)
       invoker.noEventsOnAction = true;
 
     this.mEventQueue.mInvokers[this.mEventQueue.mIndex + 1] = invoker;
   }
 
   /**
    * Run the tests.
    */
-  this.startTest = function startTest(aTestRun)
-  {
+  this.startTest = function startTest(aTestRun) {
     var testRunObj = aTestRun;
     var thisObj = this;
-    this.mEventQueue.onFinish = function finishCallback()
-    {
+    this.mEventQueue.onFinish = function finishCallback() {
       // Notify textRun object that all tests were finished.
       testRunObj.iterate();
 
       // Help GC to avoid leaks (refer to aTestRun from local variable, drop
       // onFinish function).
       thisObj.mEventQueue.onFinish = null;
 
       return DO_NOT_FINISH_TEST;
--- a/accessible/tests/mochitest/editabletext/test_1.html
+++ b/accessible/tests/mochitest/editabletext/test_1.html
@@ -17,18 +17,17 @@ https://bugzilla.mozilla.org/show_bug.cg
           src="../events.js"></script>
   <script type="application/javascript"
           src="editabletext.js"></script>
 
   <script type="application/javascript">
     // gA11yEventDumpToConsole = true;
     // enableLogging("tree,verbose"); // debug
 
-    function addTestEditable(aID, aTestRun, aBeforeContent, aAfterContent)
-    {
+    function addTestEditable(aID, aTestRun, aBeforeContent, aAfterContent) {
       var et = new editableTextTest(aID);
       var startOffset = aBeforeContent ? aBeforeContent.length : 0;
       // XXX afterContent currently is not used
 
       // ////////////////////////////////////////////////////////////////////////
       // setTextContents
       et.scheduleTest(et.setTextContents, "hello", startOffset);
       et.scheduleTest(et.setTextContents, "olleh", startOffset);
@@ -64,32 +63,30 @@ https://bugzilla.mozilla.org/show_bug.cg
 //      et.cutNPasteText(1, 2, 0, "hehelloo");
 //      et.cutNPasteText(7, 8, 8, "hehelloo");
 
       aTestRun.add(et);
     }
 
     // gA11yEventDumpToConsole = true; // debug stuff
 
-    function runTest()
-    {
+    function runTest() {
       var testRun = new editableTextTestRun();
 
       addTestEditable("input", testRun);
       addTestEditable("div", testRun);
       addTestEditable("divb", testRun, "pseudo element", "");
       addTestEditable("diva", testRun, "", "pseudo element");
       addTestEditable("divba", testRun, "before", "after");
       addTestEditable(getNode("frame").contentDocument, testRun);
 
       testRun.run(); // Will call SimpleTest.finish();
     }
 
-    function doTest()
-    {
+    function doTest() {
       // Prepare tested elements.
 
       // Design mode on/off triggers an editable state change event on
       // the document accessible.
       var frame = getNode("frame");
       waitForEvent(EVENT_STATE_CHANGE, frame.contentDocument, runTest);
       frame.contentDocument.designMode = "on";
     }
--- a/accessible/tests/mochitest/editabletext/test_2.html
+++ b/accessible/tests/mochitest/editabletext/test_2.html
@@ -11,18 +11,17 @@
   <script type="application/javascript"
           src="../common.js"></script>
   <script type="application/javascript"
           src="../events.js"></script>
   <script type="application/javascript"
           src="editabletext.js"></script>
 
   <script type="application/javascript">
-    function doTest()
-    {
+    function doTest() {
       var et = new editableTextTest("input");
 
       // 'ee' insertion/removal at 1 or 2 offset of 'hello'/'heeello' string
       // reports 'ee' text was inserted/removed at 2 offset.
       et.scheduleTest(et.insertText, "ee", 1, "heeello", 2);
       et.scheduleTest(et.copyText, 1, 3, "ee");
       et.scheduleTest(et.cutText, 1, 3, "hello", 2, 4);
       et.scheduleTest(et.insertText, "ee", 2, "heeello", 2);
--- a/accessible/tests/mochitest/elm/test_HTMLSpec.html
+++ b/accessible/tests/mochitest/elm/test_HTMLSpec.html
@@ -19,18 +19,17 @@
   <script type="application/javascript"
           src="../attributes.js"></script>
   <script type="application/javascript"
           src="../relations.js"></script>
   <script type="application/javascript"
           src="../name.js"></script>
 
   <script type="application/javascript">
-    function doTest()
-    {
+    function doTest() {
       // ////////////////////////////////////////////////////////////////////////
       // HTML:a@href
 
       var obj = {
         role: ROLE_LINK,
         states: STATE_LINKED,
         actions: "jump",
         interfaces: [ nsIAccessibleText, nsIAccessibleHyperText, nsIAccessibleHyperLink ],
--- a/accessible/tests/mochitest/elm/test_MathMLSpec.html
+++ b/accessible/tests/mochitest/elm/test_MathMLSpec.html
@@ -19,18 +19,17 @@
   <script type="application/javascript"
           src="../attributes.js"></script>
   <script type="application/javascript"
           src="../relations.js"></script>
   <script type="application/javascript"
           src="../name.js"></script>
 
   <script type="application/javascript">
-    function doTest()
-    {
+    function doTest() {
       // ////////////////////////////////////////////////////////////////////////
       // math
 
       obj = {
         role: ROLE_MATHML_MATH,
       };
       testElm("math", obj);
 
--- a/accessible/tests/mochitest/elm/test_canvas.html
+++ b/accessible/tests/mochitest/elm/test_canvas.html
@@ -14,18 +14,17 @@
           src="../common.js"></script>
   <script type="application/javascript"
           src="../role.js"></script>
   <script type="application/javascript"
           src="../layout.js"></script>
 
   <script type="application/javascript">
     var kX = 10, kY = 10, kWidth = 150, kHeight = 100;
-    function doTest()
-    {
+    function doTest() {
       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");
--- a/accessible/tests/mochitest/elm/test_figure.html
+++ b/accessible/tests/mochitest/elm/test_figure.html
@@ -16,18 +16,17 @@
           src="../attributes.js"></script>
   <script type="application/javascript"
           src="../relations.js"></script>
   <script type="application/javascript"
           src="../name.js"></script>
 
   <script type="application/javascript">
 
-    function doTest()
-    {
+    function doTest() {
       testRole("figure", ROLE_FIGURE);
       testRole("figcaption", ROLE_CAPTION);
 
       todo(false, "figure name gets extra whitespace in the end!");
       testName("figure", "figure caption ");
       testName("figcaption", null);
 
       testRelation("figure", RELATION_LABELLED_BY, "figcaption");
--- a/accessible/tests/mochitest/elm/test_nsApplicationAcc.html
+++ b/accessible/tests/mochitest/elm/test_nsApplicationAcc.html
@@ -8,18 +8,17 @@
           src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
 
   <script type="application/javascript" 
           src="../common.js"></script>
   <script type="application/javascript" 
           src="../role.js"></script>
 
   <script type="application/javascript">
-    function doTest()
-    {
+    function doTest() {
       var accessible = getApplicationAccessible();
       if (!accessible) {
         SimpleTest.finish();
         return;
       }
 
       var bundleServ =
         Components.classes["@mozilla.org/intl/stringbundle;1"].
--- a/accessible/tests/mochitest/elm/test_plugin.html
+++ b/accessible/tests/mochitest/elm/test_plugin.html
@@ -12,18 +12,17 @@
           src="../common.js"></script>
   <script type="application/javascript"
           src="../role.js"></script>
   <script type="application/javascript"
           src="../states.js"></script>
 
   <script type="application/javascript">
 
-    function doTest()
-    {
+    function doTest() {
       if (!WIN) {
         ok(true,
            "It's Windows specific test. Feel free to extend the test.");
 
         SimpleTest.finish();
         return;
       }
 
--- a/accessible/tests/mochitest/elm/test_shadowroot.html
+++ b/accessible/tests/mochitest/elm/test_shadowroot.html
@@ -9,18 +9,17 @@
           src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
 
   <script type="application/javascript"
           src="../common.js"></script>
   <script type="application/javascript"
           src="../role.js"></script>
 
   <script type="application/javascript">
-    function doTest()
-    {
+    function doTest() {
       testElm("component", {
         role: ROLE_GROUPING,
         children: [
         {
           role: ROLE_PUSHBUTTON,
         },
         {
           role: ROLE_LINK,
--- a/accessible/tests/mochitest/events.js
+++ b/accessible/tests/mochitest/events.js
@@ -65,18 +65,17 @@ var gA11yEventDumpFeature = "";
  * @param aEventType  [in] event type
  * @param aTarget     [in] event target
  * @param aFunc       [in] function to call when event is handled
  * @param aContext    [in, optional] object in which context the function is
  *                    called
  * @param aArg1       [in, optional] argument passed into the function
  * @param aArg2       [in, optional] argument passed into the function
  */
-function waitForEvent(aEventType, aTargetOrFunc, aFunc, aContext, aArg1, aArg2)
-{
+function waitForEvent(aEventType, aTargetOrFunc, aFunc, aContext, aArg1, aArg2) {
   var handler = {
     handleEvent: function handleEvent(aEvent) {
 
       var target = aTargetOrFunc;
       if (typeof aTargetOrFunc == "function")
         target = aTargetOrFunc.call();
 
       if (target) {
@@ -87,44 +86,41 @@ function waitForEvent(aEventType, aTarge
         if (target instanceof nsIDOMNode &&
             target != aEvent.DOMNode)
           return;
       }
 
       unregisterA11yEventListener(aEventType, this);
 
       window.setTimeout(
-        function()
-        {
+        function() {
           aFunc.call(aContext, aArg1, aArg2);
         },
         0
       );
     }
   };
 
   registerA11yEventListener(aEventType, handler);
 }
 
 /**
  * Generate mouse move over image map what creates image map accessible (async).
  * See waitForImageMap() function.
  */
-function waveOverImageMap(aImageMapID)
-{
+function waveOverImageMap(aImageMapID) {
   var imageMapNode = getNode(aImageMapID);
   synthesizeMouse(imageMapNode, 10, 10, { type: "mousemove" },
                   imageMapNode.ownerGlobal);
 }
 
 /**
  * Call the given function when the tree of the given image map is built.
  */
-function waitForImageMap(aImageMapID, aTestFunc)
-{
+function waitForImageMap(aImageMapID, aTestFunc) {
   waveOverImageMap(aImageMapID);
 
   var imageMapAcc = getAccessible(aImageMapID);
   if (imageMapAcc.firstChild)
     return aTestFunc();
 
   waitForEvent(EVENT_REORDER, imageMapAcc, aTestFunc);
 }
@@ -134,29 +130,27 @@ function waitForImageMap(aImageMapID, aT
  *
  * @param aEventType     the accessible event type (see nsIAccessibleEvent for
  *                       available constants).
  * @param aEventHandler  event listener object, when accessible event of the
  *                       given type is handled then 'handleEvent' method of
  *                       this object is invoked with nsIAccessibleEvent object
  *                       as the first argument.
  */
-function registerA11yEventListener(aEventType, aEventHandler)
-{
+function registerA11yEventListener(aEventType, aEventHandler) {
   listenA11yEvents(true);
   addA11yEventListener(aEventType, aEventHandler);
 }
 
 /**
  * Unregister accessibility event listener. Must be called for every registered
  * event listener (see registerA11yEventListener() function) when the listener
  * is not needed.
  */
-function unregisterA11yEventListener(aEventType, aEventHandler)
-{
+function unregisterA11yEventListener(aEventType, aEventHandler) {
   removeA11yEventListener(aEventType, aEventHandler);
   listenA11yEvents(false);
 }
 
 
 // //////////////////////////////////////////////////////////////////////////////
 // Event queue
 
@@ -249,55 +243,50 @@ const DO_NOT_FINISH_TEST = 1;
  *   // Used to add a possible scenario of expected/unexpected events on
  *   // invoker's action.
  *  defineScenario(aInvokerObj, aEventSeq, aUnexpectedEventSeq)
  *
  *
  * @param  aEventType  [in, optional] the default event type (isn't used if
  *                      invoker defines eventSeq property).
  */
-function eventQueue(aEventType)
-{
+function eventQueue(aEventType) {
   // public
 
   /**
    * Add invoker object into queue.
    */
-  this.push = function eventQueue_push(aEventInvoker)
-  {
+  this.push = function eventQueue_push(aEventInvoker) {
     this.mInvokers.push(aEventInvoker);
   }
 
   /**
    * Start the queue processing.
    */
-  this.invoke = function eventQueue_invoke()
-  {
+  this.invoke = function eventQueue_invoke() {
     listenA11yEvents(true);
 
     // XXX: Intermittent test_events_caretmove.html fails withouth timeout,
     // see bug 474952.
     this.processNextInvokerInTimeout(true);
   }
 
   /**
    * This function is called when all events in the queue were handled.
    * Override it if you need to be notified of this.
    */
-  this.onFinish = function eventQueue_finish()
-  {
+  this.onFinish = function eventQueue_finish() {
   }
 
   // private
 
   /**
    * Process next invoker.
    */
-  this.processNextInvoker = function eventQueue_processNextInvoker()
-  {
+  this.processNextInvoker = function eventQueue_processNextInvoker() {
     // Some scenario was matched, we wait on next invoker processing.
     if (this.mNextInvokerStatus == kInvokerCanceled) {
       this.setInvokerStatus(kInvokerNotScheduled,
                             "scenario was matched, wait for next invoker activation");
       return;
     }
 
     this.setInvokerStatus(kInvokerNotScheduled, "the next invoker is processed now");
@@ -342,22 +331,20 @@ function eventQueue(aEventType)
                 var checker = eventSeq[idx];
 
                 var typeStr = eventQueue.getEventTypeAsString(checker);
                 var msg = "Test with ID = '" + this.getEventID(checker) +
                   "' succeed. ";
 
                 if (checker.unexpected) {
                   ok(true, msg + `There's no unexpected '${typeStr}' event.`);
-                }
-                else {
+                } else {
                   if (checker.todo) {
                     todo(false, `Todo event '${typeStr}' was caught`);
-                  }
-                  else {
+                  } else {
                     ok(true, `${msg} Event '${typeStr}' was handled.`);
                   }
                 }
               }
             }
           }
         }
 
@@ -376,18 +363,17 @@ function eventQueue(aEventType)
 
               if (checker.wasCaught > 1)
                 ok(false, msg + "Dupe " + typeStr + " event.");
 
               if (checker.unexpected) {
                 if (checker.wasCaught) {
                   ok(false, msg + "There's unexpected " + typeStr + " event.");
                 }
-              }
-              else if (!checker.wasCaught) {
+              } else if (!checker.wasCaught) {
                 var rf = checker.todo ? todo : ok;
                 rf(false, `${msg} '${typeStr} event is missed.`);
               }
             }
           }
         }
       }
     }
@@ -439,18 +425,17 @@ function eventQueue(aEventType)
       return;
     }
 
     if (this.hasUnexpectedEventsScenario())
       this.processNextInvokerInTimeout(true);
   }
 
   this.processNextInvokerInTimeout =
-    function eventQueue_processNextInvokerInTimeout(aUncondProcess)
-  {
+    function eventQueue_processNextInvokerInTimeout(aUncondProcess) {
     this.setInvokerStatus(kInvokerPending, "Process next invoker in timeout");
 
     // No need to wait extra timeout when a) we know we don't need to do that
     // and b) there's no any single unexpected event.
     if (!aUncondProcess && this.areAllEventsExpected()) {
       // We need delay to avoid events coalesce from different invokers.
       var queue = this;
       SimpleTest.executeSoon(function() { queue.processNextInvoker(); });
@@ -460,18 +445,17 @@ function eventQueue(aEventType)
     // Check in timeout invoker didn't fire registered events.
     window.setTimeout(function(aQueue) { aQueue.processNextInvoker(); }, 300,
                       this);
   }
 
   /**
    * Handle events for the current invoker.
    */
-  this.handleEvent = function eventQueue_handleEvent(aEvent)
-  {
+  this.handleEvent = function eventQueue_handleEvent(aEvent) {
     var invoker = this.getInvoker();
     if (!invoker) // skip events before test was started
       return;
 
     if (!this.mScenarios) {
       // Bad invoker object, error will be reported before processing of next
       // invoker in the queue.
       this.processNextInvoker();
@@ -588,135 +572,124 @@ function eventQueue(aEventType)
     if ((this.mNextInvokerStatus == kInvokerPending) && hasMatchedCheckers) {
       this.setInvokerStatus(kInvokerCanceled,
                             "Cancel the scheduled invoker in case of match");
     }
   }
 
   // Helpers
   this.processMatchedChecker =
-    function eventQueue_function(aEvent, aMatchedChecker, aScenarioIdx, aEventIdx)
-  {
+    function eventQueue_function(aEvent, aMatchedChecker, aScenarioIdx, aEventIdx) {
     aMatchedChecker.wasCaught++;
 
     if ("check" in aMatchedChecker)
       aMatchedChecker.check(aEvent);
 
     eventQueue.logEvent(aEvent, aMatchedChecker, aScenarioIdx, aEventIdx,
                         this.areExpectedEventsLeft(),
                         this.mNextInvokerStatus);
   }
 
   this.getNextExpectedEvent =
-    function eventQueue_getNextExpectedEvent(aEventSeq)
-  {
+    function eventQueue_getNextExpectedEvent(aEventSeq) {
     if (!("idx" in aEventSeq))
       aEventSeq.idx = 0;
 
     while (aEventSeq.idx < aEventSeq.length &&
            (aEventSeq[aEventSeq.idx].unexpected ||
             aEventSeq[aEventSeq.idx].todo ||
             aEventSeq[aEventSeq.idx].async ||
             aEventSeq[aEventSeq.idx] instanceof orderChecker ||
             aEventSeq[aEventSeq.idx].wasCaught > 0)) {
       aEventSeq.idx++;
     }
 
     return aEventSeq.idx != aEventSeq.length ? aEventSeq[aEventSeq.idx] : null;
   }
 
   this.areExpectedEventsLeft =
-    function eventQueue_areExpectedEventsLeft(aScenario)
-  {
-    function scenarioHasUnhandledExpectedEvent(aEventSeq)
-    {
-      // Check if we have unhandled async (can be anywhere in the sequance) or
-      // sync expcected events yet.
-      for (var idx = 0; idx < aEventSeq.length; idx++) {
-        if (!aEventSeq[idx].unexpected && !aEventSeq[idx].todo &&
-            !aEventSeq[idx].wasCaught && !(aEventSeq[idx] instanceof orderChecker))
+    function eventQueue_areExpectedEventsLeft(aScenario) {
+      function scenarioHasUnhandledExpectedEvent(aEventSeq) {
+        // Check if we have unhandled async (can be anywhere in the sequance) or
+        // sync expcected events yet.
+        for (var idx = 0; idx < aEventSeq.length; idx++) {
+          if (!aEventSeq[idx].unexpected && !aEventSeq[idx].todo &&
+              !aEventSeq[idx].wasCaught && !(aEventSeq[idx] instanceof orderChecker))
+            return true;
+        }
+
+        return false;
+      }
+
+      if (aScenario)
+        return scenarioHasUnhandledExpectedEvent(aScenario);
+
+      for (var scnIdx = 0; scnIdx < this.mScenarios.length; scnIdx++) {
+        var eventSeq = this.mScenarios[scnIdx];
+        if (scenarioHasUnhandledExpectedEvent(eventSeq))
           return true;
       }
-
       return false;
     }
 
-    if (aScenario)
-      return scenarioHasUnhandledExpectedEvent(aScenario);
-
-    for (var scnIdx = 0; scnIdx < this.mScenarios.length; scnIdx++) {
-      var eventSeq = this.mScenarios[scnIdx];
-      if (scenarioHasUnhandledExpectedEvent(eventSeq))
-        return true;
-    }
-    return false;
-  }
-
   this.areAllEventsExpected =
-    function eventQueue_areAllEventsExpected()
-  {
+    function eventQueue_areAllEventsExpected() {
     for (var scnIdx = 0; scnIdx < this.mScenarios.length; scnIdx++) {
       var eventSeq = this.mScenarios[scnIdx];
       for (var idx = 0; idx < eventSeq.length; idx++) {
         if (eventSeq[idx].unexpected || eventSeq[idx].todo)
           return false;
       }
     }
 
     return true;
   }
 
   this.isUnexpectedEventScenario =
-    function eventQueue_isUnexpectedEventsScenario(aScenario)
-  {
+    function eventQueue_isUnexpectedEventsScenario(aScenario) {
     for (var idx = 0; idx < aScenario.length; idx++) {
       if (!aScenario[idx].unexpected && !aScenario[idx].todo)
         break;
     }
 
     return idx == aScenario.length;
   }
 
   this.hasUnexpectedEventsScenario =
-    function eventQueue_hasUnexpectedEventsScenario()
-  {
+    function eventQueue_hasUnexpectedEventsScenario() {
     if (this.getInvoker().noEventsOnAction)
       return true;
 
     for (var scnIdx = 0; scnIdx < this.mScenarios.length; scnIdx++) {
       if (this.isUnexpectedEventScenario(this.mScenarios[scnIdx]))
         return true;
     }
 
     return false;
   }
 
   this.hasMatchedScenario =
-    function eventQueue_hasMatchedScenario()
-  {
+    function eventQueue_hasMatchedScenario() {
     for (var scnIdx = 0; scnIdx < this.mScenarios.length; scnIdx++) {
       var scn = this.mScenarios[scnIdx];
       if (!this.isUnexpectedEventScenario(scn) && !this.areExpectedEventsLeft(scn))
         return true;
     }
     return false;
   }
 
-  this.getInvoker = function eventQueue_getInvoker()
-  {
+  this.getInvoker = function eventQueue_getInvoker() {
     return this.mInvokers[this.mIndex];
   }
 
-  this.getNextInvoker = function eventQueue_getNextInvoker()
-  {
+  this.getNextInvoker = function eventQueue_getNextInvoker() {
     return this.mInvokers[++this.mIndex];
   }
 
-  this.setEventHandler = function eventQueue_setEventHandler(aInvoker)
-  {
+  this.setEventHandler = function eventQueue_setEventHandler(aInvoker) {
     if (!("scenarios" in aInvoker) || aInvoker.scenarios.length == 0) {
       var eventSeq = aInvoker.eventSeq;
       var unexpectedEventSeq = aInvoker.unexpectedEventSeq;
       if (!eventSeq && !unexpectedEventSeq && this.mDefEventType)
         eventSeq = [ new invokerChecker(this.mDefEventType, aInvoker.DOMNode) ];
 
       if (eventSeq || unexpectedEventSeq)
         defineScenario(aInvoker, eventSeq, unexpectedEventSeq);
@@ -786,18 +759,17 @@ function eventQueue(aEventType)
           addA11yEventListener(eventType, this);
         }
       }
     }
 
     return true;
   }
 
-  this.clearEventHandler = function eventQueue_clearEventHandler()
-  {
+  this.clearEventHandler = function eventQueue_clearEventHandler() {
     if (!this.mScenarios)
       return;
 
     for (var scnIdx = 0; scnIdx < this.mScenarios.length; scnIdx++) {
       var eventSeq = this.mScenarios[scnIdx];
       for (var idx = 0; idx < eventSeq.length; idx++) {
         var eventType = eventSeq[idx].type;
         if (typeof eventType == "string") {
@@ -810,27 +782,25 @@ function eventQueue(aEventType)
           // A11y event
           removeA11yEventListener(eventType, this);
         }
       }
     }
     this.mScenarios = null;
   }
 
-  this.getEventID = function eventQueue_getEventID(aChecker)
-  {
+  this.getEventID = function eventQueue_getEventID(aChecker) {
     if ("getID" in aChecker)
       return aChecker.getID();
 
     var invoker = this.getInvoker();
     return invoker.getID();
   }
 
-  this.setInvokerStatus = function eventQueue_setInvokerStatus(aStatus, aLogMsg)
-  {
+  this.setInvokerStatus = function eventQueue_setInvokerStatus(aStatus, aLogMsg) {
     this.mNextInvokerStatus = aStatus;
 
     // Uncomment it to debug invoker processing logic.
     // gLogger.log(eventQueue.invokerStatusToMsg(aStatus, aLogMsg));
   }
 
   this.mDefEventType = aEventType;
 
@@ -844,31 +814,29 @@ function eventQueue(aEventType)
 // //////////////////////////////////////////////////////////////////////////////
 // eventQueue static members and constants
 
 const kInvokerNotScheduled = 0;
 const kInvokerPending = 1;
 const kInvokerCanceled = 2;
 
 eventQueue.getEventTypeAsString =
-  function eventQueue_getEventTypeAsString(aEventOrChecker)
-{
+  function eventQueue_getEventTypeAsString(aEventOrChecker) {
   if (aEventOrChecker instanceof nsIDOMEvent)
     return aEventOrChecker.type;
 
   if (aEventOrChecker instanceof nsIAccessibleEvent)
     return eventTypeToString(aEventOrChecker.eventType);
 
   return (typeof aEventOrChecker.type == "string") ?
     aEventOrChecker.type : eventTypeToString(aEventOrChecker.type);
 }
 
 eventQueue.getEventTargetDescr =
-  function eventQueue_getEventTargetDescr(aEventOrChecker, aDontForceTarget)
-{
+  function eventQueue_getEventTargetDescr(aEventOrChecker, aDontForceTarget) {
   if (aEventOrChecker instanceof nsIDOMEvent)
     return prettyName(aEventOrChecker.originalTarget);
 
   if (aEventOrChecker instanceof nsIDOMEvent)
     return prettyName(aEventOrChecker.accessible);
 
   var descr = aEventOrChecker.targetDescr;
   if (descr)
@@ -876,31 +844,28 @@ eventQueue.getEventTargetDescr =
 
   if (aDontForceTarget)
     return "no target description";
 
   var target = ("target" in aEventOrChecker) ? aEventOrChecker.target : null;
   return prettyName(target);
 }
 
-eventQueue.getEventPhase = function eventQueue_getEventPhase(aChecker)
-{
+eventQueue.getEventPhase = function eventQueue_getEventPhase(aChecker) {
   return ("phase" in aChecker) ? aChecker.phase : true;
 }
 
 eventQueue.compareEventTypes =
-  function eventQueue_compareEventTypes(aChecker, aEvent)
-{
+  function eventQueue_compareEventTypes(aChecker, aEvent) {
   var eventType = (aEvent instanceof nsIDOMEvent) ?
     aEvent.type : aEvent.eventType;
   return aChecker.type == eventType;
 }
 
-eventQueue.compareEvents = function eventQueue_compareEvents(aChecker, aEvent)
-{
+eventQueue.compareEvents = function eventQueue_compareEvents(aChecker, aEvent) {
   if (!eventQueue.compareEventTypes(aChecker, aEvent))
     return false;
 
   // If checker provides "match" function then allow the checker to decide
   // whether event is matched.
   if ("match" in aChecker)
     return aChecker.match(aEvent);
 
@@ -914,29 +879,27 @@ eventQueue.compareEvents = function even
 
   // If original target isn't suitable then extend interface to support target
   // (original target is used in test_elm_media.html).
   var target2 = (aEvent instanceof nsIDOMEvent) ?
     aEvent.originalTarget : aEvent.DOMNode;
   return target1 == target2;
 }
 
-eventQueue.isSameEvent = function eventQueue_isSameEvent(aChecker, aEvent)
-{
+eventQueue.isSameEvent = function eventQueue_isSameEvent(aChecker, aEvent) {
   // We don't have stored info about handled event other than its type and
   // target, thus we should filter text change and state change events since
   // they may occur on the same element because of complex changes.
   return this.compareEvents(aChecker, aEvent) &&
     !(aEvent instanceof nsIAccessibleTextChangeEvent) &&
     !(aEvent instanceof nsIAccessibleStateChangeEvent);
 }
 
 eventQueue.invokerStatusToMsg =
-  function eventQueue_invokerStatusToMsg(aInvokerStatus, aMsg)
-{
+  function eventQueue_invokerStatusToMsg(aInvokerStatus, aMsg) {
   var msg = "invoker status: ";
   switch (aInvokerStatus) {
     case kInvokerNotScheduled:
       msg += "not scheduled";
       break;
     case kInvokerPending:
       msg += "pending";
       break;
@@ -949,18 +912,17 @@ eventQueue.invokerStatusToMsg =
     msg += " (" + aMsg + ")";
 
   return msg;
 }
 
 eventQueue.logEvent = function eventQueue_logEvent(aOrigEvent, aMatchedChecker,
                                                    aScenarioIdx, aEventIdx,
                                                    aAreExpectedEventsLeft,
-                                                   aInvokerStatus)
-{
+                                                   aInvokerStatus) {
   // Dump DOM event information. Skip a11y event since it is dumped by
   // gA11yEventObserver.
   if (aOrigEvent instanceof nsIDOMEvent) {
     var info = "Event type: " + eventQueue.getEventTypeAsString(aOrigEvent);
     info += ". Target: " + eventQueue.getEventTargetDescr(aOrigEvent);
     gLogger.logToDOM(info);
   }
 
@@ -982,44 +944,41 @@ eventQueue.logEvent = function eventQueu
 
 // //////////////////////////////////////////////////////////////////////////////
 // Action sequence
 
 /**
  * Deal with action sequence. Used when you need to execute couple of actions
  * each after other one.
  */
-function sequence()
-{
+function sequence() {
   /**
    * Append new sequence item.
    *
    * @param  aProcessor  [in] object implementing interface
    *                      {
    *                        // execute item action
    *                        process: function() {},
    *                        // callback, is called when item was processed
    *                        onProcessed: function() {}
    *                      };
    * @param  aEventType  [in] event type of expected event on item action
    * @param  aTarget     [in] event target of expected event on item action
    * @param  aItemID     [in] identifier of item
    */
   this.append = function sequence_append(aProcessor, aEventType, aTarget,
-                                         aItemID)
-  {
+                                         aItemID) {
     var item = new sequenceItem(aProcessor, aEventType, aTarget, aItemID);
     this.items.push(item);
   }
 
   /**
    * Process next sequence item.
    */
-  this.processNext = function sequence_processNext()
-  {
+  this.processNext = function sequence_processNext() {
     this.idx++;
     if (this.idx >= this.items.length) {
       ok(false, "End of sequence: nothing to process!");
       SimpleTest.finish();
       return;
     }
 
     this.items[this.idx].startProcess();
@@ -1032,18 +991,17 @@ function sequence()
 
 // //////////////////////////////////////////////////////////////////////////////
 // Event queue invokers
 
 /**
  * Defines a scenario of expected/unexpected events. Each invoker can have
  * one or more scenarios of events. Only one scenario must be completed.
  */
-function defineScenario(aInvoker, aEventSeq, aUnexpectedEventSeq)
-{
+function defineScenario(aInvoker, aEventSeq, aUnexpectedEventSeq) {
   if (!("scenarios" in aInvoker))
     aInvoker.scenarios = [];
 
   // Create unified event sequence concatenating expected and unexpected
   // events.
   if (!aEventSeq)
     aEventSeq = [];
 
@@ -1071,22 +1029,20 @@ function defineScenario(aInvoker, aEvent
  * until its checker is provided.
  *
  * Note, checker object or array of checker objects is optional.
  */
 
 /**
  * Click invoker.
  */
-function synthClick(aNodeOrID, aCheckerOrEventSeq, aArgs)
-{
+function synthClick(aNodeOrID, aCheckerOrEventSeq, aArgs) {
   this.__proto__ = new synthAction(aNodeOrID, aCheckerOrEventSeq);
 
-  this.invoke = function synthClick_invoke()
-  {
+  this.invoke = function synthClick_invoke() {
     var targetNode = this.DOMNode;
     if (targetNode instanceof nsIDOMDocument) {
       targetNode =
         this.DOMNode.body ? this.DOMNode.body : this.DOMNode.documentElement;
     }
 
     // Scroll the node into view, otherwise synth click may fail.
     if (targetNode instanceof nsIDOMHTMLElement) {
@@ -1101,61 +1057,53 @@ function synthClick(aNodeOrID, aCheckerO
       if (targetNode instanceof nsIDOMHTMLElement)
         x = targetNode.offsetWidth - 1;
       else if (targetNode instanceof nsIDOMXULElement)
         x = targetNode.boxObject.width - 1;
     }
     synthesizeMouse(targetNode, x, y, aArgs ? aArgs : {});
   }
 
-  this.finalCheck = function synthClick_finalCheck()
-  {
+  this.finalCheck = function synthClick_finalCheck() {
     // Scroll top window back.
     window.top.scrollTo(0, 0);
   }
 
-  this.getID = function synthClick_getID()
-  {
+  this.getID = function synthClick_getID() {
     return prettyName(aNodeOrID) + " click";
   }
 }
 
 /**
  * Mouse move invoker.
  */
-function synthMouseMove(aID, aCheckerOrEventSeq)
-{
+function synthMouseMove(aID, aCheckerOrEventSeq) {
   this.__proto__ = new synthAction(aID, aCheckerOrEventSeq);
 
-  this.invoke = function synthMouseMove_invoke()
-  {
+  this.invoke = function synthMouseMove_invoke() {
     synthesizeMouse(this.DOMNode, 1, 1, { type: "mousemove" });
     synthesizeMouse(this.DOMNode, 2, 2, { type: "mousemove" });
   }
 
-  this.getID = function synthMouseMove_getID()
-  {
+  this.getID = function synthMouseMove_getID() {
     return prettyName(aID) + " mouse move";
   }
 }
 
 /**
  * General key press invoker.
  */
-function synthKey(aNodeOrID, aKey, aArgs, aCheckerOrEventSeq)
-{
+function synthKey(aNodeOrID, aKey, aArgs, aCheckerOrEventSeq) {
   this.__proto__ = new synthAction(aNodeOrID, aCheckerOrEventSeq);
 
-  this.invoke = function synthKey_invoke()
-  {
+  this.invoke = function synthKey_invoke() {
     synthesizeKey(this.mKey, this.mArgs, this.mWindow);
   }
 
-  this.getID = function synthKey_getID()
-  {
+  this.getID = function synthKey_getID() {
     var key = this.mKey;
     switch (this.mKey) {
       case "VK_TAB":
         key = "tab";
         break;
       case "VK_DOWN":
         key = "down";
         break;
@@ -1195,167 +1143,147 @@ function synthKey(aNodeOrID, aKey, aArgs
   this.mKey = aKey;
   this.mArgs = aArgs ? aArgs : {};
   this.mWindow = aArgs ? aArgs.window : null;
 }
 
 /**
  * Tab key invoker.
  */
-function synthTab(aNodeOrID, aCheckerOrEventSeq, aWindow)
-{
+function synthTab(aNodeOrID, aCheckerOrEventSeq, aWindow) {
   this.__proto__ = new synthKey(aNodeOrID, "VK_TAB",
                                 { shiftKey: false, window: aWindow },
                                 aCheckerOrEventSeq);
 }
 
 /**
  * Shift tab key invoker.
  */
-function synthShiftTab(aNodeOrID, aCheckerOrEventSeq)
-{
+function synthShiftTab(aNodeOrID, aCheckerOrEventSeq) {
   this.__proto__ = new synthKey(aNodeOrID, "VK_TAB", { shiftKey: true },
                                 aCheckerOrEventSeq);
 }
 
 /**
  * Escape key invoker.
  */
-function synthEscapeKey(aNodeOrID, aCheckerOrEventSeq)
-{
+function synthEscapeKey(aNodeOrID, aCheckerOrEventSeq) {
   this.__proto__ = new synthKey(aNodeOrID, "VK_ESCAPE", null,
                                 aCheckerOrEventSeq);
 }
 
 /**
  * Down arrow key invoker.
  */
-function synthDownKey(aNodeOrID, aCheckerOrEventSeq, aArgs)
-{
+function synthDownKey(aNodeOrID, aCheckerOrEventSeq, aArgs) {
   this.__proto__ = new synthKey(aNodeOrID, "VK_DOWN", aArgs,
                                 aCheckerOrEventSeq);
 }
 
 /**
  * Up arrow key invoker.
  */
-function synthUpKey(aNodeOrID, aCheckerOrEventSeq, aArgs)
-{
+function synthUpKey(aNodeOrID, aCheckerOrEventSeq, aArgs) {
   this.__proto__ = new synthKey(aNodeOrID, "VK_UP", aArgs,
                                 aCheckerOrEventSeq);
 }
 
 /**
  * Left arrow key invoker.
  */
-function synthLeftKey(aNodeOrID, aCheckerOrEventSeq, aArgs)
-{
+function synthLeftKey(aNodeOrID, aCheckerOrEventSeq, aArgs) {
   this.__proto__ = new synthKey(aNodeOrID, "VK_LEFT", aArgs, aCheckerOrEventSeq);
 }
 
 /**
  * Right arrow key invoker.
  */
-function synthRightKey(aNodeOrID, aCheckerOrEventSeq, aArgs)
-{
+function synthRightKey(aNodeOrID, aCheckerOrEventSeq, aArgs) {
   this.__proto__ = new synthKey(aNodeOrID, "VK_RIGHT", aArgs, aCheckerOrEventSeq);
 }
 
 /**
  * Home key invoker.
  */
-function synthHomeKey(aNodeOrID, aCheckerOrEventSeq)
-{
+function synthHomeKey(aNodeOrID, aCheckerOrEventSeq) {
   this.__proto__ = new synthKey(aNodeOrID, "VK_HOME", null, aCheckerOrEventSeq);
 }
 
 /**
  * End key invoker.
  */
-function synthEndKey(aNodeOrID, aCheckerOrEventSeq)
-{
+function synthEndKey(aNodeOrID, aCheckerOrEventSeq) {
   this.__proto__ = new synthKey(aNodeOrID, "VK_END", null, aCheckerOrEventSeq);
 }
 
 /**
  * Enter key invoker
  */
-function synthEnterKey(aID, aCheckerOrEventSeq)
-{
+function synthEnterKey(aID, aCheckerOrEventSeq) {
   this.__proto__ = new synthKey(aID, "VK_RETURN", null, aCheckerOrEventSeq);
 }
 
 /**
  * Synth alt + down arrow to open combobox.
  */
-function synthOpenComboboxKey(aID, aCheckerOrEventSeq)
-{
+function synthOpenComboboxKey(aID, aCheckerOrEventSeq) {
   this.__proto__ = new synthDownKey(aID, aCheckerOrEventSeq, { altKey: true });
 
-  this.getID = function synthOpenComboboxKey_getID()
-  {
+  this.getID = function synthOpenComboboxKey_getID() {
     return "open combobox (atl + down arrow) " + prettyName(aID);
   }
 }
 
 /**
  * Focus invoker.
  */
-function synthFocus(aNodeOrID, aCheckerOrEventSeq)
-{
+function synthFocus(aNodeOrID, aCheckerOrEventSeq) {
   var checkerOfEventSeq =
     aCheckerOrEventSeq ? aCheckerOrEventSeq : new focusChecker(aNodeOrID);
   this.__proto__ = new synthAction(aNodeOrID, checkerOfEventSeq);
 
-  this.invoke = function synthFocus_invoke()
-  {
+  this.invoke = function synthFocus_invoke() {
     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)
-{
+function synthFocusOnFrame(aNodeOrID, aCheckerOrEventSeq) {
   var frameDoc = getNode(aNodeOrID).contentDocument;
   var checkerOrEventSeq =
     aCheckerOrEventSeq ? aCheckerOrEventSeq : new focusChecker(frameDoc);
   this.__proto__ = new synthAction(frameDoc, checkerOrEventSeq);
 
-  this.invoke = function synthFocus_invoke()
-  {
+  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)
-{
+function changeCurrentItem(aID, aItemID) {
   this.eventSeq = [ new nofocusChecker() ];
 
-  this.invoke = function changeCurrentItem_invoke()
-  {
+  this.invoke = function changeCurrentItem_invoke() {
     var controlNode = getNode(aID);
     var itemNode = getNode(aItemID);
 
     // HTML
     if (controlNode.localName == "input") {
       if (controlNode.checked)
         this.reportError();
 
@@ -1389,264 +1317,233 @@ function changeCurrentItem(aID, aItemID)
     }
 
     if (controlNode.currentItem == itemNode)
       ok(false, "Error in test: proposed current item is already current" + prettyName(aID));
 
     controlNode.currentItem = itemNode;
   }
 
-  this.getID = function changeCurrentItem_getID()
-  {
+  this.getID = function changeCurrentItem_getID() {
     return "current item change for " + prettyName(aID);
   }
 
-  this.reportError = function changeCurrentItem_reportError()
-  {
+  this.reportError = function changeCurrentItem_reportError() {
     ok(false,
        "Error in test: proposed current item '" + aItemID + "' is already current");
   }
 }
 
 /**
  * Toggle top menu invoker.
  */
-function toggleTopMenu(aID, aCheckerOrEventSeq)
-{
+function toggleTopMenu(aID, aCheckerOrEventSeq) {
   this.__proto__ = new synthKey(aID, "VK_ALT", null,
                                 aCheckerOrEventSeq);
 
-  this.getID = function toggleTopMenu_getID()
-  {
+  this.getID = function toggleTopMenu_getID() {
     return "toggle top menu on " + prettyName(aID);
   }
 }
 
 /**
  * Context menu invoker.
  */
-function synthContextMenu(aID, aCheckerOrEventSeq)
-{
+function synthContextMenu(aID, aCheckerOrEventSeq) {
   this.__proto__ = new synthClick(aID, aCheckerOrEventSeq,
                                   { button: 0, type: "contextmenu" });
 
-  this.getID = function synthContextMenu_getID()
-  {
+  this.getID = function synthContextMenu_getID() {
     return "context menu on " + prettyName(aID);
   }
 }
 
 /**
  * Open combobox, autocomplete and etc popup, check expandable states.
  */
-function openCombobox(aComboboxID)
-{
+function openCombobox(aComboboxID) {
   this.eventSeq = [
     new stateChangeChecker(STATE_EXPANDED, false, true, aComboboxID)
   ];
 
-  this.invoke = function openCombobox_invoke()
-  {
+  this.invoke = function openCombobox_invoke() {
     getNode(aComboboxID).focus();
     synthesizeKey("VK_DOWN", { altKey: true });
   }
 
-  this.getID = function openCombobox_getID()
-  {
+  this.getID = function openCombobox_getID() {
     return "open combobox " + prettyName(aComboboxID);
   }
 }
 
 /**
  * Close combobox, autocomplete and etc popup, check expandable states.
  */
-function closeCombobox(aComboboxID)
-{
+function closeCombobox(aComboboxID) {
   this.eventSeq = [
     new stateChangeChecker(STATE_EXPANDED, false, false, aComboboxID)
   ];
 
-  this.invoke = function closeCombobox_invoke()
-  {
+  this.invoke = function closeCombobox_invoke() {
     synthesizeKey("VK_ESCAPE", { });
   }
 
-  this.getID = function closeCombobox_getID()
-  {
+  this.getID = function closeCombobox_getID() {
     return "close combobox " + prettyName(aComboboxID);
   }
 }
 
 
 /**
  * Select all invoker.
  */
-function synthSelectAll(aNodeOrID, aCheckerOrEventSeq)
-{
+function synthSelectAll(aNodeOrID, aCheckerOrEventSeq) {
   this.__proto__ = new synthAction(aNodeOrID, aCheckerOrEventSeq);
 
-  this.invoke = function synthSelectAll_invoke()
-  {
+  this.invoke = function synthSelectAll_invoke() {
     if (this.DOMNode instanceof Components.interfaces.nsIDOMHTMLInputElement ||
         this.DOMNode instanceof Components.interfaces.nsIDOMXULTextBoxElement) {
       this.DOMNode.select();
 
     } else {
       window.getSelection().selectAllChildren(this.DOMNode);
     }
   }
 
-  this.getID = function synthSelectAll_getID()
-  {
+  this.getID = function synthSelectAll_getID() {
     return aNodeOrID + " selectall";
   }
 }
 
 /**
  * Move the caret to the end of line.
  */
-function moveToLineEnd(aID, aCaretOffset)
-{
+function moveToLineEnd(aID, aCaretOffset) {
   if (MAC) {
     this.__proto__ = new synthKey(aID, "VK_RIGHT", { metaKey: true },
                                   new caretMoveChecker(aCaretOffset, aID));
   } else {
     this.__proto__ = new synthEndKey(aID,
                                      new caretMoveChecker(aCaretOffset, aID));
   }
 
-  this.getID = function moveToLineEnd_getID()
-  {
+  this.getID = function moveToLineEnd_getID() {
     return "move to line end in " + prettyName(aID);
   }
 }
 
 /**
  * Move the caret to the end of previous line if any.
  */
-function moveToPrevLineEnd(aID, aCaretOffset)
-{
+function moveToPrevLineEnd(aID, aCaretOffset) {
   this.__proto__ = new synthAction(aID, new caretMoveChecker(aCaretOffset, aID));
 
-  this.invoke = function moveToPrevLineEnd_invoke()
-  {
+  this.invoke = function moveToPrevLineEnd_invoke() {
     synthesizeKey("VK_UP", { });
 
     if (MAC)
       synthesizeKey("VK_RIGHT", { metaKey: true });
     else
       synthesizeKey("VK_END", { });
   }
 
-  this.getID = function moveToPrevLineEnd_getID()
-  {
+  this.getID = function moveToPrevLineEnd_getID() {
     return "move to previous line end in " + prettyName(aID);
   }
 }
 
 /**
  * Move the caret to begining of the line.
  */
-function moveToLineStart(aID, aCaretOffset)
-{
+function moveToLineStart(aID, aCaretOffset) {
   if (MAC) {
     this.__proto__ = new synthKey(aID, "VK_LEFT", { metaKey: true },
                                   new caretMoveChecker(aCaretOffset, aID));
   } else {
     this.__proto__ = new synthHomeKey(aID,
                                       new caretMoveChecker(aCaretOffset, aID));
   }
 
-  this.getID = function moveToLineEnd_getID()
-  {
+  this.getID = function moveToLineEnd_getID() {
     return "move to line start in " + prettyName(aID);
   }
 }
 
 /**
  * Move the caret to begining of the text.
  */
-function moveToTextStart(aID)
-{
+function moveToTextStart(aID) {
   if (MAC) {
     this.__proto__ = new synthKey(aID, "VK_UP", { metaKey: true },
                                   new caretMoveChecker(0, aID));
   } else {
     this.__proto__ = new synthKey(aID, "VK_HOME", { ctrlKey: true },
                                   new caretMoveChecker(0, aID));
   }
 
-  this.getID = function moveToTextStart_getID()
-  {
+  this.getID = function moveToTextStart_getID() {
     return "move to text start in " + prettyName(aID);
   }
 }
 
 /**
  * Move the caret in text accessible.
  */
 function moveCaretToDOMPoint(aID, aDOMPointNodeID, aDOMPointOffset,
                              aExpectedOffset, aFocusTargetID,
-                             aCheckFunc)
-{
+                             aCheckFunc) {
   this.target = getAccessible(aID, [nsIAccessibleText]);
   this.DOMPointNode = getNode(aDOMPointNodeID);
   this.focus = aFocusTargetID ? getAccessible(aFocusTargetID) : null;
   this.focusNode = this.focus ? this.focus.DOMNode : null;
 
-  this.invoke = function moveCaretToDOMPoint_invoke()
-  {
+  this.invoke = function moveCaretToDOMPoint_invoke() {
     if (this.focusNode)
       this.focusNode.focus();
 
     var selection = this.DOMPointNode.ownerGlobal.getSelection();
     var selRange = selection.getRangeAt(0);
     selRange.setStart(this.DOMPointNode, aDOMPointOffset);
     selRange.collapse(true);
 
     selection.removeRange(selRange);
     selection.addRange(selRange);
   }
 
-  this.getID = function moveCaretToDOMPoint_getID()
-  {
+  this.getID = function moveCaretToDOMPoint_getID() {
    return "Set caret on " + prettyName(aID) + " at point: " +
      prettyName(aDOMPointNodeID) + " node with offset " + aDOMPointOffset;
   }
 
-  this.finalCheck = function moveCaretToDOMPoint_finalCheck()
-  {
+  this.finalCheck = function moveCaretToDOMPoint_finalCheck() {
     if (aCheckFunc)
       aCheckFunc.call();
   }
 
   this.eventSeq = [
     new caretMoveChecker(aExpectedOffset, this.target)
   ];
 
   if (this.focus)
     this.eventSeq.push(new asyncInvokerChecker(EVENT_FOCUS, this.focus));
 }
 
 /**
  * Set caret offset in text accessible.
  */
-function setCaretOffset(aID, aOffset, aFocusTargetID)
-{
+function setCaretOffset(aID, aOffset, aFocusTargetID) {
   this.target = getAccessible(aID, [nsIAccessibleText]);
   this.offset = aOffset == -1 ? this.target.characterCount : aOffset;
   this.focus = aFocusTargetID ? getAccessible(aFocusTargetID) : null;
 
-  this.invoke = function setCaretOffset_invoke()
-  {
+  this.invoke = function setCaretOffset_invoke() {
     this.target.caretOffset = this.offset;
   }
 
-  this.getID = function setCaretOffset_getID()
-  {
+  this.getID = function setCaretOffset_getID() {
    return "Set caretOffset on " + prettyName(aID) + " at " + this.offset;
   }
 
   this.eventSeq = [
     new caretMoveChecker(this.offset, this.target)
   ];
 
   if (this.focus)
@@ -1655,143 +1552,129 @@ function setCaretOffset(aID, aOffset, aF
 
 
 // //////////////////////////////////////////////////////////////////////////////
 // Event queue checkers
 
 /**
  * Common invoker checker (see eventSeq of eventQueue).
  */
-function invokerChecker(aEventType, aTargetOrFunc, aTargetFuncArg, aIsAsync)
-{
+function invokerChecker(aEventType, aTargetOrFunc, aTargetFuncArg, aIsAsync) {
   this.type = aEventType;
   this.async = aIsAsync;
 
   this.__defineGetter__("target", invokerChecker_targetGetter);
   this.__defineSetter__("target", invokerChecker_targetSetter);
 
   // implementation details
-  function invokerChecker_targetGetter()
-  {
+  function invokerChecker_targetGetter() {
     if (typeof this.mTarget == "function")
       return this.mTarget.call(null, this.mTargetFuncArg);
     if (typeof this.mTarget == "string")
       return getNode(this.mTarget);
 
     return this.mTarget;
   }
 
-  function invokerChecker_targetSetter(aValue)
-  {
+  function invokerChecker_targetSetter(aValue) {
     this.mTarget = aValue;
     return this.mTarget;
   }
 
   this.__defineGetter__("targetDescr", invokerChecker_targetDescrGetter);
 
-  function invokerChecker_targetDescrGetter()
-  {
+  function invokerChecker_targetDescrGetter() {
     if (typeof this.mTarget == "function")
       return this.mTarget.name + ", arg: " + this.mTargetFuncArg;
 
     return prettyName(this.mTarget);
   }
 
   this.mTarget = aTargetOrFunc;
   this.mTargetFuncArg = aTargetFuncArg;
 }
 
 /**
  * event checker that forces preceeding async events to happen before this
  * checker.
  */
-function orderChecker()
-{
+function orderChecker() {
   // XXX it doesn't actually work to inherit from invokerChecker, but maybe we
   // should fix that?
   //  this.__proto__ = new invokerChecker(null, null, null, false);
 }
 
 /**
  * Generic invoker checker for todo events.
  */
-function todo_invokerChecker(aEventType, aTargetOrFunc, aTargetFuncArg)
-{
+function todo_invokerChecker(aEventType, aTargetOrFunc, aTargetFuncArg) {
   this.__proto__ = new invokerChecker(aEventType, aTargetOrFunc,
                                       aTargetFuncArg, true);
   this.todo = true;
 }
 
 /**
  * Generic invoker checker for unexpected events.
  */
-function unexpectedInvokerChecker(aEventType, aTargetOrFunc, aTargetFuncArg)
-{
+function unexpectedInvokerChecker(aEventType, aTargetOrFunc, aTargetFuncArg) {
   this.__proto__ = new invokerChecker(aEventType, aTargetOrFunc,
                                       aTargetFuncArg, true);
 
   this.unexpected = true;
 }
 
 /**
  * Common invoker checker for async events.
  */
-function asyncInvokerChecker(aEventType, aTargetOrFunc, aTargetFuncArg)
-{
+function asyncInvokerChecker(aEventType, aTargetOrFunc, aTargetFuncArg) {
   this.__proto__ = new invokerChecker(aEventType, aTargetOrFunc,
                                       aTargetFuncArg, true);
 }
 
-function focusChecker(aTargetOrFunc, aTargetFuncArg)
-{
+function focusChecker(aTargetOrFunc, aTargetFuncArg) {
   this.__proto__ = new invokerChecker(EVENT_FOCUS, aTargetOrFunc,
                                       aTargetFuncArg, false);
 
   this.unique = true; // focus event must be unique for invoker action
 
-  this.check = function focusChecker_check(aEvent)
-  {
+  this.check = function focusChecker_check(aEvent) {
     testStates(aEvent.accessible, STATE_FOCUSED);
   }
 }
 
-function nofocusChecker(aID)
-{
+function nofocusChecker(aID) {
   this.__proto__ = new focusChecker(aID);
   this.unexpected = true;
 }
 
 /**
  * Text inserted/removed events checker.
  * @param aFromUser  [in, optional] kNotFromUserInput or kFromUserInput
  */
-function textChangeChecker(aID, aStart, aEnd, aTextOrFunc, aIsInserted, aFromUser, aAsync)
-{
+function textChangeChecker(aID, aStart, aEnd, aTextOrFunc, aIsInserted, aFromUser, aAsync) {
   this.target = getNode(aID);
   this.type = aIsInserted ? EVENT_TEXT_INSERTED : EVENT_TEXT_REMOVED;
   this.startOffset = aStart;
   this.endOffset = aEnd;
   this.textOrFunc = aTextOrFunc;
   this.async = aAsync;
 
-  this.match = function stextChangeChecker_match(aEvent)
-  {
+  this.match = function stextChangeChecker_match(aEvent) {
     if (!(aEvent instanceof nsIAccessibleTextChangeEvent) ||
         aEvent.accessible !== getAccessible(this.target)) {
       return false;
     }
 
     let tcEvent = aEvent.QueryInterface(nsIAccessibleTextChangeEvent);
     let modifiedText = (typeof this.textOrFunc === "function") ?
       this.textOrFunc() : this.textOrFunc;
     return modifiedText === tcEvent.modifiedText;
   };
 
-  this.check = function textChangeChecker_check(aEvent)
-  {
+  this.check = function textChangeChecker_check(aEvent) {
     aEvent.QueryInterface(nsIAccessibleTextChangeEvent);
 
     var modifiedText = (typeof this.textOrFunc == "function") ?
       this.textOrFunc() : this.textOrFunc;
     var modifiedTextLen =
       (this.endOffset == -1) ? modifiedText.length : aEnd - aStart;
 
     is(aEvent.start, this.startOffset,
@@ -1807,101 +1690,91 @@ function textChangeChecker(aID, aStart, 
          "wrong value of isFromUserInput() for " + prettyName(aID));
   }
 }
 
 /**
  * Caret move events checker.
  */
 function caretMoveChecker(aCaretOffset, aTargetOrFunc, aTargetFuncArg,
-                          aIsAsync)
-{
+                          aIsAsync) {
   this.__proto__ = new invokerChecker(EVENT_TEXT_CARET_MOVED,
                                       aTargetOrFunc, aTargetFuncArg, aIsAsync);
 
-  this.check = function caretMoveChecker_check(aEvent)
-  {
+  this.check = function caretMoveChecker_check(aEvent) {
     is(aEvent.QueryInterface(nsIAccessibleCaretMoveEvent).caretOffset,
        aCaretOffset,
        "Wrong caret offset for " + prettyName(aEvent.accessible));
   }
 }
 
-function asyncCaretMoveChecker(aCaretOffset, aTargetOrFunc, aTargetFuncArg)
-{
+function asyncCaretMoveChecker(aCaretOffset, aTargetOrFunc, aTargetFuncArg) {
   this.__proto__ = new caretMoveChecker(aCaretOffset, aTargetOrFunc,
                                         aTargetFuncArg, true);
 }
 
 /**
  * Text selection change checker.
  */
-function textSelectionChecker(aID, aStartOffset, aEndOffset)
-{
+function textSelectionChecker(aID, aStartOffset, aEndOffset) {
   this.__proto__ = new invokerChecker(EVENT_TEXT_SELECTION_CHANGED, aID);
 
-  this.check = function textSelectionChecker_check(aEvent)
-  {
+  this.check = function textSelectionChecker_check(aEvent) {
     if (aStartOffset == aEndOffset) {
       ok(true, "Collapsed selection triggered text selection change event.");
     } else {
       testTextGetSelection(aID, aStartOffset, aEndOffset, 0);
     }
   }
 }
 
 /**
  * Object attribute changed checker
  */
-function objAttrChangedChecker(aID, aAttr)
-{
+function objAttrChangedChecker(aID, aAttr) {
   this.__proto__ = new invokerChecker(EVENT_OBJECT_ATTRIBUTE_CHANGED, aID);
 
-  this.check = function objAttrChangedChecker_check(aEvent)
-  {
+  this.check = function objAttrChangedChecker_check(aEvent) {
     var event = null;
     try {
       var event = aEvent.QueryInterface(
         nsIAccessibleObjectAttributeChangedEvent);
     } catch (e) {
       ok(false, "Object attribute changed event was expected");
     }
 
     if (!event) {
       return;
     }
 
     is(event.changedAttribute.toString(), aAttr,
       "Wrong attribute name of the object attribute changed event.");
   };
 
-  this.match = function objAttrChangedChecker_match(aEvent)
-  {
+  this.match = function objAttrChangedChecker_match(aEvent) {
     if (aEvent instanceof nsIAccessibleObjectAttributeChangedEvent) {
       var scEvent = aEvent.QueryInterface(
         nsIAccessibleObjectAttributeChangedEvent);
       return (aEvent.accessible == getAccessible(this.target)) &&
         (scEvent.changedAttribute.toString() == aAttr);
     }
     return false;
   };
 }
 
 /**
  * State change checker.
  */
 function stateChangeChecker(aState, aIsExtraState, aIsEnabled,
                             aTargetOrFunc, aTargetFuncArg, aIsAsync,
-                            aSkipCurrentStateCheck)
-{
+                            aSkipCurrentStateCheck) {
   this.__proto__ = new invokerChecker(EVENT_STATE_CHANGE, aTargetOrFunc,
                                       aTargetFuncArg, aIsAsync);
 
-  this.check = function stateChangeChecker_check(aEvent)
-  {
+  this.check = function stateChangeChecker_check(aEvent) {
     var event = null;
     try {
       var event = aEvent.QueryInterface(nsIAccessibleStateChangeEvent);
     } catch (e) {
       ok(false, "State change event was expected");
     }
 
     if (!event)
@@ -1921,44 +1794,40 @@ function stateChangeChecker(aState, aIsE
 
     var state = aIsEnabled ? (aIsExtraState ? 0 : aState) : 0;
     var extraState = aIsEnabled ? (aIsExtraState ? aState : 0) : 0;
     var unxpdState = aIsEnabled ? 0 : (aIsExtraState ? 0 : aState);
     var unxpdExtraState = aIsEnabled ? 0 : (aIsExtraState ? aState : 0);
     testStates(event.accessible, state, extraState, unxpdState, unxpdExtraState);
   }
 
-  this.match = function stateChangeChecker_match(aEvent)
-  {
+  this.match = function stateChangeChecker_match(aEvent) {
     if (aEvent instanceof nsIAccessibleStateChangeEvent) {
       var scEvent = aEvent.QueryInterface(nsIAccessibleStateChangeEvent);
       return (aEvent.accessible == getAccessible(this.target)) &&
         (scEvent.state == aState);
     }
     return false;
   }
 }
 
 function asyncStateChangeChecker(aState, aIsExtraState, aIsEnabled,
-                                 aTargetOrFunc, aTargetFuncArg)
-{
+                                 aTargetOrFunc, aTargetFuncArg) {
   this.__proto__ = new stateChangeChecker(aState, aIsExtraState, aIsEnabled,
                                           aTargetOrFunc, aTargetFuncArg, true);
 }
 
 /**
  * Expanded state change checker.
  */
-function expandedStateChecker(aIsEnabled, aTargetOrFunc, aTargetFuncArg)
-{
+function expandedStateChecker(aIsEnabled, aTargetOrFunc, aTargetFuncArg) {
   this.__proto__ = new invokerChecker(EVENT_STATE_CHANGE, aTargetOrFunc,
                                       aTargetFuncArg);
 
-  this.check = function expandedStateChecker_check(aEvent)
-  {
+  this.check = function expandedStateChecker_check(aEvent) {
     var event = null;
     try {
       var event = aEvent.QueryInterface(nsIAccessibleStateChangeEvent);
     } catch (e) {
       ok(false, "State change event was expected");
     }
 
     if (!event)
@@ -1976,18 +1845,17 @@ function expandedStateChecker(aIsEnabled
 }
 
 // //////////////////////////////////////////////////////////////////////////////
 // Event sequances (array of predefined checkers)
 
 /**
  * Event seq for single selection change.
  */
-function selChangeSeq(aUnselectedID, aSelectedID)
-{
+function selChangeSeq(aUnselectedID, aSelectedID) {
   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
@@ -2004,29 +1872,27 @@ function selChangeSeq(aUnselectedID, aSe
       new invokerChecker(EVENT_SELECTION, aSelectedID)
     ]
   ];
 }
 
 /**
  * Event seq for item removed form the selection.
  */
-function selRemoveSeq(aUnselectedID)
-{
+function selRemoveSeq(aUnselectedID) {
   return [
     new stateChangeChecker(STATE_SELECTED, false, false, aUnselectedID),
     new invokerChecker(EVENT_SELECTION_REMOVE, aUnselectedID)
   ];
 }
 
 /**
  * Event seq for item added to the selection.
  */
-function selAddSeq(aSelectedID)
-{
+function selAddSeq(aSelectedID) {
   return [
     new stateChangeChecker(STATE_SELECTED, false, true, aSelectedID),
     new invokerChecker(EVENT_SELECTION_ADD, aSelectedID)
   ];
 }
 
 // //////////////////////////////////////////////////////////////////////////////
 // Private implementation details.
@@ -2036,18 +1902,17 @@ function selAddSeq(aSelectedID)
 // //////////////////////////////////////////////////////////////////////////////
 // General
 
 var gA11yEventListeners = {};
 var gA11yEventApplicantsCount = 0;
 
 var gA11yEventObserver =
 {
-  observe: function observe(aSubject, aTopic, aData)
-  {
+  observe: function observe(aSubject, aTopic, aData) {
     if (aTopic != "accessible-event")
       return;
 
     var event;
     try {
       event = aSubject.QueryInterface(nsIAccessibleEvent);
     } catch (ex) {
       // After a test is aborted (i.e. timed out by the harness), this exception is soon triggered.
@@ -2110,43 +1975,40 @@ var gA11yEventObserver =
     if (!listenersArray || eventFromDumpArea)
       return;
 
     for (var index = 0; index < listenersArray.length; index++)
       listenersArray[index].handleEvent(event);
   }
 };
 
-function listenA11yEvents(aStartToListen)
-{
+function listenA11yEvents(aStartToListen) {
   if (aStartToListen) {
     // Add observer when adding the first applicant only.
     if (!(gA11yEventApplicantsCount++))
       Services.obs.addObserver(gA11yEventObserver, "accessible-event");
   } else {
     // Remove observer when there are no more applicants only.
     // '< 0' case should not happen, but just in case: removeObserver() will throw.
     if (--gA11yEventApplicantsCount <= 0)
       Services.obs.removeObserver(gA11yEventObserver, "accessible-event");
   }
 }
 
-function addA11yEventListener(aEventType, aEventHandler)
-{
+function addA11yEventListener(aEventType, aEventHandler) {
   if (!(aEventType in gA11yEventListeners))
     gA11yEventListeners[aEventType] = [];
 
   var listenersArray = gA11yEventListeners[aEventType];
   var index = listenersArray.indexOf(aEventHandler);
   if (index == -1)
     listenersArray.push(aEventHandler);
 }
 
-function removeA11yEventListener(aEventType, aEventHandler)
-{
+function removeA11yEventListener(aEventType, aEventHandler) {
   var listenersArray = gA11yEventListeners[aEventType];
   if (!listenersArray)
     return false;
 
   var index = listenersArray.indexOf(aEventHandler);
   if (index == -1)
     return false;
 
@@ -2163,42 +2025,39 @@ function removeA11yEventListener(aEventT
 /**
  * Used to dump debug information.
  */
 var gLogger =
 {
   /**
    * Return true if dump is enabled.
    */
-  isEnabled: function debugOutput_isEnabled()
-  {
+  isEnabled: function debugOutput_isEnabled() {
     return gA11yEventDumpID || gA11yEventDumpToConsole ||
       gA11yEventDumpToAppConsole;
   },
 
   /**
    * Dump information into DOM and console if applicable.
    */
-  log: function logger_log(aMsg)
-  {
+  log: function logger_log(aMsg) {
     this.logToConsole(aMsg);
     this.logToAppConsole(aMsg);
     this.logToDOM(aMsg);
   },
 
   /**
    * Log message to DOM.
    *
    * @param aMsg          [in] the primary message
    * @param aHasIndent    [in, optional] if specified the message has an indent
    * @param aPreEmphText  [in, optional] the text is colored and appended prior
    *                        primary message
    */
-  logToDOM: function logger_logToDOM(aMsg, aHasIndent, aPreEmphText)
-  {
+  logToDOM: function logger_logToDOM(aMsg, aHasIndent, aPreEmphText) {
     if (gA11yEventDumpID == "")
       return;
 
     var dumpElm = document.getElementById(gA11yEventDumpID);
     if (!dumpElm) {
       ok(false,
          "No dump element '" + gA11yEventDumpID + "' within the document!");
       return;
@@ -2225,36 +2084,33 @@ var gLogger =
     container.appendChild(textNode);
 
     dumpElm.appendChild(container);
   },
 
   /**
    * Log message to console.
    */
-  logToConsole: function logger_logToConsole(aMsg)
-  {
+  logToConsole: function logger_logToConsole(aMsg) {
     if (gA11yEventDumpToConsole)
       dump("\n" + aMsg + "\n");
   },
 
   /**
    * Log message to error console.
    */
-  logToAppConsole: function logger_logToAppConsole(aMsg)
-  {
+  logToAppConsole: function logger_logToAppConsole(aMsg) {
     if (gA11yEventDumpToAppConsole)
       Services.console.logStringMessage("events: " + aMsg);
   },
 
   /**
    * Return true if logging feature is enabled.
    */
-  hasFeature: function logger_hasFeature(aFeature)
-  {
+  hasFeature: function logger_hasFeature(aFeature) {
     var startIdx = gA11yEventDumpFeature.indexOf(aFeature);
     if (startIdx == - 1)
       return false;
 
     var endIdx = startIdx + aFeature.length;
     return endIdx == gA11yEventDumpFeature.length ||
       gA11yEventDumpFeature[endIdx] == ";";
   }
@@ -2262,54 +2118,49 @@ var gLogger =
 
 
 // //////////////////////////////////////////////////////////////////////////////
 // Sequence
 
 /**
  * Base class of sequence item.
  */
-function sequenceItem(aProcessor, aEventType, aTarget, aItemID)
-{
+function sequenceItem(aProcessor, aEventType, aTarget, aItemID) {
   // private
 
-  this.startProcess = function sequenceItem_startProcess()
-  {
+  this.startProcess = function sequenceItem_startProcess() {
     this.queue.invoke();
   }
 
   this.queue = new eventQueue();
-  this.queue.onFinish = function()
-  {
+  this.queue.onFinish = function() {
     aProcessor.onProcessed();
     return DO_NOT_FINISH_TEST;
   }
 
   var invoker = {
     invoke: function invoker_invoke() {
       return aProcessor.process();
     },
-    getID: function invoker_getID()
-    {
+    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.
  */
-function synthAction(aNodeOrID, aEventsObj)
-{
+function synthAction(aNodeOrID, aEventsObj) {
   this.DOMNode = getNode(aNodeOrID);
 
   if (aEventsObj) {
     var scenarios = null;
     if (aEventsObj instanceof Array) {
       if (aEventsObj[0] instanceof Array)
         scenarios = aEventsObj; // scenarios
       else
@@ -2317,11 +2168,10 @@ function synthAction(aNodeOrID, aEventsO
     } else {
       scenarios = [ [ aEventsObj ] ]; // a single checker object
     }
 
     for (var i = 0; i < scenarios.length; i++)
       defineScenario(this, scenarios[i]);
   }
 
-  this.getID = function synthAction_getID()
-    { return prettyName(aNodeOrID) + " action"; }
+  this.getID = function synthAction_getID() { return prettyName(aNodeOrID) + " action"; }
 }
--- a/accessible/tests/mochitest/events/docload_wnd.html
+++ b/accessible/tests/mochitest/events/docload_wnd.html
@@ -1,17 +1,16 @@
 <html>
 <head>
   <title>Accessible events testing for document</title>
   <script>
     const STATE_BUSY = Components.interfaces.nsIAccessibleStates.STATE_BUSY;
 
     var gService = null;
-    function waitForDocLoad()
-    {
+    function waitForDocLoad() {
       if (!gService) {
         gService = Components.classes["@mozilla.org/accessibilityService;1"].
          getService(Components.interfaces.nsIAccessibilityService);
       }
 
       var accDoc = gService.getAccessibleFor(document);
 
       var state = {};
@@ -19,18 +18,17 @@
       if (state.value & STATE_BUSY) {
         window.setTimeout(waitForDocLoad, 0);
         return;
       }
 
       hideIFrame();
     }
 
-    function hideIFrame()
-    {
+    function hideIFrame() {
       var iframe = document.getElementById("iframe");
       gService.getAccessibleFor(iframe.contentDocument);
       iframe.style.display = "none";
     }
   </script>
 </head>
 
 <body onload="waitForDocLoad();">
--- a/accessible/tests/mochitest/events/test_aria_alert.html
+++ b/accessible/tests/mochitest/events/test_aria_alert.html
@@ -14,59 +14,52 @@
   <script type="application/javascript"
           src="../role.js"></script>
   <script type="application/javascript"
           src="../states.js"></script>
   <script type="application/javascript"
           src="../events.js"></script>
 
   <script type="application/javascript">
-    function showAlert(aID)
-    {
+    function showAlert(aID) {
       this.DOMNode = document.createElement("div");
 
-      this.invoke = function showAlert_invoke()
-      {
+      this.invoke = function showAlert_invoke() {
         this.DOMNode.setAttribute("role", "alert");
         this.DOMNode.setAttribute("id", aID);
         var text = document.createTextNode("alert");
         this.DOMNode.appendChild(text);
         document.body.appendChild(this.DOMNode);
       };
 
-      this.getID = function showAlert_getID()
-      {
+      this.getID = function showAlert_getID() {
         return "Show ARIA alert " + aID;
       };
     }
 
-    function changeAlert(aID)
-    {
+    function changeAlert(aID) {
       this.__defineGetter__("DOMNode", function() { return getNode(aID) });
 
-      this.invoke = function changeAlert_invoke()
-      {
+      this.invoke = function changeAlert_invoke() {
         this.DOMNode.textContent = "new alert";
       }
 
-      this.getID = function showAlert_getID()
-      {
+      this.getID = function showAlert_getID() {
         return "Change ARIA alert " + aID;
       }
     }
 
     // //////////////////////////////////////////////////////////////////////////
     // Do tests
 
     // gA11yEventDumpToConsole = true; // debuging
     // enableLogging("tree,events,verbose");
 
     var gQueue = null;
-    function doTests()
-    {
+    function doTests() {
       gQueue = new eventQueue(nsIAccessibleEvent.EVENT_ALERT);
 
       gQueue.push(new showAlert("alert"));
       gQueue.push(new changeAlert("alert"));
 
       gQueue.invoke(); // Will call SimpleTest.finish();
     }
 
--- a/accessible/tests/mochitest/events/test_aria_menu.html
+++ b/accessible/tests/mochitest/events/test_aria_menu.html
@@ -19,148 +19,132 @@
           src="../states.js"></script>
   <script type="application/javascript"
           src="../events.js"></script>
 
   <script type="application/javascript">
     const kViaDisplayStyle = 0;
     const kViaVisibilityStyle = 1;
 
-    function focusMenu(aMenuBarID, aMenuID, aActiveMenuBarID)
-    {
+    function focusMenu(aMenuBarID, aMenuID, aActiveMenuBarID) {
       this.eventSeq = [];
 
       if (aActiveMenuBarID) {
         this.eventSeq.push(new invokerChecker(EVENT_MENU_END,
                                               getNode(aActiveMenuBarID)));
       }
 
       this.eventSeq.push(new invokerChecker(EVENT_MENU_START, getNode(aMenuBarID)));
       this.eventSeq.push(new invokerChecker(EVENT_FOCUS, getNode(aMenuID)));
 
-      this.invoke = function focusMenu_invoke()
-      {
+      this.invoke = function focusMenu_invoke() {
         getNode(aMenuID).focus();
       }
 
-      this.getID = function focusMenu_getID()
-      {
+      this.getID = function focusMenu_getID() {
         return "focus menu '" + aMenuID + "'";
       }
     }
 
-    function showMenu(aMenuID, aParentMenuID, aHow)
-    {
+    function showMenu(aMenuID, aParentMenuID, aHow) {
       this.menuNode = getNode(aMenuID);
 
       // Because of aria-owns processing we may have menupopup start fired before
       // related show event.
       this.eventSeq = [
         new invokerChecker(EVENT_SHOW, this.menuNode),
         new invokerChecker(EVENT_REORDER, getNode(aParentMenuID)),
         new invokerChecker(EVENT_MENUPOPUP_START, this.menuNode)
       ];
 
-      this.invoke = function showMenu_invoke()
-      {
+      this.invoke = function showMenu_invoke() {
         if (aHow == kViaDisplayStyle)
           this.menuNode.style.display = "block";
         else
           this.menuNode.style.visibility = "visible";
       };
 
-      this.getID = function showMenu_getID()
-      {
+      this.getID = function showMenu_getID() {
         return "Show ARIA menu '" + aMenuID + "' by " +
           (aHow == kViaDisplayStyle ? "display" : "visibility") +
           " style tricks";
       };
     }
 
-    function closeMenu(aMenuID, aParentMenuID, aHow)
-    {
+    function closeMenu(aMenuID, aParentMenuID, aHow) {
       this.menuNode = getNode(aMenuID);
       this.menu = null;
 
       this.eventSeq = [
         new invokerChecker(EVENT_HIDE, getMenu, this),
         new invokerChecker(EVENT_MENUPOPUP_END, getMenu, this),
         new invokerChecker(EVENT_REORDER, getNode(aParentMenuID))
       ];
 
-      this.invoke = function closeMenu_invoke()
-      {
+      this.invoke = function closeMenu_invoke() {
         // Store menu accessible reference while menu is still open.
         this.menu = getAccessible(this.menuNode);
 
         // Hide menu.
         if (aHow == kViaDisplayStyle)
           this.menuNode.style.display = "none";
         else
           this.menuNode.style.visibility = "hidden";
       }
 
-      this.getID = function closeMenu_getID()
-      {
+      this.getID = function closeMenu_getID() {
         return "Close ARIA menu " + aMenuID + " by " +
           (aHow == kViaDisplayStyle ? "display" : "visibility") +
           " style tricks";
       }
 
-      function getMenu(aThisObj)
-      {
+      function getMenu(aThisObj) {
         return aThisObj.menu;
       }
     }
 
-    function focusInsideMenu(aMenuID, aMenuBarID)
-    {
+    function focusInsideMenu(aMenuID, aMenuBarID) {
       this.eventSeq = [
         new invokerChecker(EVENT_FOCUS, getNode(aMenuID))
       ];
 
       this.unexpectedEventSeq = [
         new invokerChecker(EVENT_MENU_END, getNode(aMenuBarID))
       ];
 
-      this.invoke = function focusInsideMenu_invoke()
-      {
+      this.invoke = function focusInsideMenu_invoke() {
         getNode(aMenuID).focus();
       }
 
-      this.getID = function focusInsideMenu_getID()
-      {
+      this.getID = function focusInsideMenu_getID() {
         return "focus menu '" + aMenuID + "'";
       }
     }
 
-    function blurMenu(aMenuBarID)
-    {
+    function blurMenu(aMenuBarID) {
       var eventSeq = [
         new invokerChecker(EVENT_MENU_END, getNode(aMenuBarID)),
         new invokerChecker(EVENT_FOCUS, getNode("outsidemenu"))
       ];
 
       this.__proto__ = new synthClick("outsidemenu", eventSeq);
 
-      this.getID = function blurMenu_getID()
-      {
+      this.getID = function blurMenu_getID() {
         return "blur menu";
       }
     }
 
     // //////////////////////////////////////////////////////////////////////////
     // Do tests
 
     // gA11yEventDumpToConsole = true; // debuging
     // enableLogging("tree,events,verbose");
 
     var gQueue = null;
-    function doTests()
-    {
+    function doTests() {
       gQueue = new eventQueue();
 
       gQueue.push(new focusMenu("menubar2", "menu-help"));
       gQueue.push(new focusMenu("menubar", "menu-file", "menubar2"));
       gQueue.push(new showMenu("menupopup-file", "menu-file", kViaDisplayStyle));
       gQueue.push(new closeMenu("menupopup-file", "menu-file", kViaDisplayStyle));
       gQueue.push(new showMenu("menupopup-edit", "menu-edit", kViaVisibilityStyle));
       gQueue.push(new closeMenu("menupopup-edit", "menu-edit", kViaVisibilityStyle));
--- a/accessible/tests/mochitest/events/test_aria_objattr.html
+++ b/accessible/tests/mochitest/events/test_aria_objattr.html
@@ -17,59 +17,53 @@
           src="../events.js"></script>
 
   <script type="application/javascript">
 
     /**
      * Do tests.
      */
     var gQueue = null;
-    function updateAttribute(aID, aAttr, aValue)
-    {
+    function updateAttribute(aID, aAttr, aValue) {
       this.node = getNode(aID);
       this.accessible = getAccessible(this.node);
 
       this.eventSeq = [
         new objAttrChangedChecker(aID, aAttr),
       ];
 
-      this.invoke = function updateAttribute_invoke()
-      {
+      this.invoke = function updateAttribute_invoke() {
         this.node.setAttribute(aAttr, aValue);
       };
 
-      this.getID = function updateAttribute_getID()
-      {
+      this.getID = function updateAttribute_getID() {
         return aAttr + " for " + aID + " " + aValue;
       };
     }
 
-    function updateARIAHidden(aID, aIsDefined, aChildId)
-    {
+    function updateARIAHidden(aID, aIsDefined, aChildId) {
       this.__proto__ = new updateAttribute(aID, "aria-hidden",
                                            aIsDefined ? "true" : "false");
 
-      this.finalCheck = function updateARIAHidden()
-      {
+      this.finalCheck = function updateARIAHidden() {
         if (aIsDefined) {
           testAttrs(aID, {"hidden": "true"}, true);
           testAttrs(aChildId, {"hidden": "true"}, true);
         } else {
           testAbsentAttrs(aID, { "hidden": "true"});
           testAbsentAttrs(aChildId, { "hidden": "true"});
         }
       }
     }
 
     // Debug stuff.
     // gA11yEventDumpID = "eventdump";
     // gA11yEventDumpToConsole = true;
 
-    function doTests()
-    {
+    function doTests() {
       gQueue = new eventQueue();
 
       gQueue.push(new updateARIAHidden("hideable", true, "hideable_child"));
       gQueue.push(new updateARIAHidden("hideable", false, "hideable_child"));
 
       gQueue.push(new updateAttribute("sortable", "aria-sort", "ascending"));
 
       // For experimental ARIA extensions
--- a/accessible/tests/mochitest/events/test_aria_owns.html
+++ b/accessible/tests/mochitest/events/test_aria_owns.html
@@ -28,31 +28,29 @@
     // enableLogging("tree,eventTree,verbose");
 
     /**
      * Aria-owns target shouldn't have a show event.
      * Markup:
      * <div id="t1_fc" aria-owns="t1_owns"></div>
      * <span id="t1_owns"></div>
      */
-    function testAriaOwns()
-    {
+    function testAriaOwns() {
       this.parent = getNode("t1");
       this.fc = document.createElement("div");
       this.fc.setAttribute("id", "t1_fc");
       this.owns = document.createElement("span");
       this.owns.setAttribute("id", "t1_owns");
 
       this.eventSeq = [
         new invokerChecker(EVENT_SHOW, this.fc),
         new unexpectedInvokerChecker(EVENT_SHOW, this.owns)
       ];
 
-      this.invoke = function testAriaOwns_invoke()
-      {
+      this.invoke = function testAriaOwns_invoke() {
         getNode("t1").appendChild(this.fc);
         getNode("t1").appendChild(this.owns);
         getNode("t1_fc").setAttribute("aria-owns", "t1_owns");
       };
 
       this.getID = function testAriaOwns_getID() {
         return "Aria-owns target shouldn't have show event";
       };
@@ -61,49 +59,46 @@
     /**
      * Target of both aria-owns and other aria attribute like aria-labelledby
      * shouldn't have a show event.
      * Markup:
      * <div id="t2_fc" aria-owns="t1_owns"></div>
      * <div id="t2_sc" aria-labelledby="t2_owns"></div>
      * <span id="t2_owns"></div>
      */
-    function testAriaOwnsAndLabelledBy()
-    {
+    function testAriaOwnsAndLabelledBy() {
       this.parent = getNode("t2");
       this.fc = document.createElement("div");
       this.fc.setAttribute("id", "t2_fc");
       this.sc = document.createElement("div");
       this.sc.setAttribute("id", "t2_sc");
       this.owns = document.createElement("span");
       this.owns.setAttribute("id", "t2_owns");
 
       this.eventSeq = [
         new invokerChecker(EVENT_SHOW, this.fc),
         new invokerChecker(EVENT_SHOW, this.sc),
         new unexpectedInvokerChecker(EVENT_SHOW, this.owns)
       ];
 
-      this.invoke = function testAriaOwns_invoke()
-      {
+      this.invoke = function testAriaOwns_invoke() {
         getNode("t2").appendChild(this.fc);
         getNode("t2").appendChild(this.sc);
         getNode("t2").appendChild(this.owns);
         getNode("t2_fc").setAttribute("aria-owns", "t2_owns");
         getNode("t2_sc").setAttribute("aria-labelledby", "t2_owns");
       };
 
       this.getID = function testAriaOwns_getID() {
         return "Aria-owns and aria-labelledby target shouldn't have show event";
       };
     }
 
     var gQueue = null;
-    function doTests()
-    {
+    function doTests() {
       gQueue = new eventQueue();
       gQueue.push(new testAriaOwns());
       gQueue.push(new testAriaOwnsAndLabelledBy());
 
       gQueue.invoke(); // Will call SimpleTest.finish();
     }
     SimpleTest.waitForExplicitFinish();
     addA11yLoadEvent(doTests);
--- a/accessible/tests/mochitest/events/test_aria_statechange.html
+++ b/accessible/tests/mochitest/events/test_aria_statechange.html
@@ -24,139 +24,121 @@
     /**
      * Do tests.
      */
     var gQueue = null;
 
     // gA11yEventDumpID = "eventdump"; // debugging
     // gA11yEventDumpToConsole = true; // debugging
 
-    function expandNode(aID, aIsExpanded)
-    {
+    function expandNode(aID, aIsExpanded) {
       this.DOMNode = getNode(aID);
 
       this.eventSeq = [
         new expandedStateChecker(aIsExpanded, this.DOMNode)
       ];
 
-      this.invoke = function expandNode_invoke()
-      {
+      this.invoke = function expandNode_invoke() {
         this.DOMNode.setAttribute("aria-expanded",
                                   (aIsExpanded ? "true" : "false"));
       };
 
-      this.getID = function expandNode_getID()
-      {
+      this.getID = function expandNode_getID() {
         return prettyName(aID) + " aria-expanded changed to '" + aIsExpanded + "'";
       };
     }
 
-    function busyify(aID, aIsBusy)
-    {
+    function busyify(aID, aIsBusy) {
       this.DOMNode = getNode(aID);
 
       this.eventSeq = [
         new stateChangeChecker(STATE_BUSY, kOrdinalState, aIsBusy, this.DOMNode)
       ];
 
-      this.invoke = function busyify_invoke()
-      {
+      this.invoke = function busyify_invoke() {
         this.DOMNode.setAttribute("aria-busy", (aIsBusy ? "true" : "false"));
       };
 
-      this.getID = function busyify_getID()
-      {
+      this.getID = function busyify_getID() {
         return prettyName(aID) + " aria-busy changed to '" + aIsBusy + "'";
       };
     }
 
-    function makeCurrent(aID, aIsCurrent, aValue)
-    {
+    function makeCurrent(aID, aIsCurrent, aValue) {
       this.DOMNode = getNode(aID);
 
       this.eventSeq = [
         new stateChangeChecker(EXT_STATE_CURRENT, true, aIsCurrent, this.DOMNode)
       ];
 
-      this.invoke = function makeCurrent_invoke()
-      {
+      this.invoke = function makeCurrent_invoke() {
         this.DOMNode.setAttribute("aria-current", aValue);
       };
 
-      this.getID = function makeCurrent_getID()
-      {
+      this.getID = function makeCurrent_getID() {
         return prettyName(aID) + " aria-current changed to " + aValue;
       };
     }
 
-    function setAttrOfMixedType(aID, aAttr, aState, aValue)
-    {
+    function setAttrOfMixedType(aID, aAttr, aState, aValue) {
       this.DOMNode = getNode(aID);
 
       this.eventSeq = [
         new stateChangeChecker(aState, kOrdinalState,
                                aValue == "true", this.DOMNode)
       ];
 
       if (hasState(aID, STATE_MIXED) || aValue == "mixed") {
         this.eventSeq.push(
           new stateChangeChecker(STATE_MIXED, kOrdinalState,
                                  aValue == "mixed", this.DOMNode)
         );
       }
 
-      this.invoke = function setAttrOfMixedType_invoke()
-      {
+      this.invoke = function setAttrOfMixedType_invoke() {
         this.DOMNode.setAttribute(aAttr, aValue);
       };
 
-      this.getID = function setAttrOfMixedType_getID()
-      {
+      this.getID = function setAttrOfMixedType_getID() {
         return prettyName(aID) + " " + aAttr + " changed to '" + aValue + "'";
       };
     }
 
-    function setPressed(aID, aValue)
-    {
+    function setPressed(aID, aValue) {
       this.__proto__ =
         new setAttrOfMixedType(aID, "aria-pressed", STATE_PRESSED, aValue);
     }
 
-    function setChecked(aID, aValue)
-    {
+    function setChecked(aID, aValue) {
       this.__proto__ =
         new setAttrOfMixedType(aID, "aria-checked", STATE_CHECKED, aValue);
     }
 
-    function buildQueueForAttr(aList, aQueue, aID, aInvokerFunc)
-    {
+    function buildQueueForAttr(aList, aQueue, aID, aInvokerFunc) {
       for (var i = 0; i < aList.length; i++) {
         for (var j = i + 1; j < aList.length; j++) {
           // XXX: changes from/to "undefined"/"" shouldn't fire state change
           // events, bug 472142.
           aQueue.push(new aInvokerFunc(aID, aList[i]));
           aQueue.push(new aInvokerFunc(aID, aList[j]));
         }
       }
     }
 
-    function buildQueueForAttrOfMixedType(aQueue, aID, aInvokerFunc)
-    {
+    function buildQueueForAttrOfMixedType(aQueue, aID, aInvokerFunc) {
       var list = [ "", "undefined", "false", "true", "mixed" ];
       buildQueueForAttr(list, aQueue, aID, aInvokerFunc);
     }
 
-    function buildQueueForAttrOfBoolType(aQueue, aID, aInvokerFunc)
-    {
+    function buildQueueForAttrOfBoolType(aQueue, aID, aInvokerFunc) {
       var list = [ "", "undefined", "false", "true" ];
       buildQueueForAttr(list, aQueue, aID, aInvokerFunc);
     }
 
-    function doTests()
-    {
+    function doTests() {
       gQueue = new eventQueue();
 
       gQueue.push(new expandNode("section", true));
       gQueue.push(new expandNode("section", false));
       gQueue.push(new expandNode("div", true));
       gQueue.push(new expandNode("div", false));
 
       gQueue.push(new busyify("aria_doc", true));
--- a/accessible/tests/mochitest/events/test_attrs.html
+++ b/accessible/tests/mochitest/events/test_attrs.html
@@ -18,42 +18,39 @@
   <script type="application/javascript"
           src="../attributes.js"></script>
 
   <script type="application/javascript">
 
     /**
      * Test "event-from-input" object attribute.
      */
-    function eventFromInputChecker(aEventType, aID, aValue, aNoTargetID)
-    {
+    function eventFromInputChecker(aEventType, aID, aValue, aNoTargetID) {
       this.type = aEventType;
       this.target = getAccessible(aID);
 
       this.noTarget = getNode(aNoTargetID);
 
-      this.check = function checker_check(aEvent)
-      {
+      this.check = function checker_check(aEvent) {
         testAttrs(aEvent.accessible, { "event-from-input": aValue }, true);
 
         var accessible = getAccessible(this.noTarget);
         testAbsentAttrs(accessible, { "event-from-input": "" });
       }
     }
 
     /**
      * Do tests.
      */
     var gQueue = null;
 
     // gA11yEventDumpID = "eventdump"; // debug stuff
     // gA11yEventDumpToConsole = true; // debug stuff
 
-    function doTests()
-    {
+    function doTests() {
       gQueue = new eventQueue();
 
       var id = "textbox", noTargetId = "textarea";
       var checker =
         new eventFromInputChecker(EVENT_FOCUS, id, "false", noTargetId);
       gQueue.push(new synthFocus(id, checker));
 
       if (!MAC) { // Mac failure is bug 541093
--- a/accessible/tests/mochitest/events/test_bug1322593-2.html
+++ b/accessible/tests/mochitest/events/test_bug1322593-2.html
@@ -12,48 +12,44 @@
           src="chrome://mochikit/content/tests/SimpleTest/EventUtils.js"></script>
 
   <script type="application/javascript"
           src="../common.js"></script>
   <script type="application/javascript"
           src="../events.js"></script>
 
   <script type="application/javascript">
-    function changeMultipleElements()
-    {
+    function changeMultipleElements() {
       this.node1 = getNode("span1");
       this.node2 = getNode("span2");
 
       this.eventSeq = [
         new textChangeChecker("container", 0, 5, "hello", false, undefined, true),
         new textChangeChecker("container", 6, 11, "world", false, undefined, true),
         new orderChecker(),
         new textChangeChecker("container", 0, 1, "a", true, undefined, true),
         new textChangeChecker("container", 7, 8, "b", true, undefined, true)
       ];
 
-      this.invoke = function changeMultipleElements_invoke()
-      {
+      this.invoke = function changeMultipleElements_invoke() {
         this.node1.textContent = "a";
         this.node2.textContent = "b";
       }
 
-      this.getID = function changeMultipleElements_invoke_getID()
-      {
+      this.getID = function changeMultipleElements_invoke_getID() {
         return "Change the text content of multiple sibling divs";
       }
     }
 
     // //////////////////////////////////////////////////////////////////////////
     // Do tests
 //    gA11yEventDumpToConsole = true; // debugging
 
     var gQueue = null;
-    function doTests()
-    {
+    function doTests() {
       gQueue = new eventQueue();
 
       gQueue.push(new changeMultipleElements());
 
       gQueue.invoke(); // Will call SimpleTest.finish();
     }
 
     SimpleTest.waitForExplicitFinish();
--- a/accessible/tests/mochitest/events/test_bug1322593.html
+++ b/accessible/tests/mochitest/events/test_bug1322593.html
@@ -12,48 +12,44 @@
           src="chrome://mochikit/content/tests/SimpleTest/EventUtils.js"></script>
 
   <script type="application/javascript"
           src="../common.js"></script>
   <script type="application/javascript"
           src="../events.js"></script>
 
   <script type="application/javascript">
-    function changeMultipleElements()
-    {
+    function changeMultipleElements() {
       this.node1 = getNode("div1");
       this.node2 = getNode("div2");
 
       this.eventSeq = [
         new textChangeChecker("div1", 0, 5, "hello", false, undefined, true),
         new textChangeChecker("div2", 0, 5, "world", false, undefined, true),
         new orderChecker(),
         new textChangeChecker("div1", 0, 1, "a", true, undefined, true),
         new textChangeChecker("div2", 0, 1, "b", true, undefined, true)
       ];
 
-      this.invoke = function changeMultipleElements_invoke()
-      {
+      this.invoke = function changeMultipleElements_invoke() {
         this.node1.textContent = "a";
         this.node2.textContent = "b";
       }
 
-      this.getID = function changeMultipleElements_invoke_getID()
-      {
+      this.getID = function changeMultipleElements_invoke_getID() {
         return "Change the text content of multiple sibling divs";
       }
     }
 
     // //////////////////////////////////////////////////////////////////////////
     // Do tests
 //    gA11yEventDumpToConsole = true; // debugging
 
     var gQueue = null;
-    function doTests()
-    {
+    function doTests() {
       gQueue = new eventQueue();
 
       gQueue.push(new changeMultipleElements());
 
       gQueue.invoke(); // Will call SimpleTest.finish();
     }
 
     SimpleTest.waitForExplicitFinish();
--- a/accessible/tests/mochitest/events/test_caretmove.html
+++ b/accessible/tests/mochitest/events/test_caretmove.html
@@ -15,24 +15,22 @@
           src="../common.js"></script>
   <script type="application/javascript"
           src="../events.js"></script>
 
   <script type="application/javascript">
     /**
      * Click checker.
      */
-    function clickChecker(aCaretOffset, aID, aExtraNodeOrID, aExtraCaretOffset)
-    {
+    function clickChecker(aCaretOffset, aID, aExtraNodeOrID, aExtraCaretOffset) {
       this.__proto__ = new caretMoveChecker(aCaretOffset, aID);
 
       this.extraNode = getNode(aExtraNodeOrID);
 
-      this.check = function clickChecker_check(aEvent)
-      {
+      this.check = function clickChecker_check(aEvent) {
         this.__proto__.check(aEvent);
 
         if (this.extraNode) {
           var acc = getAccessible(this.extraNode, [nsIAccessibleText]);
           is(acc.caretOffset, aExtraCaretOffset,
              "Wrong caret offset for " + aExtraNodeOrID);
         }
       }
@@ -41,18 +39,17 @@
     /**
      * Do tests.
      */
     var gQueue = null;
 
     // gA11yEventDumpID = "eventdump"; // debug stuff
     // gA11yEventDumpToConsole = true;
 
-    function doTests()
-    {
+    function doTests() {
       // test caret move events and caret offsets
       gQueue = new eventQueue();
 
       var id = "textbox";
       gQueue.push(new synthFocus(id, new caretMoveChecker(5, id)));
       gQueue.push(new synthSelectAll(id, new caretMoveChecker(5, id)));
       gQueue.push(new synthClick(id, new caretMoveChecker(0, id)));
       gQueue.push(new synthRightKey(id, new caretMoveChecker(1, id)));
--- a/accessible/tests/mochitest/events/test_coalescence.html
+++ b/accessible/tests/mochitest/events/test_coalescence.html
@@ -27,56 +27,51 @@
     const kHideElm = 2;
     const kAddElm = 3;
     const kShowElm = 4;
 
     /**
      * Base class to test of mutation events coalescence.
      */
     function coalescenceBase(aChildAction, aParentAction,
-                             aPerformActionOnChildInTheFirstPlace)
-    {
+                             aPerformActionOnChildInTheFirstPlace) {
       // Invoker interface
 
-      this.invoke = function coalescenceBase_invoke()
-      {
+      this.invoke = function coalescenceBase_invoke() {
         if (aPerformActionOnChildInTheFirstPlace) {
           this.invokeAction(this.childNode, aChildAction);
           this.invokeAction(this.parentNode, aParentAction);
         } else {
           this.invokeAction(this.parentNode, aParentAction);
           this.invokeAction(this.childNode, aChildAction);
         }
       }
 
-      this.getID = function coalescenceBase_getID()
-      {
+      this.getID = function coalescenceBase_getID() {
         var childAction = this.getActionName(aChildAction) + " child";
         var parentAction = this.getActionName(aParentAction) + " parent";
 
         if (aPerformActionOnChildInTheFirstPlace)
           return childAction + " and then " + parentAction;
 
         return parentAction + " and then " + childAction;
       }
 
-      this.finalCheck = function coalescenceBase_check()
-      {
+      this.finalCheck = function coalescenceBase_check() {
         if (this.getEventType(aChildAction) == EVENT_HIDE) {
           testIsDefunct(this.child);
         }
         if (this.getEventType(aParentAction) == EVENT_HIDE) {
           testIsDefunct(this.parent);
         }
       }
 
       // Implementation details
 
-      this.invokeAction = function coalescenceBase_invokeAction(aNode, aAction)
-      {
+      this.invokeAction = function coalescenceBase_invokeAction(aNode, aAction) {
         switch (aAction) {
           case kRemoveElm:
             aNode.remove();
             break;
 
           case kHideElm:
             aNode.style.display = "none";
             break;
@@ -92,44 +87,41 @@
             aNode.style.display = "block";
             break;
 
           default:
             return INVOKER_ACTION_FAILED;
         }
       }
 
-      this.getEventType = function coalescenceBase_getEventType(aAction)
-      {
+      this.getEventType = function coalescenceBase_getEventType(aAction) {
         switch (aAction) {
           case kRemoveElm: case kHideElm:
             return EVENT_HIDE;
           case kAddElm: case kShowElm:
             return EVENT_SHOW;
         }
       }
 
-      this.getActionName = function coalescenceBase_getActionName(aAction)
-      {
+      this.getActionName = function coalescenceBase_getActionName(aAction) {
         switch (aAction) {
           case kRemoveElm:
             return "remove";
           case kHideElm:
             return "hide";
           case kAddElm:
             return "add";
           case kShowElm:
             return "show";
           default:
             return "??";
         }
       }
 
-      this.initSequence = function coalescenceBase_initSequence()
-      {
+      this.initSequence = function coalescenceBase_initSequence() {
         // expected events
         var eventType = this.getEventType(aParentAction);
         this.eventSeq = [
           new invokerChecker(eventType, this.parentNode),
           new invokerChecker(EVENT_REORDER, this.hostNode)
         ];
 
         // unexpected events
@@ -140,23 +132,21 @@
       }
     }
 
     /**
      * Remove or hide mutation events coalescence testing.
      */
     function removeOrHideCoalescenceBase(aChildID, aParentID,
                                          aChildAction, aParentAction,
-                                         aPerformActionOnChildInTheFirstPlace)
-    {
+                                         aPerformActionOnChildInTheFirstPlace) {
       this.__proto__ = new coalescenceBase(aChildAction, aParentAction,
                                            aPerformActionOnChildInTheFirstPlace);
 
-      this.init = function removeOrHideCoalescenceBase_init()
-      {
+      this.init = function removeOrHideCoalescenceBase_init() {
         this.childNode = getNode(aChildID);
         this.parentNode = getNode(aParentID);
         this.child = getAccessible(this.childNode);
         this.parent = getAccessible(this.parentNode);
         this.hostNode = this.parentNode.parentNode;
       }
 
       // Initalization
@@ -166,100 +156,90 @@
     }
 
     // //////////////////////////////////////////////////////////////////////////
     // Invokers
 
     /**
      * Remove child node and then its parent node from DOM tree.
      */
-    function removeChildNParent(aChildID, aParentID)
-    {
+    function removeChildNParent(aChildID, aParentID) {
       this.__proto__ = new removeOrHideCoalescenceBase(aChildID, aParentID,
                                                        kRemoveElm, kRemoveElm,
                                                        true);
     }
 
     /**
      * Remove parent node and then its child node from DOM tree.
      */
-    function removeParentNChild(aChildID, aParentID)
-    {
+    function removeParentNChild(aChildID, aParentID) {
       this.__proto__ = new removeOrHideCoalescenceBase(aChildID, aParentID,
                                                        kRemoveElm, kRemoveElm,
                                                        false);
     }
 
     /**
      * Hide child node and then its parent node.
      */
-    function hideChildNParent(aChildID, aParentID)
-    {
+    function hideChildNParent(aChildID, aParentID) {
       this.__proto__ = new removeOrHideCoalescenceBase(aChildID, aParentID,
                                                        kHideElm, kHideElm,
                                                        true);
     }
 
     /**
      * Hide parent node and then its child node.
      */
-    function hideParentNChild(aChildID, aParentID)
-    {
+    function hideParentNChild(aChildID, aParentID) {
       this.__proto__ = new removeOrHideCoalescenceBase(aChildID, aParentID,
                                                        kHideElm, kHideElm,
                                                        false);
     }
 
     /**
      * Hide child node and then remove its parent node.
      */
-    function hideChildNRemoveParent(aChildID, aParentID)
-    {
+    function hideChildNRemoveParent(aChildID, aParentID) {
       this.__proto__ = new removeOrHideCoalescenceBase(aChildID, aParentID,
                                                        kHideElm, kRemoveElm,
                                                        true);
     }
 
     /**
      * Hide parent node and then remove its child node.
      */
-    function hideParentNRemoveChild(aChildID, aParentID)
-    {
+    function hideParentNRemoveChild(aChildID, aParentID) {
       this.__proto__ = new removeOrHideCoalescenceBase(aChildID, aParentID,
                                                        kRemoveElm, kHideElm,
                                                        false);
     }
 
     /**
      * Remove child node and then hide its parent node.
      */
-    function removeChildNHideParent(aChildID, aParentID)
-    {
+    function removeChildNHideParent(aChildID, aParentID) {
       this.__proto__ = new removeOrHideCoalescenceBase(aChildID, aParentID,
                                                        kRemoveElm, kHideElm,
                                                        true);
     }
 
     /**
      * Remove parent node and then hide its child node.
      */
-    function removeParentNHideChild(aChildID, aParentID)
-    {
+    function removeParentNHideChild(aChildID, aParentID) {
       this.__proto__ = new removeOrHideCoalescenceBase(aChildID, aParentID,
                                                        kHideElm, kRemoveElm,
                                                        false);
     }
 
     /**
      * Create and append parent node and create and append child node to it.
      */
-    function addParentNChild(aHostID, aPerformActionOnChildInTheFirstPlace)
-    {
-      this.init = function addParentNChild_init()
-      {
+    function addParentNChild(aHostID, aPerformActionOnChildInTheFirstPlace) {
+      this.init = function addParentNChild_init() {
         this.hostNode = getNode(aHostID);
         this.parentNode = document.createElement("select");
         this.childNode = document.createElement("option");
         this.childNode.textContent = "testing";
       }
 
       this.__proto__ = new coalescenceBase(kAddElm, kAddElm,
                                            aPerformActionOnChildInTheFirstPlace);
@@ -267,180 +247,165 @@
       this.init();
       this.initSequence();
     }
 
     /**
      * Show parent node and show child node to it.
      */
     function showParentNChild(aParentID, aChildID,
-                              aPerformActionOnChildInTheFirstPlace)
-    {
-      this.init = function showParentNChild_init()
-      {
+                              aPerformActionOnChildInTheFirstPlace) {
+      this.init = function showParentNChild_init() {
         this.parentNode = getNode(aParentID);
         this.hostNode = this.parentNode.parentNode;
         this.childNode = getNode(aChildID);
       }
 
       this.__proto__ = new coalescenceBase(kShowElm, kShowElm,
                                            aPerformActionOnChildInTheFirstPlace);
 
       this.init();
       this.initSequence();
     }
 
     /**
      * Create and append child node to the DOM and then show parent node.
      */
     function showParentNAddChild(aParentID,
-                                 aPerformActionOnChildInTheFirstPlace)
-    {
-      this.init = function showParentNAddChild_init()
-      {
+                                 aPerformActionOnChildInTheFirstPlace) {
+      this.init = function showParentNAddChild_init() {
         this.parentNode = getNode(aParentID);
         this.hostNode = this.parentNode.parentNode;
         this.childNode = document.createElement("option");
         this.childNode.textContent = "testing";
       }
 
       this.__proto__ = new coalescenceBase(kAddElm, kShowElm,
                                            aPerformActionOnChildInTheFirstPlace);
 
       this.init();
       this.initSequence();
     }
 
     /**
      * Remove children and parent
      */
-    function removeGrandChildrenNHideParent(aChild1Id, aChild2Id, aParentId)
-    {
+    function removeGrandChildrenNHideParent(aChild1Id, aChild2Id, aParentId) {
       this.child1 = getNode(aChild1Id);
       this.child2 = getNode(aChild2Id);
       this.parent = getNode(aParentId);
 
       this.eventSeq = [
         new invokerChecker(EVENT_HIDE, getAccessible(aParentId)),
         new invokerChecker(EVENT_REORDER, getNode(aParentId).parentNode),
         new unexpectedInvokerChecker(EVENT_HIDE, getAccessible(aChild1Id)),
         new unexpectedInvokerChecker(EVENT_HIDE, getAccessible(aChild2Id)),
         new unexpectedInvokerChecker(EVENT_REORDER, getAccessible(aParentId))
       ];
 
-      this.invoke = function removeGrandChildrenNHideParent_invoke()
-      {
+      this.invoke = function removeGrandChildrenNHideParent_invoke() {
         this.child1.remove();
         this.child2.remove();
         this.parent.hidden = true;
       }
 
       this.getID = function removeGrandChildrenNHideParent_getID() {
         return "remove grand children of different parents and then hide their grand parent";
       }
     }
 
     /**
      * Remove a child, and then its parent.
      */
-    function test3()
-    {
+    function test3() {
       this.o = getAccessible("t3_o");
       this.ofc = getAccessible("t3_o").firstChild;
 
       this.eventSeq = [
         new invokerChecker(EVENT_HIDE, this.o),
         new invokerChecker(EVENT_REORDER, "t3_lb"),
         new unexpectedInvokerChecker(EVENT_HIDE, this.ofc),
         new unexpectedInvokerChecker(EVENT_REORDER, this.o)
       ];
 
-      this.invoke = function test3_invoke()
-      {
+      this.invoke = function test3_invoke() {
         getNode("t3_o").textContent = "";
         getNode("t3_lb").removeChild(getNode("t3_o"));
       }
 
-      this.finalCheck = function test3_finalCheck()
-      {
+      this.finalCheck = function test3_finalCheck() {
         testIsDefunct(this.o);
         testIsDefunct(this.ofc);
       }
 
       this.getID = function test3_getID() {
         return "remove a child, and then its parent";
       }
     }
 
     /**
      * Remove children, and then a parent of 2nd child.
      */
-    function test4()
-    {
+    function test4() {
       this.o1 = getAccessible("t4_o1");
       this.o1fc = this.o1.firstChild;
       this.o2 = getAccessible("t4_o2");
       this.o2fc = this.o2.firstChild;
 
       this.eventSeq = [
         new invokerChecker(EVENT_HIDE, this.o1fc),
         new invokerChecker(EVENT_HIDE, this.o2),
         new invokerChecker(EVENT_REORDER, "t4_lb"),
         new unexpectedInvokerChecker(EVENT_HIDE, this.o2fc),
         new unexpectedInvokerChecker(EVENT_REORDER, this.o1),
         new unexpectedInvokerChecker(EVENT_REORDER, this.o2)
       ];
 
-      this.invoke = function test4_invoke()
-      {
+      this.invoke = function test4_invoke() {
         getNode("t4_o1").textContent = "";
         getNode("t4_o2").textContent = "";
         getNode("t4_lb").removeChild(getNode("t4_o2"));
       }
 
-      this.finalCheck = function test4_finalCheck()
-      {
+      this.finalCheck = function test4_finalCheck() {
         testIsDefunct(this.o1fc);
         testIsDefunct(this.o2);
         testIsDefunct(this.o2fc);
       }
 
       this.getID = function test4_getID() {
         return "remove children, and then a parent of 2nd child";
       }
     }
 
     /**
      * Remove a child, remove a parent sibling, remove the parent
      */
-    function test5()
-    {
+    function test5() {
       this.o = getAccessible("t5_o");
       this.ofc = this.o.firstChild;
       this.b = getAccessible("t5_b");
       this.lb = getAccessible("t5_lb");
 
       this.eventSeq = [
         new invokerChecker(EVENT_HIDE, this.b),
         new invokerChecker(EVENT_HIDE, this.o),
         new invokerChecker(EVENT_REORDER, "t5"),
         new unexpectedInvokerChecker(EVENT_HIDE, this.ofc),
         new unexpectedInvokerChecker(EVENT_REORDER, this.o),
         new unexpectedInvokerChecker(EVENT_REORDER, this.lb)
       ];
 
-      this.invoke = function test5_invoke()
-      {
+      this.invoke = function test5_invoke() {
         getNode("t5_o").textContent = "";
         getNode("t5").removeChild(getNode("t5_b"));
         getNode("t5_lb").removeChild(getNode("t5_o"));
       }
 
-      this.finalCheck = function test5_finalCheck()
-      {
+      this.finalCheck = function test5_finalCheck() {
         testIsDefunct(this.ofc);
         testIsDefunct(this.o);
         testIsDefunct(this.b);
       }
 
       this.getID = function test5_getID() {
         return "remove a child, remove a parent sibling, remove the parent";
       }
@@ -449,18 +414,17 @@
     /**
      * Insert accessibles with a child node moved by aria-owns
      * Markup:
      * <div id="t6_fc">
      *   <div id="t6_owns"></div>
      * </div>
      * <div id="t6_sc" aria-owns="t6_owns"></div>
      */
-    function test6()
-    {
+    function test6() {
       this.parent = getNode("t6");
       this.fc = document.createElement("div");
       this.fc.setAttribute("id", "t6_fc");
       this.owns = document.createElement("div");
       this.owns.setAttribute("id", "t6_owns");
       this.sc = document.createElement("div");
       this.sc.setAttribute("id", "t6_sc");
 
@@ -469,18 +433,17 @@
         new invokerChecker(EVENT_SHOW, this.sc),
         new invokerChecker(EVENT_REORDER, this.parent),
         new unexpectedInvokerChecker(EVENT_REORDER, this.fc),
         new unexpectedInvokerChecker(EVENT_REORDER, this.sc),
         new unexpectedInvokerChecker(EVENT_HIDE, this.owns),
         new unexpectedInvokerChecker(EVENT_SHOW, this.owns)
       ];
 
-      this.invoke = function test6_invoke()
-      {
+      this.invoke = function test6_invoke() {
         getNode("t6").appendChild(this.fc);
         getNode("t6_fc").appendChild(this.owns);
         getNode("t6").appendChild(this.sc);
         getNode("t6_sc").setAttribute("aria-owns", "t6_owns");
       };
 
       this.getID = function test6_getID() {
         return "Insert accessibles with a child node moved by aria-owns";
@@ -493,30 +456,28 @@
      *
      * Markup:
      * <div id="t7_moveplace" aria-owns="t7_c"></div>
      * <div id="t7_c">
      *   <div id="t7_c_directchild">ha</div>
      *   <div><div id="t7_c_grandchild">ha</div></div>
      * </div>
      */
-    function test7()
-    {
+    function test7() {
       this.eventSeq = [
         new invokerChecker(EVENT_HIDE, getNode("t7_c")),
         new invokerChecker(EVENT_SHOW, getNode("t7_c")),
         new invokerChecker(EVENT_REORDER, getNode("t7")),
         new unexpectedInvokerChecker(EVENT_REORDER, getNode("t7_c_directchild")),
         new unexpectedInvokerChecker(EVENT_REORDER, getNode("t7_c_grandchild")),
         new unexpectedInvokerChecker(EVENT_SHOW, () => getNode("t7_c_directchild").firstChild),
         new unexpectedInvokerChecker(EVENT_SHOW, () => getNode("t7_c_grandchild").firstChild)
       ];
 
-      this.invoke = function test7_invoke()
-      {
+      this.invoke = function test7_invoke() {
         getNode("t7_c_directchild").textContent = "ha";
         getNode("t7_c_grandchild").textContent = "ha";
         getNode("t7_moveplace").setAttribute("aria-owns", "t7_c");
       };
 
       this.getID = function test7_getID() {
         return "Show child accessibles and then hide their container";
       };
@@ -528,28 +489,26 @@
      * reorder for 't8_c1'
      *   hide for 't8_c1_child'
      *   show for 't8_c2_moved'
      * reorder for 't8_c2'
      *   hide for 't8_c2_moved'
      *
      * The hide event should be delivered before the paired show event.
      */
-    function test8()
-    {
+    function test8() {
       this.eventSeq = [
         new invokerChecker(EVENT_HIDE, getNode("t8_c1_child")),
         new invokerChecker(EVENT_HIDE, "t8_c2_moved"),
         new invokerChecker(EVENT_SHOW, "t8_c2_moved"),
         new invokerChecker(EVENT_REORDER, "t8_c2"),
         new invokerChecker(EVENT_REORDER, "t8_c1"),
       ];
 
-      this.invoke = function test8_invoke()
-      {
+      this.invoke = function test8_invoke() {
         // Remove a node from 't8_c1' container to give the event tree a
         // desired structure (the 't8_c1' container node goes first in the event
         // tree)
         getNode("t8_c1_child").remove();
         // then move 't8_c2_moved' from 't8_c2' to 't8_c1'.
         getNode("t8_c1").setAttribute("aria-owns", "t8_c2_moved");
       };
 
@@ -569,32 +528,30 @@
     *    hide for 't9_c2_child'
      *   hide for 't9_c2_moved'
      * reorder for 't9_c3'
      *   hide for 't9_c3_moved'
      *
      * The hide events for 't9_c2_moved' and 't9_c3_moved' should be delivered
      * before the show event for 't9_c2_moved'.
      */
-    function test9()
-    {
+    function test9() {
       this.eventSeq = [
         new invokerChecker(EVENT_HIDE, getNode("t9_c1_child")),
         new invokerChecker(EVENT_HIDE, getNode("t9_c2_child")),
         new invokerChecker(EVENT_HIDE, "t9_c3_moved"),
         new invokerChecker(EVENT_HIDE, "t9_c2_moved"),
         new invokerChecker(EVENT_SHOW, "t9_c2_moved"),
         new invokerChecker(EVENT_REORDER, "t9_c3"),
         new invokerChecker(EVENT_REORDER, "t9_c2"),
         new invokerChecker(EVENT_REORDER, "t9_c1"),
         new unexpectedInvokerChecker(EVENT_SHOW, "t9_c3_moved")
       ];
 
-      this.invoke = function test9_invoke()
-      {
+      this.invoke = function test9_invoke() {
         // Remove child nodes from 't9_c1' and 't9_c2' containers to give
         // the event tree a needed structure ('t9_c1' and 't9_c2' nodes go
         // first in the event tree),
         getNode("t9_c1_child").remove();
         getNode("t9_c2_child").remove();
         // then do aria-owns magic.
         getNode("t9_c2_moved").setAttribute("aria-owns", "t9_c3_moved");
         getNode("t9_c1").setAttribute("aria-owns", "t9_c2_moved");
@@ -615,31 +572,29 @@
      *   hide for 't10_c2_child'
      *   hide for 't10_c2_moved'
      * reorder for 't10_c3'
      *   hide for 't10_c3_moved'
      *
      * The hide events for 't10_c2_moved' and 't10_c3_moved' should be delivered
      * before the show event for 't10_c2_moved'.
      */
-    function test10()
-    {
+    function test10() {
       this.eventSeq = [
         new invokerChecker(EVENT_HIDE, getNode("t10_c1_child")),
         new invokerChecker(EVENT_HIDE, getNode("t10_c2_child")),
         new invokerChecker(EVENT_HIDE, getNode("t10_c2_moved")),
         new invokerChecker(EVENT_HIDE, getNode("t10_c3_moved")),
         new invokerChecker(EVENT_SHOW, getNode("t10_c2_moved")),
         new invokerChecker(EVENT_REORDER, "t10_c2"),
         new invokerChecker(EVENT_REORDER, "t10_c1"),
         new invokerChecker(EVENT_REORDER, "t10_c3")
       ];
 
-      this.invoke = function test10_invoke()
-      {
+      this.invoke = function test10_invoke() {
         // Remove child nodes from 't10_c1' and 't10_c2' containers to give
         // the event tree a needed structure ('t10_c1' and 't10_c2' nodes go first
         // in the event tree),
         getNode("t10_c1_child").remove();
         getNode("t10_c2_child").remove();
         // then do aria-owns stuff.
         getNode("t10_c1").setAttribute("aria-owns", "t10_c2_moved");
         getNode("t10_c2_moved").setAttribute("aria-owns", "t10_c3_moved");
@@ -650,34 +605,32 @@
       };
     }
 
     /**
      * Move a node by aria-owns from right to left in the tree, and then
      * move its parent too by aria-owns. No hide event should be fired for
      * original node.
      */
-    function test11()
-    {
+    function test11() {
       this.eventSeq = [
         new invokerChecker(EVENT_HIDE, getNode("t11_c1_child")),
         new invokerChecker(EVENT_HIDE, getNode("t11_c2")),
         new orderChecker(),
         new asyncInvokerChecker(EVENT_SHOW, "t11_c2_child"),
         new asyncInvokerChecker(EVENT_SHOW, "t11_c2"),
         new orderChecker(),
         new invokerChecker(EVENT_REORDER, "t11"),
         new unexpectedInvokerChecker(EVENT_HIDE, "t11_c2_child"),
         new unexpectedInvokerChecker(EVENT_REORDER, "t11_c1"),
         new unexpectedInvokerChecker(EVENT_REORDER, "t11_c2"),
         new unexpectedInvokerChecker(EVENT_REORDER, "t11_c3")
       ];
 
-      this.invoke = function test11_invoke()
-      {
+      this.invoke = function test11_invoke() {
         // Remove a node from 't11_c1' container to give the event tree a
         // desired structure (the 't11_c1' container node goes first in
         // the event tree),
         getNode("t11_c1_child").remove();
         // then move 't11_c2_moved' from 't11_c2' to 't11_c1', and then move
         // 't11_c2' to 't11_c3'.
         getNode("t11_c1").setAttribute("aria-owns", "t11_c2_child");
         getNode("t11_c3").setAttribute("aria-owns", "t11_c2");
@@ -690,18 +643,17 @@
 
     // //////////////////////////////////////////////////////////////////////////
     // Do tests.
 
     gA11yEventDumpToConsole = true; // debug stuff
     // enableLogging("eventTree");
 
     var gQueue = null;
-    function doTests()
-    {
+    function doTests() {
       gQueue = new eventQueue();
 
       gQueue.push(new removeChildNParent("option1", "select1"));
       gQueue.push(new removeParentNChild("option2", "select2"));
       gQueue.push(new hideChildNParent("option3", "select3"));
       gQueue.push(new hideParentNChild("option4", "select4"));
       gQueue.push(new hideChildNRemoveParent("option5", "select5"));
       gQueue.push(new hideParentNRemoveChild("option6", "select6"));
--- a/accessible/tests/mochitest/events/test_contextmenu.html
+++ b/accessible/tests/mochitest/events/test_contextmenu.html
@@ -19,78 +19,67 @@
           src="../states.js"></script>
   <script type="application/javascript"
           src="../events.js"></script>
 
   <script type="application/javascript">
     // //////////////////////////////////////////////////////////////////////////
     // Invokers
 
-    function showContextMenu(aID)
-    {
+    function showContextMenu(aID) {
       this.DOMNode = getNode(aID);
 
       this.eventSeq = [
         new invokerChecker(EVENT_MENUPOPUP_START, getContextMenuNode()),
       ];
 
-      this.invoke = function showContextMenu_invoke()
-      {
+      this.invoke = function showContextMenu_invoke() {
         synthesizeMouse(this.DOMNode, 4, 4, { type: "contextmenu", button: 2 });
       }
 
-      this.getID = function showContextMenu_getID()
-      {
+      this.getID = function showContextMenu_getID() {
         return "show context menu";
       }
     }
 
-    function selectMenuItem()
-    {
+    function selectMenuItem() {
       this.eventSeq = [
         new invokerChecker(EVENT_FOCUS, getFocusedMenuItem)
       ];
 
-      this.invoke = function selectMenuItem_invoke()
-      {
+      this.invoke = function selectMenuItem_invoke() {
         synthesizeKey("VK_DOWN", { });
       }
 
-      this.getID = function selectMenuItem_getID()
-      {
+      this.getID = function selectMenuItem_getID() {
         return "select first menuitem";
       }
     }
 
-    function closeContextMenu(aID)
-    {
+    function closeContextMenu(aID) {
       this.eventSeq = [
         new invokerChecker(EVENT_MENUPOPUP_END,
                            getAccessible(getContextMenuNode()))
       ];
 
-      this.invoke = function closeContextMenu_invoke()
-      {
+      this.invoke = function closeContextMenu_invoke() {
         synthesizeKey("VK_ESCAPE", { });
       }
 
-      this.getID = function closeContextMenu_getID()
-      {
+      this.getID = function closeContextMenu_getID() {
         return "close context menu";
       }
     }
 
-    function getContextMenuNode()
-    {
+    function getContextMenuNode() {
       return getRootAccessible().DOMDocument.
         getElementById("contentAreaContextMenu");
     }
 
-    function getFocusedMenuItem()
-    {
+    function getFocusedMenuItem() {
       var menu = getAccessible(getAccessible(getContextMenuNode()));
       for (var idx = 0; idx < menu.childCount; idx++) {
         var item = menu.getChildAt(idx);
 
         if (hasState(item, STATE_FOCUSED))
           return getAccessible(item);
       }
       return null;
@@ -98,18 +87,17 @@
 
     // //////////////////////////////////////////////////////////////////////////
     // Do tests
 
     var gQueue = null;
     // gA11yEventDumpID = "eventdump"; // debug stuff
     // gA11yEventDumpToConsole = true;
 
-    function doTests()
-    {
+    function doTests() {
       gQueue = new eventQueue();
 
       gQueue.push(new showContextMenu("input"));
       gQueue.push(new selectMenuItem());
       gQueue.push(new closeContextMenu());
 
       gQueue.invoke(); // Will call SimpleTest.finish();
     }
--- a/accessible/tests/mochitest/events/test_descrchange.html
+++ b/accessible/tests/mochitest/events/test_descrchange.html
@@ -19,38 +19,34 @@
           src="../role.js"></script>
   <script type="application/javascript"
           src="../states.js"></script>
 
   <script type="application/javascript">
     // //////////////////////////////////////////////////////////////////////////
     // Invokers
 
-    function setAttr(aID, aAttr, aValue, aChecker)
-    {
+    function setAttr(aID, aAttr, aValue, aChecker) {
       this.eventSeq = [ aChecker ];
-      this.invoke = function setAttr_invoke()
-      {
+      this.invoke = function setAttr_invoke() {
         getNode(aID).setAttribute(aAttr, aValue);
       }
 
-      this.getID = function setAttr_getID()
-      {
+      this.getID = function setAttr_getID() {
         return "set attr '" + aAttr + "', value '" + aValue + "'";
       }
     }
 
     // //////////////////////////////////////////////////////////////////////////
     // Do tests
 
     // gA11yEventDumpToConsole = true; // debuggin
 
     var gQueue = null;
-    function doTests()
-    {
+    function doTests() {
       gQueue = new eventQueue();
 
       gQueue.push(new setAttr("tst1", "aria-describedby", "display",
                               new invokerChecker(EVENT_DESCRIPTION_CHANGE, "tst1")));
       gQueue.push(new setAttr("tst1", "title", "title",
                               new unexpectedInvokerChecker(EVENT_DESCRIPTION_CHANGE, "tst1")));
 
       gQueue.push(new setAttr("tst2", "title", "title",
--- a/accessible/tests/mochitest/events/test_docload.html
+++ b/accessible/tests/mochitest/events/test_docload.html
@@ -36,165 +36,149 @@
 
   <script type="application/javascript"
           src="../events.js"></script>
 
   <script type="application/javascript">
     // //////////////////////////////////////////////////////////////////////////
     // Invokers
 
-    function changeIframeSrc(aIdentifier, aURL)
-    {
+    function changeIframeSrc(aIdentifier, aURL) {
       this.DOMNode = getNode(aIdentifier);
 
       this.eventSeq = [
         new invokerChecker(EVENT_REORDER, getAccessible(this.DOMNode)),
         new asyncInvokerChecker(EVENT_DOCUMENT_LOAD_COMPLETE, getIframeDoc)
       ];
 
-      this.invoke = function changeIframeSrc_invoke()
-      {
+      this.invoke = function changeIframeSrc_invoke() {
         this.DOMNode.src = aURL;
       }
 
-      this.finalCheck = function changeIframeSrc_finalCheck()
-      {
+      this.finalCheck = function changeIframeSrc_finalCheck() {
         var accTree = {
           role: ROLE_INTERNAL_FRAME,
           children: [
             {
               role: ROLE_DOCUMENT,
               name: aURL == "about:" ? "About:" : aURL
             }
           ]
         };
 
         testAccessibleTree(this.DOMNode, accTree);
       }
 
-      this.getID = function changeIframeSrc_getID()
-      {
+      this.getID = function changeIframeSrc_getID() {
         return "change iframe src on " + aURL;
       }
 
-      function getIframeDoc()
-      {
+      function getIframeDoc() {
         return getAccessible(getNode(aIdentifier).contentDocument);
       }
     }
 
     const kHide = 1;
     const kShow = 2;
     const kRemove = 3;
-    function morphIFrame(aIdentifier, aAction)
-    {
+    function morphIFrame(aIdentifier, aAction) {
       this.DOMNode = getNode(aIdentifier);
       this.IFrameContainerDOMNode = this.DOMNode.parentNode;
 
       this.eventSeq = [];
 
       var checker = null;
       if (aAction == kShow)
         checker = new invokerChecker(EVENT_SHOW, this.DOMNode);
       else
         checker = new invokerChecker(EVENT_HIDE, this.DOMNode);
       this.eventSeq.push(checker);
 
       var reorderChecker =
         new invokerChecker(EVENT_REORDER, this.IFrameContainerDOMNode);
       this.eventSeq.push(reorderChecker);
 
-      this.invoke = function morphIFrame_invoke()
-      {
+      this.invoke = function morphIFrame_invoke() {
         if (aAction == kHide) {
           this.DOMNode.style.display = "none";
         } else if (aAction == kShow) {
           this.DOMNode.style.display = "block";
         } else {
           this.IFrameContainerDOMNode.removeChild(this.DOMNode);
         }
       }
 
-      this.finalCheck = function morphIFrame_finalCheck()
-      {
+      this.finalCheck = function morphIFrame_finalCheck() {
         var accTree = {
           role: ROLE_SECTION,
           children: (aAction == kHide || aAction == kRemove) ? [ ] :
             [
               {
                 role: ROLE_INTERNAL_FRAME,
                 children: [
                   { role: ROLE_DOCUMENT }
                 ]
               }
             ]
         };
 
         testAccessibleTree(this.IFrameContainerDOMNode, accTree);
       }
 
-      this.getID = function morphIFrame_getID()
-      {
+      this.getID = function morphIFrame_getID() {
         if (aAction == kRemove)
           return "remove iframe";
 
         return "change display style of iframe to " +
           ((aAction == kHide) ? "none" : "block");
       }
     }
 
-    function makeIFrameVisible(aID)
-    {
+    function makeIFrameVisible(aID) {
       this.DOMNode = getNode(aID);
 
       this.eventSeq = [
         new invokerChecker(EVENT_REORDER, this.DOMNode.parentNode)
       ];
 
-      this.invoke = function makeIFrameVisible_invoke()
-      {
+      this.invoke = function makeIFrameVisible_invoke() {
         this.DOMNode.style.visibility = "visible";
       }
 
-      this.getID = function makeIFrameVisible_getID()
-      {
+      this.getID = function makeIFrameVisible_getID() {
         return "The accessible for DOM document loaded before it's shown shouldn't have busy state.";
       }
     }
 
-    function openDialogWnd(aURL)
-    {
+    function openDialogWnd(aURL) {
       // Get application root accessible.
       var docAcc = getAccessible(document);
       while (docAcc) {
         this.mRootAcc = docAcc;
         try {
           docAcc = docAcc.parent;
         } catch (e) {
           ok(false, "Can't get parent for " + prettyName(docAcc));
           throw e;
         }
       }
 
       this.eventSeq = [
         new invokerChecker(EVENT_REORDER, this.mRootAcc)
       ];
 
-      this.invoke = function openDialogWnd_invoke()
-      {
+      this.invoke = function openDialogWnd_invoke() {
         this.mDialog = window.openDialog(aURL);
       }
 
-      this.finalCheck = function openDialogWnd_finalCheck()
-      {
+      this.finalCheck = function openDialogWnd_finalCheck() {
         this.finalCheckImpl();
       }
 
-      this.finalCheckImpl = function openDialogWnd_finalCheckImpl()
-      {
+      this.finalCheckImpl = function openDialogWnd_finalCheckImpl() {
         var accTree = {
           role: ROLE_APP_ROOT,
           children: [
             {
               role: ROLE_CHROME_WINDOW
             },
             {
               role: ROLE_CHROME_WINDOW
@@ -218,47 +202,42 @@
 
         // close() is asynchronous.
         SimpleTest.executeSoon(function() {
           ok(!isAccessibleInCache(dlgDoc),
              "The document accessible for '" + aURL + "' is in cache still!");
         });
       }
 
-      this.getID = function openDialogWnd_getID()
-      {
+      this.getID = function openDialogWnd_getID() {
         return "open dialog '" + aURL + "'";
       }
     }
 
-    function openWndShutdownDoc()
-    {
+    function openWndShutdownDoc() {
       this.__proto__ =
         new openDialogWnd("../events/docload_wnd.html");
 
       var thisObj = this;
       var docChecker = {
         type: EVENT_HIDE,
-        get target()
-        {
+        get target() {
           var iframe = this.invoker.mDialog.document.getElementById("iframe");
           this.invoker.iframeDoc = iframe.contentDocument;
           return iframe;
         },
-        get targetDescr()
-        {
+        get targetDescr() {
           return "inner iframe of docload_wnd.html document";
         },
         invoker: thisObj
       };
 
       this.eventSeq.push(docChecker);
 
-      this.finalCheck = function openWndShutdownDoc_finalCheck()
-      {
+      this.finalCheck = function openWndShutdownDoc_finalCheck() {
         // After timeout after event hide for iframe was handled the document
         // accessible for iframe's document is in cache still.
         ok(!isAccessibleInCache(this.iframeDoc),
             "The document accessible for iframe is in cache still after iframe hide!");
 
         this.finalCheckImpl();
 
         // After the window is closed all alive subdocument accessibles should
@@ -272,36 +251,34 @@
     // Do tests
 
     var gQueue = null;
 
     // Debug stuff.
     // gA11yEventDumpID = "eventdump";
     // gA11yEventDumpToConsole = true;
 
-    function doTests()
-    {
+    function doTests() {
       gQueue = new eventQueue();
 
       gQueue.push(new changeIframeSrc("iframe", "about:"));
       gQueue.push(new changeIframeSrc("iframe", "about:buildconfig"));
       gQueue.push(new morphIFrame("iframe", kHide));
       gQueue.push(new morphIFrame("iframe", kShow));
       gQueue.push(new morphIFrame("iframe", kRemove));
       gQueue.push(new makeIFrameVisible("iframe2"));
       gQueue.push(new openDialogWnd("about:"));
       gQueue.push(new openWndShutdownDoc());
 
       gQueue.onFinish = doLastCallTests;
 
       gQueue.invoke(); // Will call SimpleTest.finish();
     }
 
-    function doLastCallTests()
-    {
+    function doLastCallTests() {
       // ////////////////////////////////////////////////////////////////////////
       // makeIFrameVisible() test, part2
 
       // The document shouldn't have busy state (the DOM document was loaded
       // before its accessible was created). Do this test lately to make sure
       // the content of document accessible was created initially, prior to this
       // the document accessible keeps busy state. The initial creation happens
       // asynchronously after document creation, there are no events we could
--- a/accessible/tests/mochitest/events/test_docload_aria.html
+++ b/accessible/tests/mochitest/events/test_docload_aria.html
@@ -17,45 +17,41 @@
           src="../states.js"></script>
   <script type="application/javascript"
           src="../events.js"></script>
 
   <script type="application/javascript">
     // //////////////////////////////////////////////////////////////////////////
     // Invokers
 
-    function showARIADialog(aID)
-    {
+    function showARIADialog(aID) {
       this.dialogNode = getNode(aID);
 
       this.eventSeq = [
         new invokerChecker(EVENT_DOCUMENT_LOAD_COMPLETE, this.dialogNode)
       ];
 
-      this.invoke = function showARIADialog_invoke()
-      {
+      this.invoke = function showARIADialog_invoke() {
         this.dialogNode.style.display = "block";
       }
 
-      this.getID = function showARIADialog_getID()
-      {
+      this.getID = function showARIADialog_getID() {
         return "show ARIA dialog";
       }
     }
 
     // //////////////////////////////////////////////////////////////////////////
     // Do tests
 
     var gQueue = null;
 
     // Debug stuff.
     // gA11yEventDumpToConsole = true;
 
-    function doTests()
-    {
+    function doTests() {
       gQueue = new eventQueue();
 
       gQueue.push(new showARIADialog("dialog"));
       gQueue.push(new showARIADialog("document"));
 
       gQueue.invoke(); // Will call SimpleTest.finish();
     }
 
--- a/accessible/tests/mochitest/events/test_dragndrop.html
+++ b/accessible/tests/mochitest/events/test_dragndrop.html
@@ -20,18 +20,17 @@
   <script type="application/javascript">
 
     /**
      * Do tests.
      */
     var gQueue = null;
 
     // aria grabbed invoker
-    function changeGrabbed(aNodeOrID, aGrabValue)
-    {
+    function changeGrabbed(aNodeOrID, aGrabValue) {
       this.DOMNode = getNode(aNodeOrID);
 
       this.invoke = function changeGrabbed_invoke() {
         if (aGrabValue != undefined) {
           this.DOMNode.setAttribute("aria-grabbed", aGrabValue);
         }
       }
 
@@ -40,18 +39,17 @@
       }
 
       this.getID = function changeGrabbed_getID() {
         return prettyName(aNodeOrID) + " aria-grabbed changed";
       }
     }
 
     // aria dropeffect invoker
-    function changeDropeffect(aNodeOrID, aDropeffectValue)
-    {
+    function changeDropeffect(aNodeOrID, aDropeffectValue) {
       this.DOMNode = getNode(aNodeOrID);
 
       this.invoke = function changeDropeffect_invoke() {
         if (aDropeffectValue != undefined) {
           this.DOMNode.setAttribute("aria-dropeffect", aDropeffectValue);
         }
       }
 
@@ -59,18 +57,17 @@
         testAttrs(aNodeOrID, {"dropeffect": aDropeffectValue}, true);
       }
 
       this.getID = function changeDropeffect_getID() {
         return prettyName(aNodeOrID) + " aria-dropeffect changed";
       }
     }
 
-    function doTests()
-    {
+    function doTests() {
       // Test aria attribute mutation events
       gQueue = new eventQueue(nsIAccessibleEvent.EVENT_OBJECT_ATTRIBUTE_CHANGED);
 
       var id = "grabbable";
       gQueue.push(new changeGrabbed(id, "true"));
       gQueue.push(new changeGrabbed(id, "false"));
       todo(false, "uncomment this test when 472142 is fixed.");
       // gQueue.push(new changeGrabbed(id, "undefined"));
--- a/accessible/tests/mochitest/events/test_flush.html
+++ b/accessible/tests/mochitest/events/test_flush.html
@@ -41,18 +41,17 @@
         }
 
         this.count++;
       },
 
       count: 0
     };
 
-    function doTests()
-    {
+    function doTests() {
       registerA11yEventListener(EVENT_FOCUS, gFocusHandler);
 
       getAccessible("input1").takeFocus();
     }
 
     SimpleTest.waitForExplicitFinish();
     addA11yLoadEvent(doTests);
   </script>
--- a/accessible/tests/mochitest/events/test_focus_aria_activedescendant.html
+++ b/accessible/tests/mochitest/events/test_focus_aria_activedescendant.html
@@ -17,60 +17,53 @@ https://bugzilla.mozilla.org/show_bug.cg
   <script type="application/javascript"
           src="../states.js"></script>
   <script type="application/javascript"
           src="../events.js"></script>
 
   <script type="application/javascript">
     // gA11yEventDumpToConsole = true; // debugging
 
-    function changeARIAActiveDescendant(aID, aItemID)
-    {
+    function changeARIAActiveDescendant(aID, aItemID) {
       this.eventSeq = [
         new focusChecker(aItemID)
       ];
 
-      this.invoke = function changeARIAActiveDescendant_invoke()
-      {
+      this.invoke = function changeARIAActiveDescendant_invoke() {
         getNode(aID).setAttribute("aria-activedescendant", aItemID);
       }
 
-      this.getID = function changeARIAActiveDescendant_getID()
-      {
+      this.getID = function changeARIAActiveDescendant_getID() {
         return "change aria-activedescendant on " + aItemID;
       }
     }
 
-    function insertItemNFocus(aID, aNewItemID)
-    {
+    function insertItemNFocus(aID, aNewItemID) {
       this.eventSeq = [
         new invokerChecker(EVENT_SHOW, aNewItemID),
         new focusChecker(aNewItemID)
       ];
 
-      this.invoke = function insertItemNFocus_invoke()
-      {
+      this.invoke = function insertItemNFocus_invoke() {
         var container  = getNode(aID);
         var itemNode = document.createElement("div");
         itemNode.setAttribute("id", aNewItemID);
         itemNode.textContent = aNewItemID;
         container.appendChild(itemNode);
 
         container.setAttribute("aria-activedescendant", aNewItemID);
       }
 
-      this.getID = function insertItemNFocus_getID()
-      {
+      this.getID = function insertItemNFocus_getID() {
         return "insert new node and focus it with ID: " + aNewItemID;
       }
     }
 
     var gQueue = null;
-    function doTest()
-    {
+    function doTest() {
       gQueue = new eventQueue();
 
       gQueue.push(new synthFocus("listbox", new focusChecker("item1")));
       gQueue.push(new changeARIAActiveDescendant("listbox", "item2"));
       gQueue.push(new changeARIAActiveDescendant("listbox", "item3"));
 
       gQueue.push(new synthFocus("combobox_entry", new focusChecker("combobox_entry")));
       gQueue.push(new changeARIAActiveDescendant("combobox", "combobox_option2"));
--- a/accessible/tests/mochitest/events/test_focus_canvas.html
+++ b/accessible/tests/mochitest/events/test_focus_canvas.html
@@ -19,18 +19,17 @@
           src="../role.js"></script>
   <script type="application/javascript"
           src="../states.js"></script>
 
   <script type="application/javascript">
     // gA11yEventDumpToConsole = true;
 
     var gQueue = null;
-    function doTests()
-    {
+    function doTests() {
       gQueue = new eventQueue();
 
       gQueue.push(new synthFocus("button"));
       gQueue.push(new synthTab("button", new focusChecker("textbox")));
 
       gQueue.invoke(); // Will call SimpleTest.finish();
     }
 
--- a/accessible/tests/mochitest/events/test_focus_controls.html
+++ b/accessible/tests/mochitest/events/test_focus_controls.html
@@ -19,18 +19,17 @@
           src="../role.js"></script>
   <script type="application/javascript"
           src="../states.js"></script>
 
   <script type="application/javascript">
     // gA11yEventDumpToConsole = true;
 
     var gQueue = null;
-    function doTests()
-    {
+    function doTests() {
       gQueue = new eventQueue(EVENT_FOCUS);
 
       gQueue.push(new synthFocus("textbox"));
       gQueue.push(new synthFocus("textarea"));
       gQueue.push(new synthFocus("button1"));
       gQueue.push(new synthFocus("button2"));
       gQueue.push(new synthFocus("checkbox"));
       gQueue.push(new synthFocus("radio1"));
--- a/accessible/tests/mochitest/events/test_focus_doc.html
+++ b/accessible/tests/mochitest/events/test_focus_doc.html
@@ -21,18 +21,17 @@
       src="../states.js"></script>
 
   <script type="application/javascript">
     var gQueue = null;
 
     // var gA11yEventDumpID = "eventdump";
     // gA11yEventDumpToConsole = true;
 
-    function doTests()
-    {
+    function doTests() {
       // setup
       var frameDoc = document.getElementById("iframe").contentDocument;
       frameDoc.designMode = "on";
       var frameDocAcc = getAccessible(frameDoc, [nsIAccessibleDocument]);
       var buttonAcc = getAccessible("b1");
 
       var frame2Doc = document.getElementById("iframe2").contentDocument;
       var frame2Input = frame2Doc.getElementById("input");
--- a/accessible/tests/mochitest/events/test_focus_general.html
+++ b/accessible/tests/mochitest/events/test_focus_general.html
@@ -16,88 +16,76 @@
   <script type="application/javascript"
           src="../role.js"></script>
   <script type="application/javascript"
           src="../events.js"></script>
   <script type="application/javascript"
           src="../states.js"></script>
 
   <script type="application/javascript">
-    function focusElmWhileSubdocIsFocused(aID)
-    {
+    function focusElmWhileSubdocIsFocused(aID) {
       this.DOMNode = getNode(aID);
 
-      this.invoke = function focusElmWhileSubdocIsFocused_invoke()
-      {
+      this.invoke = function focusElmWhileSubdocIsFocused_invoke() {
         this.DOMNode.focus();
       }
 
       this.eventSeq = [
         new focusChecker(this.DOMNode)
       ];
 
       this.unexpectedEventSeq = [
         new invokerChecker(EVENT_FOCUS, this.DOMNode.ownerDocument)
       ];
 
-      this.getID = function focusElmWhileSubdocIsFocused_getID()
-      {
+      this.getID = function focusElmWhileSubdocIsFocused_getID() {
         return "Focus element while subdocument is focused " + prettyName(aID);
       }
     }
 
-    function imageMapChecker(aID)
-    {
+    function imageMapChecker(aID) {
       var node = getNode(aID);
       this.type = EVENT_FOCUS;
-      this.match = function imageMapChecker_match(aEvent)
-      {
+      this.match = function imageMapChecker_match(aEvent) {
         return aEvent.DOMNode == node;
       }
     }
 
-    function topMenuChecker()
-    {
+    function topMenuChecker() {
       this.type = EVENT_FOCUS;
-      this.match = function topMenuChecker_match(aEvent)
-      {
+      this.match = function topMenuChecker_match(aEvent) {
         return aEvent.accessible.role == ROLE_PARENT_MENUITEM;
       }
     }
 
-    function contextMenuChecker()
-    {
+    function contextMenuChecker() {
       this.type = EVENT_MENUPOPUP_START;
-      this.match = function contextMenuChecker_match(aEvent)
-      {
+      this.match = function contextMenuChecker_match(aEvent) {
         return aEvent.accessible.role == ROLE_MENUPOPUP;
       }
     }
 
-    function focusContextMenuItemChecker()
-    {
+    function focusContextMenuItemChecker() {
       this.__proto__ = new focusChecker();
 
-      this.match = function focusContextMenuItemChecker_match(aEvent)
-      {
+      this.match = function focusContextMenuItemChecker_match(aEvent) {
         return aEvent.accessible.role == ROLE_MENUITEM;
       }
     }
 
     /**
      * Do tests.
      */
 
     // gA11yEventDumpID = "eventdump"; // debug stuff
     // gA11yEventDumpToConsole = true;
 
     var gQueue = null;
 
-    function doTests()
-    {
+    function doTests() {
       var frameDoc = document.getElementById("iframe").contentDocument;
 
       var editableDoc = document.getElementById("editabledoc").contentDocument;
       editableDoc.designMode = "on";
 
       gQueue = new eventQueue();
 
       gQueue.push(new synthFocus("editablearea"));
--- a/accessible/tests/mochitest/events/test_focus_name.html
+++ b/accessible/tests/mochitest/events/test_focus_name.html
@@ -15,22 +15,20 @@
           src="../common.js"></script>
   <script type="application/javascript"
           src="../events.js"></script>
 
   <script type="application/javascript">
     /**
      * Checker for invokers.
      */
-    function actionChecker(aID, aDescription)
-    {
+    function actionChecker(aID, aDescription) {
       this.__proto__ = new invokerChecker(EVENT_FOCUS, aID);
 
-      this.check = function actionChecker_check(aEvent)
-      {
+      this.check = function actionChecker_check(aEvent) {
         var target = aEvent.accessible;
         is(target.description, aDescription,
            "Wrong description for " + prettyName(target));
       }
     }
 
     var gFocusHandler = {
       handleEvent: function gFocusHandler_handleEvent(aEvent) {
@@ -62,32 +60,30 @@
     // gA11yEventDumpToConsole = true;
 
     var gQueue = null;
 
     var gButtonElm = null;
     var gTextboxElm = null;
     var gTooltipElm = null;
 
-    function doTests()
-    {
+    function doTests() {
       gButtonElm = getNode("button");
       gTextboxElm = getNode("textbox");
       gTooltipElm = getNode("tooltip");
 
       gButtonElm.addEventListener("focus", gFocusHandler);
       gButtonElm.addEventListener("blur", gBlurHandler);
       gTextboxElm.addEventListener("focus", gFocusHandler);
       gTextboxElm.addEventListener("blur", gBlurHandler);
 
       // The aria-describedby is changed on DOM focus. Accessible description
       // should be updated when a11y focus is fired.
       gQueue = new eventQueue(nsIAccessibleEvent.EVENT_FOCUS);
-      gQueue.onFinish = function()
-      {
+      gQueue.onFinish = function() {
         gButtonElm.removeEventListener("focus", gFocusHandler);
         gButtonElm.removeEventListener("blur", gBlurHandler);
         gTextboxElm.removeEventListener("focus", gFocusHandler);
         gTextboxElm.removeEventListener("blur", gBlurHandler);
       }
 
       var descr = "It's a tooltip";
       gQueue.push(new synthFocus("button", new actionChecker("button", descr)));
--- a/accessible/tests/mochitest/events/test_focus_selects.html
+++ b/accessible/tests/mochitest/events/test_focus_selects.html
@@ -21,18 +21,17 @@
           src="../states.js"></script>
 
   <script type="application/javascript">
     // gA11yEventDumpID = "eventdump"; // debug stuff
     // gA11yEventDumpToConsole = true;
 
     var gQueue = null;
 
-    function doTests()
-    {
+    function doTests() {
       // Bug 746534 - File causes crash or hang on OS X
       if (MAC) {
         todo(false, "Bug 746534 - test file causes crash or hang on OS X");
         SimpleTest.finish();
         return;
       }
 
       gQueue = new eventQueue();
--- a/accessible/tests/mochitest/events/test_fromUserInput.html
+++ b/accessible/tests/mochitest/events/test_fromUserInput.html
@@ -16,78 +16,71 @@
   <script type="application/javascript"
           src="../events.js"></script>
 
   <script type="application/javascript">
 
     /**
      * Remove text data from HTML input.
      */
-    function removeTextFromInput(aID, aStart, aEnd, aText, aFromUser)
-    {
+    function removeTextFromInput(aID, aStart, aEnd, aText, aFromUser) {
       this.DOMNode = getNode(aID);
 
       this.eventSeq = [
         new textChangeChecker(aID, aStart, aEnd, aText, false, aFromUser)
       ];
 
-      this.invoke = function removeTextFromInput_invoke()
-      {
+      this.invoke = function removeTextFromInput_invoke() {
         this.DOMNode.focus();
         this.DOMNode.setSelectionRange(aStart, aEnd);
 
         synthesizeKey("VK_DELETE", {});
       }
 
-      this.getID = function removeTextFromInput_getID()
-      {
+      this.getID = function removeTextFromInput_getID() {
         return "Remove text from " + aStart + " to " + aEnd + " for " +
           prettyName(aID);
       }
     }
 
     /**
      * Remove text data from text node.
      */
-    function removeTextFromContentEditable(aID, aStart, aEnd, aText, aFromUser)
-    {
+    function removeTextFromContentEditable(aID, aStart, aEnd, aText, aFromUser) {
       this.DOMNode = getNode(aID);
 
       this.eventSeq = [
         new textChangeChecker(aID, aStart, aEnd, aText, false, aFromUser)
       ];
 
-      this.invoke = function removeTextFromContentEditable_invoke()
-      {
+      this.invoke = function removeTextFromContentEditable_invoke() {
         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);
 
         synthesizeKey("VK_DELETE", {});
       }
 
-      this.getID = function removeTextFromContentEditable_getID()
-      {
+      this.getID = function removeTextFromContentEditable_getID() {
         return "Remove text from " + aStart + " to " + aEnd + " for " +
           prettyName(aID);
       }
     }
 
     // //////////////////////////////////////////////////////////////////////////
     // Do tests
     // gA11yEventDumpID = "eventdump"; // debug stuff
 
     var gQueue = null;
 
-    function doTests()
-    {
+    function doTests() {
       gQueue = new eventQueue();
 
       // Focused editable text node
       gQueue.push(new removeTextFromContentEditable("div", 0, 3, "hel", true));
 
       // Focused editable HTML input
       gQueue.push(new removeTextFromInput("input", 1, 2, "n", true));
 
--- a/accessible/tests/mochitest/events/test_mutation.html
+++ b/accessible/tests/mochitest/events/test_mutation.html
@@ -36,29 +36,27 @@
 
     /**
      * Base class to test mutation a11y events.
      *
      * @param aNodeOrID          [in] node invoker's action is executed for
      * @param aEventTypes        [in] events to register (see constants above)
      * @param aDoNotExpectEvents [in] boolean indicates if events are expected
      */
-    function mutateA11yTree(aNodeOrID, aEventTypes, aDoNotExpectEvents)
-    {
+    function mutateA11yTree(aNodeOrID, aEventTypes, aDoNotExpectEvents) {
       // Interface
       this.DOMNode = getNode(aNodeOrID);
       this.doNotExpectEvents = aDoNotExpectEvents;
       this.eventSeq = [];
       this.unexpectedEventSeq = [];
 
       /**
        * Change default target (aNodeOrID) registered for the given event type.
        */
-      this.setTarget = function mutateA11yTree_setTarget(aEventType, aTarget)
-      {
+      this.setTarget = function mutateA11yTree_setTarget(aEventType, aTarget) {
         var type = this.getA11yEventType(aEventType);
         for (var idx = 0; idx < this.getEventSeq().length; idx++) {
           if (this.getEventSeq()[idx].type == type) {
             this.getEventSeq()[idx].target = aTarget;
             return idx;
           }
         }
         return -1;
@@ -74,30 +72,28 @@
         var type = this.getA11yEventType(aEventType);
         for (var i = 1; i < aTargets.length; i++) {
           var checker = new invokerChecker(type, aTargets[i]);
           this.getEventSeq().splice(++targetIdx, 0, checker);
         }
       }
 
       // Implementation
-      this.getA11yEventType = function mutateA11yTree_getA11yEventType(aEventType)
-      {
+      this.getA11yEventType = function mutateA11yTree_getA11yEventType(aEventType) {
         if (aEventType == kReorderEvent)
           return nsIAccessibleEvent.EVENT_REORDER;
 
         if (aEventType == kHideEvent)
           return nsIAccessibleEvent.EVENT_HIDE;
 
         if (aEventType == kShowEvent)
           return nsIAccessibleEvent.EVENT_SHOW;
       }
 
-      this.getEventSeq = function mutateA11yTree_getEventSeq()
-      {
+      this.getEventSeq = function mutateA11yTree_getEventSeq() {
         return this.doNotExpectEvents ? this.unexpectedEventSeq : this.eventSeq;
       }
 
       if (aEventTypes & kHideEvent) {
         var checker = new invokerChecker(this.getA11yEventType(kHideEvent),
                                          this.DOMNode);
         this.getEventSeq().push(checker);
       }
@@ -113,374 +109,330 @@
                                          this.DOMNode.parentNode);
         this.getEventSeq().push(checker);
       }
     }
 
     /**
      * Change CSS style for the given node.
      */
-    function changeStyle(aNodeOrID, aProp, aValue, aEventTypes)
-    {
+    function changeStyle(aNodeOrID, aProp, aValue, aEventTypes) {
       this.__proto__ = new mutateA11yTree(aNodeOrID, aEventTypes, false);
 
-      this.invoke = function changeStyle_invoke()
-      {
+      this.invoke = function changeStyle_invoke() {
         this.DOMNode.style[aProp] = aValue;
       }
 
-      this.getID = function changeStyle_getID()
-      {
+      this.getID = function changeStyle_getID() {
         return aNodeOrID + " change style " + aProp + " on value " + aValue;
       }
     }
 
     /**
      * Change class name for the given node.
      */
-    function changeClass(aParentNodeOrID, aNodeOrID, aClassName, aEventTypes)
-    {
+    function changeClass(aParentNodeOrID, aNodeOrID, aClassName, aEventTypes) {
       this.__proto__ = new mutateA11yTree(aNodeOrID, aEventTypes, false);
 
-      this.invoke = function changeClass_invoke()
-      {
+      this.invoke = function changeClass_invoke() {
         this.parentDOMNode.className = aClassName;
       }
 
-      this.getID = function changeClass_getID()
-      {
+      this.getID = function changeClass_getID() {
         return aNodeOrID + " change class " + aClassName;
       }
 
       this.parentDOMNode = getNode(aParentNodeOrID);
     }
 
     /**
      * Clone the node and append it to its parent.
      */
     function cloneAndAppendToDOM(aNodeOrID, aEventTypes,
-                                 aTargetsFunc, aReorderTargetFunc)
-    {
+                                 aTargetsFunc, aReorderTargetFunc) {
       var eventTypes = aEventTypes || kShowEvents;
       var doNotExpectEvents = (aEventTypes == kNoEvents);
 
       this.__proto__ = new mutateA11yTree(aNodeOrID, eventTypes,
                                           doNotExpectEvents);
 
-      this.invoke = function cloneAndAppendToDOM_invoke()
-      {
+      this.invoke = function cloneAndAppendToDOM_invoke() {
         var newElm = this.DOMNode.cloneNode(true);
         newElm.removeAttribute("id");
 
         var targets = aTargetsFunc ?
           aTargetsFunc.call(null, newElm) : [newElm];
         this.setTargets(kShowEvent, targets);
 
         if (aReorderTargetFunc) {
           var reorderTarget = aReorderTargetFunc.call(null, this.DOMNode);
           this.setTarget(kReorderEvent, reorderTarget);
         }
 
         this.DOMNode.parentNode.appendChild(newElm);
       }
 
-      this.getID = function cloneAndAppendToDOM_getID()
-      {
+      this.getID = function cloneAndAppendToDOM_getID() {
         return aNodeOrID + " clone and append to DOM.";
       }
     }
 
     /**
      * Removes the node from DOM.
      */
     function removeFromDOM(aNodeOrID, aEventTypes,
-                           aTargetsFunc, aReorderTargetFunc)
-    {
+                           aTargetsFunc, aReorderTargetFunc) {
       var eventTypes = aEventTypes || kHideEvents;
       var doNotExpectEvents = (aEventTypes == kNoEvents);
 
       this.__proto__ = new mutateA11yTree(aNodeOrID, eventTypes,
                                           doNotExpectEvents);
 
-      this.invoke = function removeFromDOM_invoke()
-      {
+      this.invoke = function removeFromDOM_invoke() {
         this.DOMNode.remove();
       }
 
-      this.getID = function removeFromDOM_getID()
-      {
+      this.getID = function removeFromDOM_getID() {
         return prettyName(aNodeOrID) + " remove from DOM.";
       }
 
       if (aTargetsFunc && (eventTypes & kHideEvent))
         this.setTargets(kHideEvent, aTargetsFunc.call(null, this.DOMNode));
 
       if (aReorderTargetFunc && (eventTypes & kReorderEvent))
         this.setTarget(kReorderEvent,
                        aReorderTargetFunc.call(null, this.DOMNode));
     }
 
     /**
      * Clone the node and replace the original node by cloned one.
      */
-    function cloneAndReplaceInDOM(aNodeOrID)
-    {
+    function cloneAndReplaceInDOM(aNodeOrID) {
       this.__proto__ = new mutateA11yTree(aNodeOrID, kHideAndShowEvents,
                                           false);
 
-      this.invoke = function cloneAndReplaceInDOM_invoke()
-      {
+      this.invoke = function cloneAndReplaceInDOM_invoke() {
         this.DOMNode.parentNode.replaceChild(this.newElm, this.DOMNode);
       }
 
-      this.getID = function cloneAndReplaceInDOM_getID()
-      {
+      this.getID = function cloneAndReplaceInDOM_getID() {
         return aNodeOrID + " clone and replace in DOM.";
       }
 
       this.newElm = this.DOMNode.cloneNode(true);
       this.newElm.removeAttribute("id");
       this.setTarget(kShowEvent, this.newElm);
     }
 
     /**
      * Trigger content insertion (flush layout), removal and insertion of
      * the same element for the same parent.
      */
-    function test1(aContainerID)
-    {
+    function test1(aContainerID) {
       this.divNode = document.createElement("div");
       this.divNode.setAttribute("id", "div-test1");
       this.containerNode = getNode(aContainerID);
 
       this.eventSeq = [
         new invokerChecker(EVENT_SHOW, this.divNode),
         new invokerChecker(EVENT_REORDER, this.containerNode)
       ];
 
-      this.invoke = function test1_invoke()
-      {
+      this.invoke = function test1_invoke() {
         this.containerNode.appendChild(this.divNode);
         getComputedStyle(this.divNode, "").color;
         this.containerNode.removeChild(this.divNode);
         this.containerNode.appendChild(this.divNode);
       }
 
-      this.getID = function test1_getID()
-      {
+      this.getID = function test1_getID() {
         return "fuzzy test #1: content insertion (flush layout), removal and" +
           "reinsertion";
       }
     }
 
     /**
      * Trigger content insertion (flush layout), removal and insertion of
      * the same element for the different parents.
      */
-    function test2(aContainerID, aTmpContainerID)
-    {
+    function test2(aContainerID, aTmpContainerID) {
       this.divNode = document.createElement("div");
       this.divNode.setAttribute("id", "div-test2");
       this.containerNode = getNode(aContainerID);
       this.tmpContainerNode = getNode(aTmpContainerID);
       this.container = getAccessible(this.containerNode);
       this.tmpContainer = getAccessible(this.tmpContainerNode);
 
       this.eventSeq = [
         new invokerChecker(EVENT_SHOW, this.divNode),
         new invokerChecker(EVENT_REORDER, this.containerNode)
       ];
 
       this.unexpectedEventSeq = [
         new invokerChecker(EVENT_REORDER, this.tmpContainerNode)
       ];
 
-      this.invoke = function test2_invoke()
-      {
+      this.invoke = function test2_invoke() {
         this.tmpContainerNode.appendChild(this.divNode);
         getComputedStyle(this.divNode, "").color;
         this.tmpContainerNode.removeChild(this.divNode);
         this.containerNode.appendChild(this.divNode);
       }
 
-      this.getID = function test2_getID()
-      {
+      this.getID = function test2_getID() {
         return "fuzzy test #2: content insertion (flush layout), removal and" +
           "reinsertion under another container";
       }
     }
 
     /**
      * Content insertion (flush layout) and then removal (nothing was changed).
      */
-    function test3(aContainerID)
-    {
+    function test3(aContainerID) {
       this.divNode = document.createElement("div");
       this.divNode.setAttribute("id", "div-test3");
       this.containerNode = getNode(aContainerID);
 
       this.unexpectedEventSeq = [
         new invokerChecker(EVENT_SHOW, this.divNode),
         new invokerChecker(EVENT_HIDE, this.divNode),
         new invokerChecker(EVENT_REORDER, this.containerNode)
       ];
 
-      this.invoke = function test3_invoke()
-      {
+      this.invoke = function test3_invoke() {
         this.containerNode.appendChild(this.divNode);
         getComputedStyle(this.divNode, "").color;
         this.containerNode.removeChild(this.divNode);
       }
 
-      this.getID = function test3_getID()
-      {
+      this.getID = function test3_getID() {
         return "fuzzy test #3: content insertion (flush layout) and removal";
       }
     }
 
-    function insertReferredElm(aContainerID)
-    {
+    function insertReferredElm(aContainerID) {
       this.containerNode = getNode(aContainerID);
 
       this.eventSeq = [
         new invokerChecker(EVENT_SHOW, function(aNode) { return aNode.firstChild; }, this.containerNode),
         new invokerChecker(EVENT_SHOW, function(aNode) { return aNode.lastChild; }, this.containerNode),
         new invokerChecker(EVENT_REORDER, this.containerNode)
       ];
 
-      this.invoke = function insertReferredElm_invoke()
-      {
+      this.invoke = function insertReferredElm_invoke() {
         this.containerNode.innerHTML =
           "<span id='insertReferredElms_span'></span><input aria-labelledby='insertReferredElms_span'>";
       }
 
-      this.getID = function insertReferredElm_getID()
-      {
+      this.getID = function insertReferredElm_getID() {
         return "insert inaccessible element and then insert referring element to make it accessible";
       }
     }
 
-    function showHiddenParentOfVisibleChild()
-    {
+    function showHiddenParentOfVisibleChild() {
       this.eventSeq = [
         new invokerChecker(EVENT_HIDE, getNode("c4_child")),
         new invokerChecker(EVENT_SHOW, getNode("c4_middle")),
         new invokerChecker(EVENT_REORDER, getNode("c4"))
       ];
 
-      this.invoke = function showHiddenParentOfVisibleChild_invoke()
-      {
+      this.invoke = function showHiddenParentOfVisibleChild_invoke() {
         getNode("c4_middle").style.visibility = "visible";
       }
 
-      this.getID = function showHiddenParentOfVisibleChild_getID()
-      {
+      this.getID = function showHiddenParentOfVisibleChild_getID() {
         return "show hidden parent of visible child";
       }
     }
 
-    function hideNDestroyDoc()
-    {
+    function hideNDestroyDoc() {
       this.txt = null;
       this.eventSeq = [
         new invokerChecker(EVENT_HIDE, () => { return this.txt; })
       ];
 
-      this.invoke = function hideNDestroyDoc_invoke()
-      {
+      this.invoke = function hideNDestroyDoc_invoke() {
         this.txt = getAccessible("c5").firstChild.firstChild;
         this.txt.DOMNode.remove();
       }
 
-      this.check = function hideNDestroyDoc_check()
-      {
+      this.check = function hideNDestroyDoc_check() {
         getNode("c5").remove();
       }
 
-      this.getID = function hideNDestroyDoc_getID()
-      {
+      this.getID = function hideNDestroyDoc_getID() {
         return "remove text node and destroy a document on hide event";
       }
     }
 
-    function hideHideNDestroyDoc()
-    {
+    function hideHideNDestroyDoc() {
       this.target = null;
       this.eventSeq = [
         new invokerChecker(EVENT_HIDE, () => { return this.target; })
       ];
 
-      this.invoke = function hideHideNDestroyDoc_invoke()
-      {
+      this.invoke = function hideHideNDestroyDoc_invoke() {
         var doc = getAccessible("c6").firstChild;
         var l1 = doc.firstChild;
         this.target = l1.firstChild;
         var l2 = doc.lastChild;
         l1.DOMNode.firstChild.remove();
         l2.DOMNode.firstChild.remove();
       }
 
-      this.check = function hideHideNDestroyDoc_check()
-      {
+      this.check = function hideHideNDestroyDoc_check() {
         getNode("c6").remove();
       }
 
-      this.getID = function hideHideNDestroyDoc_getID()
-      {
+      this.getID = function hideHideNDestroyDoc_getID() {
         return "remove text nodes (2 events in the queue) and destroy a document on first hide event";
       }
     }
 
     /**
      * Target getters.
      */
-    function getFirstChild(aNode)
-    {
+    function getFirstChild(aNode) {
       return [aNode.firstChild];
     }
-    function getLastChild(aNode)
-    {
+    function getLastChild(aNode) {
       return [aNode.lastChild];
     }
 
-    function getNEnsureFirstChild(aNode)
-    {
+    function getNEnsureFirstChild(aNode) {
       var node = aNode.firstChild;
       getAccessible(node);
       return [node];
     }
 
-    function getNEnsureChildren(aNode)
-    {
+    function getNEnsureChildren(aNode) {
       var children = [];
       var node = aNode.firstChild;
       do {
         children.push(node);
         getAccessible(node);
         node = node.nextSibling;
       } while (node);
 
       return children;
     }
 
-    function getParent(aNode)
-    {
+    function getParent(aNode) {
       return aNode.parentNode;
     }
 
     // gA11yEventDumpToConsole = true; // debug stuff
     // enableLogging("events,verbose");
 
     /**
      * Do tests.
      */
     var gQueue = null;
 
-    function doTests()
-    {
+    function doTests() {
       gQueue = new eventQueue();
 
       // Show/hide events by changing of display style of accessible DOM node
       // from 'inline' to 'none', 'none' to 'inline'.
       var id = "link1";
       getAccessible(id); // ensure accessible is created
       gQueue.push(new changeStyle(id, "display", "none", kHideEvents));
       gQueue.push(new changeStyle(id, "display", "inline", kShowEvents));
--- a/accessible/tests/mochitest/events/test_mutation.xhtml
+++ b/accessible/tests/mochitest/events/test_mutation.xhtml
@@ -25,53 +25,47 @@
           src="../events.js"></script>
 
   <script type="application/javascript">
 
     /**
      * Insert a not accessible bound element containing an accessible element
      * in anonymous content.
      */
-    function insertBinding(aContainerID)
-    {
+    function insertBinding(aContainerID) {
       this.containerNode = getNode(aContainerID);
 
-      function getButtonFromBinding(aNode)
-      {
-        try { return document.getAnonymousNodes(aNode.firstChild)[0]; }
-        catch (e) { return null; }
+      function getButtonFromBinding(aNode) {
+        try { return document.getAnonymousNodes(aNode.firstChild)[0]; } catch (e) { return null; }
       }
 
       this.eventSeq = [
         new invokerChecker(EVENT_SHOW, getButtonFromBinding, this.containerNode),
         new invokerChecker(EVENT_REORDER, this.containerNode)
       ];
 
-      this.invoke = function insertBinding_invoke()
-      {
+      this.invoke = function insertBinding_invoke() {
         var span = document.createElement("span");
         span.setAttribute("style", "-moz-binding:url(#button)");
         this.containerNode.appendChild(span);
       }
 
-      this.getID = function insertBinding_getID()
-      {
+      this.getID = function insertBinding_getID() {
         return "insert button binding";
       }
     }
 
     /**
      * Do tests.
      */
     var gQueue = null;
     // gA11yEventDumpID = "eventdump"; // debug stuff
     // gA11yEventDumpToConsole = true;
 
-    function doTests()
-    {
+    function doTests() {
       gQueue = new eventQueue();
 
       gQueue.push(new insertBinding("testContainer"));
 
       gQueue.invoke(); // Will call SimpleTest.finish();
     }
 
     SimpleTest.waitForExplicitFinish();
--- a/accessible/tests/mochitest/events/test_namechange.html
+++ b/accessible/tests/mochitest/events/test_namechange.html
@@ -19,59 +19,52 @@
           src="../role.js"></script>
   <script type="application/javascript"
           src="../states.js"></script>
 
   <script type="application/javascript">
     // //////////////////////////////////////////////////////////////////////////
     // Invokers
 
-    function setAttr(aID, aAttr, aValue, aChecker)
-    {
+    function setAttr(aID, aAttr, aValue, aChecker) {
       this.eventSeq = [ aChecker ];
-      this.invoke = function setAttr_invoke()
-      {
+      this.invoke = function setAttr_invoke() {
         getNode(aID).setAttribute(aAttr, aValue);
       }
 
-      this.getID = function setAttr_getID()
-      {
+      this.getID = function setAttr_getID() {
         return "set attr '" + aAttr + "', value '" + aValue + "'";
       }
     }
 
     /**
      * No name change on an accessible, because the accessible is recreated.
      */
-    function setAttr_recreate(aID, aAttr, aValue)
-    {
+    function setAttr_recreate(aID, aAttr, aValue) {
       this.eventSeq = [
         new invokerChecker(EVENT_HIDE, getAccessible(aID)),
         new invokerChecker(EVENT_SHOW, aID)
       ];
-      this.invoke = function setAttr_recreate_invoke()
-      {
+      this.invoke = function setAttr_recreate_invoke() {
         todo(false, "No accessible recreation should happen, just name change event");
         getNode(aID).setAttribute(aAttr, aValue);
       }
 
-      this.getID = function setAttr_recreate_getID()
-      {
+      this.getID = function setAttr_recreate_getID() {
         return "set attr '" + aAttr + "', value '" + aValue + "'";
       }
     }
 
     // //////////////////////////////////////////////////////////////////////////
     // Do tests
 
     // gA11yEventDumpToConsole = true; // debuggin
 
     var gQueue = null;
-    function doTests()
-    {
+    function doTests() {
       gQueue = new eventQueue();
 
       gQueue.push(new setAttr("tst1", "aria-label", "hi",
                               new invokerChecker(EVENT_NAME_CHANGE, "tst1")));
       gQueue.push(new setAttr("tst1", "aria-labelledby", "display",
                               new unexpectedInvokerChecker(EVENT_NAME_CHANGE, "tst1")));
       gQueue.push(new setAttr("tst1", "alt", "alt",
                               new unexpectedInvokerChecker(EVENT_NAME_CHANGE, "tst1")));
--- a/accessible/tests/mochitest/events/test_selection.html
+++ b/accessible/tests/mochitest/events/test_selection.html
@@ -25,18 +25,17 @@
     // Invokers
 
     // //////////////////////////////////////////////////////////////////////////
     // Do tests
 
     // gA11yEventDumpToConsole = true; // debuggin
 
     var gQueue = null;
-    function doTests()
-    {
+    function doTests() {
       gQueue = new eventQueue();
 
       // open combobox
       gQueue.push(new synthClick("combobox",
                                  new invokerChecker(EVENT_FOCUS, "cb1_item1")));
       gQueue.push(new synthDownKey("cb1_item1",
                                    selChangeSeq("cb1_item1", "cb1_item2")));
 
--- a/accessible/tests/mochitest/events/test_selection_aria.html
+++ b/accessible/tests/mochitest/events/test_selection_aria.html
@@ -19,48 +19,45 @@
           src="../role.js"></script>
   <script type="application/javascript"
           src="../states.js"></script>
 
   <script type="application/javascript">
     // //////////////////////////////////////////////////////////////////////////
     // Invokers
 
-    function selectItem(aSelectID, aItemID)
-    {
+    function selectItem(aSelectID, aItemID) {
       this.selectNode = getNode(aSelectID);
       this.itemNode = getNode(aItemID);
 
       this.eventSeq = [
         new invokerChecker(EVENT_SELECTION, aItemID)
       ];
 
       this.invoke = function selectItem_invoke() {
         var itemNode = this.selectNode.querySelector("*[aria-selected='true']");
         if (itemNode)
           itemNode.removeAttribute("aria-selected");
 
         this.itemNode.setAttribute("aria-selected", "true");
       }
 
-      this.getID = function selectItem_getID()
-      {
+      this.getID = function selectItem_getID() {
         return "select item " + prettyName(aItemID);
       }
     }
 
     // //////////////////////////////////////////////////////////////////////////
     // Do tests
 
     var gQueue = null;
 
     // gA11yEventDumpToConsole = true; // debug stuff
 
-    function doTests()
-    {
+    function doTests() {
       gQueue = new eventQueue();
 
       gQueue.push(new selectItem("tablist", "tab1"));
       gQueue.push(new selectItem("tablist", "tab2"));
 
       gQueue.push(new selectItem("tree", "treeitem1"));
       gQueue.push(new selectItem("tree", "treeitem1a"));
       gQueue.push(new selectItem("tree", "treeitem1a1"));
--- a/accessible/tests/mochitest/events/test_statechange.html
+++ b/accessible/tests/mochitest/events/test_statechange.html
@@ -17,18 +17,17 @@
           src="../role.js"></script>
   <script type="application/javascript"
           src="../states.js"></script>
 
   <script type="application/javascript">
     // //////////////////////////////////////////////////////////////////////////
     // Invokers
 
-    function makeEditableDoc(aDocNode, aIsEnabled)
-    {
+    function makeEditableDoc(aDocNode, aIsEnabled) {
       this.DOMNode = aDocNode;
 
       this.invoke = function editabledoc_invoke() {
         // Note: this should fire an EVENT_STATE_CHANGE
         this.DOMNode.designMode = "on";
       };
 
       this.check = function editabledoc_check(aEvent) {
@@ -49,155 +48,138 @@
         ok(event.isEnabled, "Expected editable state to be enabled");
       }
 
       this.getID = function editabledoc_getID() {
         return prettyName(aDocNode) + " editable state changed";
       };
     }
 
-    function invalidInput(aNodeOrID)
-    {
+    function invalidInput(aNodeOrID) {
       this.DOMNode = getNode(aNodeOrID);
 
       this.invoke = function invalidInput_invoke() {
         // Note: this should fire an EVENT_STATE_CHANGE
         this.DOMNode.value = "I am not an email";
       };
 
       this.check = function invalidInput_check() {
         testStates(aNodeOrID, STATE_INVALID);
       };
 
       this.getID = function invalidInput_getID() {
         return prettyName(aNodeOrID) + " became invalid";
       };
     }
 
-    function changeCheckInput(aID, aIsChecked)
-    {
+    function changeCheckInput(aID, aIsChecked) {
       this.DOMNode = getNode(aID);
 
       this.eventSeq = [
         new stateChangeChecker(STATE_CHECKED, false, aIsChecked, this.DOMNode)
       ];
 
-      this.invoke = function changeCheckInput_invoke()
-      {
+      this.invoke = function changeCheckInput_invoke() {
         this.DOMNode.checked = aIsChecked;
       }
 
-      this.getID = function changeCheckInput_getID()
-      {
+      this.getID = function changeCheckInput_getID() {
         return "change checked state to '" + aIsChecked + "' for " +
           prettyName(aID);
       }
     }
 
     function stateChangeOnFileInput(aID, aAttr, aValue,
-                                    aState, aIsExtraState, aIsEnabled)
-    {
+                                    aState, aIsExtraState, aIsEnabled) {
       this.fileControlNode = getNode(aID);
       this.fileControl = getAccessible(this.fileControlNode);
       this.browseButton = this.fileControl.firstChild;
       // No state change events on the label.
 
-      this.invoke = function stateChangeOnFileInput_invoke()
-      {
+      this.invoke = function stateChangeOnFileInput_invoke() {
         this.fileControlNode.setAttribute(aAttr, aValue);
       }
 
       this.eventSeq = [
         new stateChangeChecker(aState, aIsExtraState, aIsEnabled, this.fileControl),
         new stateChangeChecker(aState, aIsExtraState, aIsEnabled, this.browseButton)
       ];
 
-      this.getID = function stateChangeOnFileInput_getID()
-      {
+      this.getID = function stateChangeOnFileInput_getID() {
         return "inherited state change on file input on attribute '" + aAttr + "' change";
       }
     }
 
     function dupeStateChange(aID, aAttr, aValue,
-                             aState, aIsExtraState, aIsEnabled)
-    {
+                             aState, aIsExtraState, aIsEnabled) {
       this.eventSeq = [
         new stateChangeChecker(aState, aIsExtraState, aIsEnabled, getNode(aID))
       ];
 
-      this.invoke = function dupeStateChange_invoke()
-      {
+      this.invoke = function dupeStateChange_invoke() {
         getNode(aID).setAttribute(aAttr, aValue);
         getNode(aID).setAttribute(aAttr, aValue);
       }
 
-      this.getID = function dupeStateChange_getID()
-      {
+      this.getID = function dupeStateChange_getID() {
         return "duped state change events";
       }
     }
 
-    function oppositeStateChange(aID, aAttr, aState, aIsExtraState)
-    {
+    function oppositeStateChange(aID, aAttr, aState, aIsExtraState) {
       this.eventSeq = [ ];
       this.unexpectedEventSeq = [
         new stateChangeChecker(aState, aIsExtraState, false, getNode(aID)),
         new stateChangeChecker(aState, aIsExtraState, true, getNode(aID))
       ];
 
-      this.invoke = function oppositeStateChange_invoke()
-      {
+      this.invoke = function oppositeStateChange_invoke() {
         getNode(aID).setAttribute(aAttr, "false");
         getNode(aID).setAttribute(aAttr, "true");
       }
 
-      this.getID = function oppositeStateChange_getID()
-      {
+      this.getID = function oppositeStateChange_getID() {
         return "opposite state change events";
       }
     }
 
     /**
      * Change concomitant ARIA and native attribute at once.
      */
     function echoingStateChange(aID, aARIAAttr, aAttr, aValue,
-                               aState, aIsExtraState, aIsEnabled)
-    {
+                               aState, aIsExtraState, aIsEnabled) {
       this.eventSeq = [
         new stateChangeChecker(aState, aIsExtraState, aIsEnabled, getNode(aID))
       ];
 
-      this.invoke = function echoingStateChange_invoke()
-      {
+      this.invoke = function echoingStateChange_invoke() {
         if (aValue == null) {
           getNode(aID).removeAttribute(aARIAAttr);
           getNode(aID).removeAttribute(aAttr);
 
         } else {
           getNode(aID).setAttribute(aARIAAttr, aValue);
           getNode(aID).setAttribute(aAttr, aValue);
         }
       }
 
-      this.getID = function echoingStateChange_getID()
-      {
+      this.getID = function echoingStateChange_getID() {
         return "enchoing ARIA and native attributes change";
       }
     }
 
     // //////////////////////////////////////////////////////////////////////////
     // Do tests
 
     var gQueue = null;
 
     // var gA11yEventDumpID = "eventdump"; // debug stuff
     // gA11yEventDumpToConsole = true; // debug stuff
 
-    function doTests()
-    {
+    function doTests() {
       gQueue = new eventQueue(nsIAccessibleEvent.EVENT_STATE_CHANGE);
 
       // Test delayed editable state change
       var doc = document.getElementById("iframe").contentDocument;
       gQueue.push(new makeEditableDoc(doc));
 
       // invalid state change
       gQueue.push(new invalidInput("email"));
--- a/accessible/tests/mochitest/events/test_text.html
+++ b/accessible/tests/mochitest/events/test_text.html
@@ -18,62 +18,55 @@
 
   <script type="application/javascript">
     // //////////////////////////////////////////////////////////////////////////
     // Invokers
 
     /**
      * Base text remove invoker and checker.
      */
-    function textRemoveInvoker(aID, aStart, aEnd, aText)
-    {
+    function textRemoveInvoker(aID, aStart, aEnd, aText) {
       this.DOMNode = getNode(aID);
 
       this.eventSeq = [
         new textChangeChecker(aID, aStart, aEnd, aText, false)
       ];
     }
 
-    function textInsertInvoker(aID, aStart, aEnd, aText)
-    {
+    function textInsertInvoker(aID, aStart, aEnd, aText) {
       this.DOMNode = getNode(aID);
 
       this.eventSeq = [
         new textChangeChecker(aID, aStart, aEnd, aText, true)
       ];
     }
 
     /**
      * Remove inaccessible child node containing accessibles.
      */
-    function removeChildSpan(aID)
-    {
+    function removeChildSpan(aID) {
       this.__proto__ = new textRemoveInvoker(aID, 0, 5, "33322");
 
-      this.invoke = function removeChildSpan_invoke()
-      {
+      this.invoke = function removeChildSpan_invoke() {
         // remove HTML span, a first child of the node
         this.DOMNode.firstChild.remove();
       }
 
-      this.getID = function removeChildSpan_getID()
-      {
+      this.getID = function removeChildSpan_getID() {
         return "Remove inaccessible span containing accessible nodes" + prettyName(aID);
       }
     }
 
     /**
      * Insert inaccessible child node containing accessibles.
      */
-    function insertChildSpan(aID, aInsertAllTogether)
-    {
+    function insertChildSpan(aID, aInsertAllTogether) {
       this.__proto__ = new textInsertInvoker(aID, 0, 5, "33322");
 
-      this.invoke = function insertChildSpan_invoke()
-      {
+      this.invoke = function insertChildSpan_invoke() {
         // <span><span>333</span><span>22</span></span>
         if (aInsertAllTogether) {
           var topSpan = document.createElement("span");
           var fSpan = document.createElement("span");
           fSpan.textContent = "333";
           topSpan.appendChild(fSpan);
           var sSpan = document.createElement("span");
           sSpan.textContent = "22";
@@ -90,177 +83,157 @@
           topSpan.appendChild(fSpan);
 
           var sSpan = document.createElement("span");
           sSpan.textContent = "22";
           topSpan.appendChild(sSpan);
         }
       }
 
-      this.getID = function insertChildSpan_getID()
-      {
+      this.getID = function insertChildSpan_getID() {
        return "Insert inaccessible span containing accessibles" +
           prettyName(aID);
       }
     }
 
     /**
      * Remove child embedded accessible.
      */
-    function removeChildDiv(aID)
-    {
+    function removeChildDiv(aID) {
       this.__proto__ = new textRemoveInvoker(aID, 5, 6, kEmbedChar);
 
-      this.invoke = function removeChildDiv_invoke()
-      {
+      this.invoke = function removeChildDiv_invoke() {
         var childDiv = this.DOMNode.childNodes[1];
 
         // Ensure accessible is created to get text remove event when it's
         // removed.
         getAccessible(childDiv);
 
         this.DOMNode.removeChild(childDiv);
       }
 
-      this.getID = function removeChildDiv_getID()
-      {
+      this.getID = function removeChildDiv_getID() {
         return "Remove accessible div from the middle of text accessible " +
           prettyName(aID);
       }
     }
 
     /**
      * Insert child embedded accessible.
      */
-    function insertChildDiv(aID)
-    {
+    function insertChildDiv(aID) {
       this.__proto__ = new textInsertInvoker(aID, 5, 6, kEmbedChar);
 
-      this.invoke = function insertChildDiv_invoke()
-      {
+      this.invoke = function insertChildDiv_invoke() {
         var childDiv = document.createElement("div");
         this.DOMNode.insertBefore(childDiv, this.DOMNode.childNodes[1]);
       }
 
-      this.getID = function insertChildDiv_getID()
-      {
+      this.getID = function insertChildDiv_getID() {
         return "Insert accessible div into the middle of text accessible " +
           prettyName(aID);
       }
     }
 
     /**
      * Remove children from text container from first to last child or vice
      * versa.
      */
-    function removeChildren(aID, aLastToFirst, aStart, aEnd, aText)
-    {
+    function removeChildren(aID, aLastToFirst, aStart, aEnd, aText) {
       this.__proto__ = new textRemoveInvoker(aID, aStart, aEnd, aText);
 
-      this.invoke = function removeChildren_invoke()
-      {
+      this.invoke = function removeChildren_invoke() {
         if (aLastToFirst) {
           while (this.DOMNode.firstChild)
             this.DOMNode.removeChild(this.DOMNode.lastChild);
         } else {
           while (this.DOMNode.firstChild)
             this.DOMNode.firstChild.remove();
         }
       }
 
-      this.getID = function removeChildren_getID()
-      {
+      this.getID = function removeChildren_getID() {
         return "remove children of " + prettyName(aID) +
           (aLastToFirst ? " from last to first" : " from first to last");
       }
     }
 
     /**
      * Remove text from HTML input.
      */
-    function removeTextFromInput(aID, aStart, aEnd, aText)
-    {
+    function removeTextFromInput(aID, aStart, aEnd, aText) {
       this.__proto__ = new textRemoveInvoker(aID, aStart, aEnd, aText);
 
       this.eventSeq.push(new invokerChecker(EVENT_TEXT_VALUE_CHANGE,
                                             this.DOMNode));
 
-      this.invoke = function removeTextFromInput_invoke()
-      {
+      this.invoke = function removeTextFromInput_invoke() {
         this.DOMNode.focus();
         this.DOMNode.setSelectionRange(aStart, aEnd);
 
         synthesizeKey("VK_DELETE", {});
       }
 
-      this.getID = function removeTextFromInput_getID()
-      {
+      this.getID = function removeTextFromInput_getID() {
         return "Remove text from " + aStart + " to " + aEnd + " for " +
           prettyName(aID);
       }
     }
 
     /**
      * Add text into HTML input.
      */
-    function insertTextIntoInput(aID, aStart, aEnd, aText)
-    {
+    function insertTextIntoInput(aID, aStart, aEnd, aText) {
       this.__proto__ = new textInsertInvoker(aID, aStart, aEnd, aText);
 
       this.eventSeq.push(new invokerChecker(EVENT_TEXT_VALUE_CHANGE,
                                             this.DOMNode));
 
-      this.invoke = function insertTextIntoInput_invoke()
-      {
+      this.invoke = function insertTextIntoInput_invoke() {
         this.DOMNode.focus();
         synthesizeKey("a", {});
       }
 
-      this.getID = function insertTextIntoInput_getID()
-      {
+      this.getID = function insertTextIntoInput_getID() {
         return "Insert text to " + aStart + " for " + prettyName(aID);
       }
     }
 
     /**
      * Remove text data from text node of editable area.
      */
-    function removeTextFromEditable(aID, aStart, aEnd, aText, aTextNode)
-    {
+    function removeTextFromEditable(aID, aStart, aEnd, aText, aTextNode) {
       this.__proto__ = new textRemoveInvoker(aID, aStart, aEnd, aText);
 
-      this.invoke = function removeTextFromEditable_invoke()
-      {
+      this.invoke = function removeTextFromEditable_invoke() {
         this.DOMNode.focus();
 
         var selection = window.getSelection();
         var range = document.createRange();
         range.setStart(this.textNode, aStart);
         range.setEnd(this.textNode, aEnd);
         selection.addRange(range);
 
         synthesizeKey("VK_DELETE", {});
       }
 
-      this.getID = function removeTextFromEditable_getID()
-      {
+      this.getID = function removeTextFromEditable_getID() {
         return "Remove text from " + aStart + " to " + aEnd + " for " +
           prettyName(aID);
       }
 
       this.textNode = getNode(aTextNode);
     }
 
     // //////////////////////////////////////////////////////////////////////////
     // Do tests
     gA11yEventDumpToConsole = true; // debugging
 
     var gQueue = null;
-    function doTests()
-    {
+    function doTests() {
       gQueue = new eventQueue();
 
       // Text remove event on inaccessible child HTML span removal containing
       // accessible text nodes.
       gQueue.push(new removeChildSpan("p"));
       gQueue.push(new insertChildSpan("p"), true);
       gQueue.push(new insertChildSpan("p"), false);
 
--- a/accessible/tests/mochitest/events/test_text_alg.html
+++ b/accessible/tests/mochitest/events/test_text_alg.html
@@ -19,18 +19,17 @@
   <script type="application/javascript">
     // //////////////////////////////////////////////////////////////////////////
     // Invokers
 
     const kRemoval = false;
     const kInsertion = true;
     const kUnexpected = true;
 
-    function changeText(aContainerID, aValue, aEventList)
-    {
+    function changeText(aContainerID, aValue, aEventList) {
       this.containerNode = getNode(aContainerID);
       this.textNode = this.containerNode.firstChild;
       this.textData = this.textNode.data;
 
       this.eventSeq = [ ];
       this.unexpectedEventSeq = [ ];
 
       for (var i = 0; i < aEventList.length; i++) {
@@ -44,45 +43,41 @@
                                             isInserted);
 
         if (event[3] == kUnexpected)
           this.unexpectedEventSeq.push(checker);
         else
           this.eventSeq.push(checker);
       }
 
-      this.invoke = function changeText_invoke()
-      {
+      this.invoke = function changeText_invoke() {
         this.textNode.data = aValue;
       }
 
-      this.getID = function changeText_getID()
-      {
+      this.getID = function changeText_getID() {
         return "change text '" + shortenString(this.textData) + "' -> '" +
           shortenString(this.textNode.data) + "' for " +
           prettyName(this.containerNode);
       }
     }
 
-    function expStr(x, doublings)
-    {
+    function expStr(x, doublings) {
       for (var i = 0; i < doublings; ++i)
         x = x + x;
       return x;
     }
 
     // //////////////////////////////////////////////////////////////////////////
     // Do tests
 
     // gA11yEventDumpID = "eventdump"; // debug stuff
     // gA11yEventDumpToConsole = true;
 
     var gQueue = null;
-    function doTests()
-    {
+    function doTests() {
       gQueue = new eventQueue();
 
       // ////////////////////////////////////////////////////////////////////////
       // wqrema -> tqb: substitution coalesced with removal
 
       var events = [
         [ kRemoval, "w", 0 ], // wqrema -> qrema
         [ kInsertion, "t", 0], // qrema -> tqrema
--- a/accessible/tests/mochitest/events/test_textattrchange.html
+++ b/accessible/tests/mochitest/events/test_textattrchange.html
@@ -24,69 +24,64 @@
 
   <script type="application/javascript">
 
     const nsIDOMNSEditableElement =
       Components.interfaces.nsIDOMNSEditableElement;
 
     Components.utils.import("resource://gre/modules/InlineSpellChecker.jsm");
 
-    function spelledTextInvoker(aID)
-    {
+    function spelledTextInvoker(aID) {
       this.DOMNode = getNode(aID);
 
       this.eventSeq = [
         new invokerChecker(EVENT_TEXT_ATTRIBUTE_CHANGED, this.DOMNode)
       ];
 
-      this.invoke = function spelledTextInvoker_invoke()
-      {
+      this.invoke = function spelledTextInvoker_invoke() {
         var editor = this.DOMNode.QueryInterface(nsIDOMNSEditableElement).editor;
         var spellChecker = new InlineSpellChecker(editor);
         spellChecker.enabled = true;
 
         // var spellchecker = editor.getInlineSpellChecker(true);
         // spellchecker.enableRealTimeSpell = true;
 
         this.DOMNode.value = "valid text inalid tixt";
       }
 
-      this.finalCheck = function spelledTextInvoker_finalCheck()
-      {
+      this.finalCheck = function spelledTextInvoker_finalCheck() {
         var defAttrs = buildDefaultTextAttrs(this.DOMNode, kInputFontSize,
                                              kNormalFontWeight,
                                              kInputFontFamily);
         testDefaultTextAttrs(aID, defAttrs);
 
         var attrs = { };
         var misspelledAttrs = {
           "invalid": "spelling"
         };
 
         testTextAttrs(aID, 0, attrs, defAttrs, 0, 11);
         testTextAttrs(aID, 11, misspelledAttrs, defAttrs, 11, 17);
         testTextAttrs(aID, 17, attrs, defAttrs, 17, 18);
         testTextAttrs(aID, 18, misspelledAttrs, defAttrs, 18, 22);
       }
 
-      this.getID = function spelledTextInvoker_getID()
-      {
+      this.getID = function spelledTextInvoker_getID() {
         return "text attribute change for misspelled text";
       }
     }
 
     /**
      * Do tests.
      */
     // gA11yEventDumpID = "eventdump"; // debug stuff
     // gA11yEventDumpToConsole = true;
 
     var gQueue = null;
-    function doTests()
-    {
+    function doTests() {
       // Synth focus before spellchecking turning on to make sure editor
       // gets a time for initialization.
 
       gQueue = new eventQueue();
       gQueue.push(new synthFocus("input"));
       gQueue.push(new spelledTextInvoker("input"));
       gQueue.invoke(); // Will call SimpleTest.finish();
     }
--- a/accessible/tests/mochitest/events/test_textselchange.html
+++ b/accessible/tests/mochitest/events/test_textselchange.html
@@ -19,26 +19,24 @@
           src="../events.js"></script>
 
   <script type="application/javascript">
     var gQueue = null;
 
     // gA11yEventDumpID = "eventdump"; // debug stuff
     // gA11yEventDumpToConsole = true;
 
-    function getOnclickSeq(aID)
-    {
+    function getOnclickSeq(aID) {
       return [
         new caretMoveChecker(0, aID),
         new unexpectedInvokerChecker(EVENT_TEXT_SELECTION_CHANGED, aID)
       ];
     }
 
-    function doTests()
-    {
+    function doTests() {
       // test caret move events and caret offsets
       gQueue = new eventQueue();
 
       gQueue.push(new synthClick("c1_p1", getOnclickSeq("c1_p1")));
       gQueue.push(new synthDownKey("c1", new textSelectionChecker("c1", 0, 1), { shiftKey: true }));
       gQueue.push(new synthDownKey("c1", new textSelectionChecker("c1", 0, 2), { shiftKey: true }));
 
       gQueue.push(new synthClick("ta1", getOnclickSeq("ta1")));
--- a/accessible/tests/mochitest/events/test_valuechange.html
+++ b/accessible/tests/mochitest/events/test_valuechange.html
@@ -21,18 +21,17 @@
 
   <script type="application/javascript">
     /**
      * Do tests.
      */
     var gQueue = null;
 
     // Value change invoker
-    function changeARIAValue(aNodeOrID, aValuenow, aValuetext)
-    {
+    function changeARIAValue(aNodeOrID, aValuenow, aValuetext) {
       this.DOMNode = getNode(aNodeOrID);
       this.eventSeq = [ new invokerChecker(aValuetext ?
                                            EVENT_TEXT_VALUE_CHANGE :
                                            EVENT_VALUE_CHANGE, this.DOMNode)
         ];
 
       this.invoke = function changeARIAValue_invoke() {
 
@@ -57,110 +56,93 @@
             "Wrong value of " + prettyName(aNodeOrID));
       }
 
       this.getID = function changeARIAValue_getID() {
         return prettyName(aNodeOrID) + " value changed";
       }
     }
 
-    function changeValue(aID, aValue)
-    {
+    function changeValue(aID, aValue) {
       this.DOMNode = getNode(aID);
       this.eventSeq = [new invokerChecker(EVENT_TEXT_VALUE_CHANGE,
                                           this.DOMNode)
         ];
 
-      this.invoke = function changeValue_invoke()
-      {
+      this.invoke = function changeValue_invoke() {
         this.DOMNode.value = aValue;
       }
 
-      this.check = function changeValue_check()
-      {
+      this.check = function changeValue_check() {
         var acc = getAccessible(this.DOMNode);
         is(acc.value, aValue, "Wrong value for " + prettyName(aID));
       }
 
-      this.getID = function changeValue_getID()
-      {
+      this.getID = function changeValue_getID() {
         return prettyName(aID) + " value changed";
       }
     }
 
-    function changeProgressValue(aID, aValue)
-    {
+    function changeProgressValue(aID, aValue) {
       this.DOMNode = getNode(aID);
       this.eventSeq = [new invokerChecker(EVENT_VALUE_CHANGE, this.DOMNode)];
 
-      this.invoke = function changeProgressValue_invoke()
-      {
+      this.invoke = function changeProgressValue_invoke() {
          this.DOMNode.value = aValue;
       }
 
-      this.check = function changeProgressValue_check()
-      {
+      this.check = function changeProgressValue_check() {
         var acc = getAccessible(this.DOMNode);
         is(acc.value, aValue + "%", "Wrong value for " + prettyName(aID));
       }
 
-      this.getID = function changeProgressValue_getID()
-      {
+      this.getID = function changeProgressValue_getID() {
         return prettyName(aID) + " value changed";
       }
     }
 
-    function changeRangeValue(aID)
-    {
+    function changeRangeValue(aID) {
       this.DOMNode = getNode(aID);
       this.eventSeq = [new invokerChecker(EVENT_VALUE_CHANGE, this.DOMNode)];
 
-      this.invoke = function changeRangeValue_invoke()
-      {
+      this.invoke = function changeRangeValue_invoke() {
         synthesizeMouse(getNode(aID), 5, 5, { });
       }
 
-      this.finalCheck = function changeRangeValue_finalCheck()
-      {
+      this.finalCheck = function changeRangeValue_finalCheck() {
         var acc = getAccessible(this.DOMNode);
         is(acc.value, "0", "Wrong value for " + prettyName(aID));
       }
 
-      this.getID = function changeRangeValue_getID()
-      {
+      this.getID = function changeRangeValue_getID() {
         return prettyName(aID) + " range value changed";
       }
     }
 
-    function changeSelectValue(aID, aKey, aValue)
-    {
+    function changeSelectValue(aID, aKey, aValue) {
       this.eventSeq =
         [ new invokerChecker(EVENT_TEXT_VALUE_CHANGE, getAccessible(aID)) ];
 
-      this.invoke = function changeSelectValue_invoke()
-      {
+      this.invoke = function changeSelectValue_invoke() {
         getNode(aID).focus();
         synthesizeKey(aKey, {}, window);
       }
 
-      this.finalCheck = function changeSelectValue_finalCheck()
-      {
+      this.finalCheck = function changeSelectValue_finalCheck() {
         is(getAccessible(aID).value, aValue, "Wrong value for " + prettyName(aID));
       }
 
-      this.getID = function changeSelectValue_getID()
-      {
+      this.getID = function changeSelectValue_getID() {
         return `${prettyName(aID)} closed select value change on '${aKey}'' key press`;
       }
     }
 
     // enableLogging("DOMEvents");
     // gA11yEventDumpToConsole = true;
-    function doTests()
-    {
+    function doTests() {
       // Test initial values
       testValue("slider_vn", "5", 5, 0, 1000, 0);
       testValue("slider_vnvt", "plain", 0, 0, 5, 0);
       testValue("slider_vt", "hi", 0, 0, 3, 0);
       testValue("scrollbar", "5", 5, 0, 1000, 0);
       testValue("splitter", "5", 5, 0, 1000, 0);
       testValue("progress", "22%", 22, 0, 100, 0);
       testValue("range", "6", 6, 0, 10, 1);
--- a/accessible/tests/mochitest/focus/test_focusedChild.html
+++ b/accessible/tests/mochitest/focus/test_focusedChild.html
@@ -14,54 +14,48 @@
   <script type="application/javascript"
           src="../role.js"></script>
   <script type="application/javascript"
           src="../states.js"></script>
   <script type="application/javascript"
           src="../events.js"></script>
 
   <script type="application/javascript">
-    function openWnd()
-    {
+    function openWnd() {
       this.eventSeq = [ new invokerChecker(EVENT_FOCUS,
                                            getDialogAccessible,
                                            this) ];
 
-      this.invoke = function openWnd_invoke()
-      {
+      this.invoke = function openWnd_invoke() {
         this.dialog = window.openDialog("about:mozilla",
                                         "AboutMozilla",
                                         "chrome,width=600,height=600");
       }
 
-      this.finalCheck = function openWnd_finalCheck()
-      {
+      this.finalCheck = function openWnd_finalCheck() {
         var app = getApplicationAccessible();
         is(app.focusedChild, getDialogAccessible(this),
            "Wrong focused child");
 
         this.dialog.close();
       }
 
-      this.getID = function openWnd_getID()
-      {
+      this.getID = function openWnd_getID() {
         return "focusedChild for application accessible";
       }
 
-      function getDialogAccessible(aInvoker)
-      {
+      function getDialogAccessible(aInvoker) {
         return getAccessible(aInvoker.dialog.document);
       }
     }
 
     gA11yEventDumpToConsole = true;
     var gQueue = null;
 
-    function doTest()
-    {
+    function doTest() {
       enableLogging("focus,doclifecycle");
       gQueue = new eventQueue();
 
       gQueue.push(new openWnd());
 
       gQueue.onFinish = function() { disableLogging(); }
       gQueue.invoke(); // Will call SimpleTest.finish();
     }
--- a/accessible/tests/mochitest/focus/test_takeFocus.html
+++ b/accessible/tests/mochitest/focus/test_takeFocus.html
@@ -17,41 +17,37 @@
           src="../states.js"></script>
   <script type="application/javascript"
           src="../events.js"></script>
 
   <script type="application/javascript">
     // //////////////////////////////////////////////////////////////////////////
     // Invokers
 
-    function takeFocusInvoker(aID)
-    {
+    function takeFocusInvoker(aID) {
       this.accessible = getAccessible(aID);
 
       this.eventSeq = [ new focusChecker(this.accessible) ];
 
-      this.invoke = function takeFocusInvoker_invoke()
-      {
+      this.invoke = function takeFocusInvoker_invoke() {
         this.accessible.takeFocus();
       }
 
-      this.getID = function takeFocusInvoker_getID()
-      {
+      this.getID = function takeFocusInvoker_getID() {
         return "takeFocus for " + prettyName(aID);
       }
     }
 
     // //////////////////////////////////////////////////////////////////////////
     // Test
 
     // gA11yEventDumpToConsole = true; // debug stuff
 
     var gQueue = null;
-    function doTest()
-    {
+    function doTest() {
       disableLogging(); // from test_focusedChild
       gQueue = new eventQueue();
 
       gQueue.push(new takeFocusInvoker("aria-link"));
       gQueue.push(new takeFocusInvoker("aria-link2"));
       gQueue.push(new takeFocusInvoker("link"));
       gQueue.push(new takeFocusInvoker("item2"));
       gQueue.push(new takeFocusInvoker("plugin"));
@@ -60,18 +56,17 @@
       gQueue.push(new takeFocusInvoker(document));
       gQueue.push(new takeFocusInvoker("lb_item3.2"));
       gQueue.push(new takeFocusInvoker(document));
       gQueue.push(new takeFocusInvoker("lb_item3.1"));
 
       gQueue.invoke(); // Will call SimpleTest.finish();
     }
 
-    function waitForPlugin()
-    {
+    function waitForPlugin() {
       window.setTimeout((isAccessible("plugin") ? doTest : waitForPlugin), 0);
     }
 
     SimpleTest.waitForExplicitFinish();
     setTestPluginEnabledState(SpecialPowers.Ci.nsIPluginTag.STATE_ENABLED);
     addA11yLoadEvent(waitForPlugin);
   </script>
 </head>
--- a/accessible/tests/mochitest/grid.js
+++ b/accessible/tests/mochitest/grid.js
@@ -1,87 +1,76 @@
 const nsIDOMKeyEvent = Components.interfaces.nsIDOMKeyEvent;
 
 /**
  * Create grid object based on HTML table.
  */
-function grid(aTableIdentifier)
-{
-  this.getRowCount = function getRowCount()
-  {
+function grid(aTableIdentifier) {
+  this.getRowCount = function getRowCount() {
     return this.table.rows.length - (this.table.tHead ? 1 : 0);
   }
-  this.getColsCount = function getColsCount()
-  {
+  this.getColsCount = function getColsCount() {
     return this.table.rows[0].cells.length;
   }
 
-  this.getRowAtIndex = function getRowAtIndex(aIndex)
-  {
+  this.getRowAtIndex = function getRowAtIndex(aIndex) {
     return this.table.rows[this.table.tHead ? aIndex + 1 : aIndex];
   }
 
-  this.getMaxIndex = function getMaxIndex()
-  {
+  this.getMaxIndex = function getMaxIndex() {
     return this.getRowCount() * this.getColsCount() - 1;
   }
 
-  this.getCellAtIndex = function getCellAtIndex(aIndex)
-  {
+  this.getCellAtIndex = function getCellAtIndex(aIndex) {
     var colsCount = this.getColsCount();
 
     var rowIdx = Math.floor(aIndex / colsCount);
     var colIdx = aIndex % colsCount;
 
     var row = this.getRowAtIndex(rowIdx);
     return row.cells[colIdx];
   }
 
-  this.getIndexByCell = function getIndexByCell(aCell)
-  {
+  this.getIndexByCell = function getIndexByCell(aCell) {
     var colIdx = aCell.cellIndex;
 
     var rowIdx = aCell.parentNode.rowIndex;
     if (this.table.tHead)
       rowIdx -= 1;
 
     var colsCount = this.getColsCount();
     return rowIdx * colsCount + colIdx;
   }
 
-  this.getCurrentCell = function getCurrentCell()
-  {
+  this.getCurrentCell = function getCurrentCell() {
     var rowCount = this.table.rows.length;
     var colsCount = this.getColsCount();
     for (var rowIdx = 0; rowIdx < rowCount; rowIdx++) {
       for (var colIdx = 0; colIdx < colsCount; colIdx++) {
         var cell = this.table.rows[rowIdx].cells[colIdx];
         if (cell.hasAttribute("tabindex"))
           return cell;
       }
     }
     return null;
   }
 
-  this.initGrid = function initGrid()
-  {
+  this.initGrid = function initGrid() {
     this.table.addEventListener("keypress", this);
     this.table.addEventListener("click", this);
   }
 
-  this.handleEvent = function handleEvent(aEvent)
-  {
+  this.handleEvent = function handleEvent(aEvent) {
     if (aEvent instanceof nsIDOMKeyEvent)
       this.handleKeyEvent(aEvent);
     else
       this.handleClickEvent(aEvent);
   }
 
-  this.handleKeyEvent = function handleKeyEvent(aEvent)
-  {
+  this.handleKeyEvent = function handleKeyEvent(aEvent) {
     if (aEvent.target.localName != "td")
       return;
 
     var cell = aEvent.target;
     switch (aEvent.keyCode) {
       case nsIDOMKeyEvent.DOM_VK_UP:
         var colsCount = this.getColsCount();
         var idx = this.getIndexByCell(cell);
@@ -123,18 +112,17 @@ function grid(aTableIdentifier)
           var nextcell = this.getCellAtIndex(idx + 1);
           nextcell.setAttribute("tabindex", "0");
           nextcell.focus();
         }
         break;
     }
   }
 
-  this.handleClickEvent = function handleClickEvent(aEvent)
-  {
+  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");
--- a/accessible/tests/mochitest/hittest/test_browser.html
+++ b/accessible/tests/mochitest/hittest/test_browser.html
@@ -8,18 +8,17 @@
           src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
 
   <script type="application/javascript"
           src="../common.js"></script>
   <script type="application/javascript"
           src="../layout.js"></script>
 
   <script type="application/javascript">
-    function doTest()
-    {
+    function doTest() {
       // Hit testing. See bug #726097
       getNode("hittest").scrollIntoView(true);
 
       var hititem = getAccessible("hititem");
       var hittest = getAccessible("hittest");
 
       var [hitX, hitY, hitWidth, hitHeight] = getBounds(hititem);
       var tgtX = hitX + hitWidth / 2;
--- a/accessible/tests/mochitest/hittest/test_canvas_hitregion.html
+++ b/accessible/tests/mochitest/hittest/test_canvas_hitregion.html
@@ -8,18 +8,17 @@
           src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
 
   <script type="application/javascript"
           src="../common.js"></script>
   <script type="application/javascript"
           src="../layout.js"></script>
 
   <script type="application/javascript">
-    function redrawCheckbox(context, element, x, y)
-    {
+    function redrawCheckbox(context, element, x, y) {
       context.save();
       context.font = "10px sans-serif";
       context.textAlign = "left";
       context.textBaseline = "middle";
       var metrics = context.measureText(element.parentNode.textContent);
       context.beginPath();
       context.strokeStyle = "black";
       context.rect(x - 5, y - 5, 10, 10);
@@ -34,18 +33,17 @@
       context.rect(x - 7, y - 7, 12 + metrics.width + 2, 14);
 
       if (document.activeElement == element)
         context.drawFocusIfNeeded(element);
       context.addHitRegion({control: element});
       context.restore();
     }
 
-    function doTest()
-    {
+    function doTest() {
       var offsetX = 20, offsetY = 40;
       getNode("hitcanvas").scrollIntoView(true);
 
       var context = document.getElementById("hitcanvas").getContext("2d");
       redrawCheckbox(context, document.getElementById("hitcheck"),
                      offsetX, offsetY);
 
       var hitcanvas = getAccessible("hitcanvas");
--- a/accessible/tests/mochitest/hittest/test_general.html
+++ b/accessible/tests/mochitest/hittest/test_general.html
@@ -12,23 +12,21 @@
   <script type="application/javascript"
           src="../common.js"></script>
   <script type="application/javascript"
           src="../layout.js"></script>
   <script type="application/javascript"
           src="../events.js"></script>
 
   <script type="application/javascript">
-    function doPreTest()
-    {
+    function doPreTest() {
       waitForImageMap("imgmap", doTest);
     }
 
-    function doTest()
-    {
+    function doTest() {
       // Not specific case, child and deepchild testing.
       var list = getAccessible("list");
       var listitem = getAccessible("listitem");
       var image = getAccessible("image");
 if (!MAC) {
       testChildAtPoint(list, 1, 1, listitem, image.firstChild);
 } else {
       todo(false, "Bug 746974 - children must match on all platforms, disable failing test on Mac");
--- a/accessible/tests/mochitest/hittest/test_shadowroot.html
+++ b/accessible/tests/mochitest/hittest/test_shadowroot.html
@@ -9,18 +9,17 @@
           src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
 
   <script type="application/javascript"
           src="../common.js"></script>
   <script type="application/javascript"
           src="../layout.js"></script>
 
   <script type="application/javascript">
-    function doTest()
-    {
+    function doTest() {
       var componentAcc = getAccessible("component1");
       testChildAtPoint(componentAcc, 1, 1, componentAcc.firstChild,
                        componentAcc.firstChild);
 
       componentAcc = getAccessible("component2");
       testChildAtPoint(componentAcc, 1, 1, componentAcc.firstChild,
                        componentAcc.firstChild);
       SimpleTest.finish();
--- a/accessible/tests/mochitest/hittest/test_zoom.html
+++ b/accessible/tests/mochitest/hittest/test_zoom.html
@@ -13,18 +13,17 @@
   <script type="application/javascript"
           src="../role.js"></script>
   <script type="application/javascript"
           src="../layout.js"></script>
   <script type="application/javascript"
           src="../browser.js"></script>
 
   <script type="application/javascript">
-    function doTest()
-    {
+    function doTest() {
 if (!MAC) {
       var tabDocument = currentTabDocument();
       var p1 = tabDocument.body.firstElementChild;
       var p2 = tabDocument.body.lastElementChild;
 
       hitTest(tabDocument, p1, p1.firstChild);
       hitTest(tabDocument, p2, p2.firstChild);
 
--- a/accessible/tests/mochitest/hittest/test_zoom_text.html
+++ b/accessible/tests/mochitest/hittest/test_zoom_text.html
@@ -11,18 +11,17 @@
   <script type="application/javascript"
           src="../common.js"></script>
   <script type="application/javascript"
           src="../role.js"></script>
   <script type="application/javascript"
           src="../layout.js"></script>
 
   <script type="application/javascript">
-    function doTest()
-    {
+    function doTest() {
       var hyperText = getNode("paragraph");
       var textNode = hyperText.firstChild;
       var [x, y, width, height] = getBounds(textNode);
       testOffsetAtPoint(hyperText, x + width / 2, y + height / 2,
                         COORDTYPE_SCREEN_RELATIVE,
                         hyperText.textContent.length / 2);
 
       zoomDocument(document, 2.0);
--- a/accessible/tests/mochitest/hyperlink/hyperlink.js
+++ b/accessible/tests/mochitest/hyperlink/hyperlink.js
@@ -1,42 +1,38 @@
 /**
  * Focus hyperlink invoker.
  *
  * @param aID             [in] hyperlink identifier
  * @param aSelectedAfter  [in] specifies if hyperlink is selected/focused after
  *                          the focus
  */
-function focusLink(aID, aSelectedAfter)
-{
+function focusLink(aID, aSelectedAfter) {
   this.node = getNode(aID);
   this.accessible = getAccessible(this.node);
 
   this.eventSeq = [];
   this.unexpectedEventSeq = [];
 
   var checker = new invokerChecker(EVENT_FOCUS, this.accessible);
   if (aSelectedAfter)
     this.eventSeq.push(checker);
   else
     this.unexpectedEventSeq.push(checker);
 
-  this.invoke = function focusLink_invoke()
-  {
+  this.invoke = function focusLink_invoke() {
     var expectedStates = (aSelectedAfter ? STATE_FOCUSABLE : 0);
     var unexpectedStates = (!aSelectedAfter ? STATE_FOCUSABLE : 0) | STATE_FOCUSED;
     testStates(aID, expectedStates, 0, unexpectedStates, 0);
 
     this.node.focus();
   }
 
-  this.finalCheck = function focusLink_finalCheck()
-  {
+  this.finalCheck = function focusLink_finalCheck() {
     var expectedStates = (aSelectedAfter ? STATE_FOCUSABLE | STATE_FOCUSED : 0);
     var unexpectedStates = (!aSelectedAfter ? STATE_FOCUSABLE | STATE_FOCUSED : 0);
     testStates(aID, expectedStates, 0, unexpectedStates, 0);
   }
 
-  this.getID = function focusLink_getID()
-  {
+  this.getID = function focusLink_getID() {
     return "focus hyperlink " + prettyName(aID);
   }
 }
--- a/accessible/tests/mochitest/hyperlink/test_general.html
+++ b/accessible/tests/mochitest/hyperlink/test_general.html
@@ -21,56 +21,52 @@ https://bugzilla.mozilla.org/show_bug.cg
   <script type="application/javascript"
           src="../events.js"></script>
 
   <script type="application/javascript"
           src="hyperlink.js"></script>
 
   <script type="application/javascript">
     function testThis(aID, aAcc, aRole, aAnchors, aName, aValid, aStartIndex,
-                      aEndIndex)
-    {
+                      aEndIndex) {
       testRole(aAcc, aRole);
       is(aAcc.anchorCount, aAnchors, "Wrong number of anchors for ID "
                                       + aID + "!");
       is(aAcc.getAnchor(0).name, aName, "Wrong name for ID "
                                         + aID + "!");
       is(aAcc.valid, aValid, "No correct valid state for ID "
                              + aID + "!");
       is(aAcc.startIndex, aStartIndex, "Wrong startIndex value for ID "
                                        + aID + "!");
       is(aAcc.endIndex, aEndIndex, "Wrong endIndex value for ID "
                                    + aID + "!");
     }
 
-    function testAction(aId, aAcc, aActionName)
-    {
+    function testAction(aId, aAcc, aActionName) {
       var actionCount = aActionName ? 1 : 0;
       is(aAcc.actionCount, actionCount,
          "Wrong actions number for ID " + aId);
       try {
         is(aAcc.getActionName(0), aActionName,
            "Wrong action name for ID " + aId);
       } catch (e) {
         if (actionCount)
           ok(false, "Exception on action name getting for ID " + aId);
         else
           ok(true, "Correct action name for ID " + aId);
       }
     }
 
     // gA11yEventDumpToConsole = true; // debug stuff
-    function doPreTest()
-    {
+    function doPreTest() {
       waitForImageMap("imgmap", doTest);
     }
 
     var gQueue = null;
-    function doTest()
-    {
+    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/",
          "URI wrong for normalHyperlinkElement!");
--- a/accessible/tests/mochitest/hypertext/test_general.html
+++ b/accessible/tests/mochitest/hypertext/test_general.html
@@ -15,45 +15,41 @@ https://bugzilla.mozilla.org/show_bug.cg
   <script type="application/javascript"
           src="../common.js"></script>
   <script type="application/javascript"
           src="../events.js"></script>
 
   <script type="application/javascript">
     var gParagraphAcc;
 
-    function testLinkIndexAtOffset(aID, aOffset, aIndex)
-    {
+    function testLinkIndexAtOffset(aID, aOffset, aIndex) {
       var htAcc = getAccessible(aID, [nsIAccessibleHyperText]);
       is(htAcc.getLinkIndexAtOffset(aOffset), aIndex,
          "Wrong link index at offset " + aOffset + " for ID " + aID + "!");
     }
 
-    function testThis(aID, aCharIndex, aExpectedLinkIndex, aName)
-    {
+    function testThis(aID, aCharIndex, aExpectedLinkIndex, aName) {
       testLinkIndexAtOffset(gParagraphAcc, aCharIndex, aExpectedLinkIndex);
 
       var linkAcc = gParagraphAcc.getLinkAt(aExpectedLinkIndex);
       ok(linkAcc, "No accessible for link " + aID + "!");
 
       var linkIndex = gParagraphAcc.getLinkIndex(linkAcc);
       is(linkIndex, aExpectedLinkIndex, "Wrong link index for " + aID + "!");
 
       // Just test the link's name to make sure we get the right one.
       is(linkAcc.getAnchor(0).name, aName, "Wrong name for " + aID + "!");
     }
 
     // gA11yEventDumpToConsole = true;
-    function doPreTest()
-    {
+    function doPreTest() {
       waitForImageMap("imgmap", doTest);
     }
 
-    function doTest()
-    {
+    function doTest() {
       // Test link count
       gParagraphAcc = getAccessible("testParagraph", [nsIAccessibleHyperText]);
       is(gParagraphAcc.linkCount, 7, "Wrong link count for paragraph!");
 
       // normal hyperlink
       testThis("NormalHyperlink", 14, 0, "Mozilla Foundation");
 
       // ARIA hyperlink
--- a/accessible/tests/mochitest/hypertext/test_update.html
+++ b/accessible/tests/mochitest/hypertext/test_update.html
@@ -10,188 +10,167 @@
 
   <script type="application/javascript"
           src="../common.js"></script>
   <script type="application/javascript"
           src="../events.js"></script>
 
   <script type="application/javascript">
     const kLinksCount = 128;
-    function addLinks(aContainerID)
-    {
+    function addLinks(aContainerID) {
       this.containerNode = getNode(aContainerID);
 
       this.eventSeq = [
         new invokerChecker(EVENT_REORDER, this.containerNode)
       ];
 
-      this.invoke = function addLinks_invoke()
-      {
+      this.invoke = function addLinks_invoke() {
         for (var jdx = 0; jdx < kLinksCount; jdx++) {
           var a = document.createElement("a");
           a.setAttribute("href", "mozilla.org");
           a.textContent = "mozilla";
           this.containerNode.appendChild(a);
 
           var span = document.createElement("span");
           span.textContent = " text ";
           this.containerNode.appendChild(span);
         }
       }
 
-      this.finalCheck = function addLinks_finalCheck()
-      {
+      this.finalCheck = function addLinks_finalCheck() {
         // getLinkAt and getLinkIndex.
         var htAcc = getAccessible(this.containerNode, [nsIAccessibleHyperText]);
         for (var jdx = 0; jdx < kLinksCount; jdx++) {
           var link = htAcc.getLinkAt(jdx);
           ok(link, "No link at index " + jdx + " for '" + aContainerID + "'");
 
           var linkIdx = htAcc.getLinkIndex(link);
           is(linkIdx, jdx, "Wrong link index for '" + aContainerID + "'!");
         }
       }
 
-      this.getID = function addLinks_getID()
-      {
+      this.getID = function addLinks_getID() {
         return "Add links for '" + aContainerID + "'";
       }
     }
 
-    function updateText(aContainerID)
-    {
+    function updateText(aContainerID) {
       this.containerNode = getNode(aContainerID);
       this.container = getAccessible(this.containerNode, nsIAccessibleHyperText);
       this.text = this.container.firstChild;
       this.textNode = this.text.DOMNode;
       this.textLen = this.textNode.data.length;
 
       this.eventSeq = [
         new invokerChecker(EVENT_TEXT_INSERTED, this.containerNode)
       ];
 
-      this.invoke = function updateText_invoke()
-      {
+      this.invoke = function updateText_invoke() {
         is(this.container.getLinkIndexAtOffset(this.textLen), 0,
            "Wrong intial text offsets!");
 
         this.text.DOMNode.appendData(" my");
       }
 
-      this.finalCheck = function updateText_finalCheck()
-      {
+      this.finalCheck = function updateText_finalCheck() {
         is(this.container.getLinkIndexAtOffset(this.textLen), -1,
            "Text offsets weren't updated!");
       }
 
-      this.getID = function updateText_getID()
-      {
+      this.getID = function updateText_getID() {
         return "update text for '" + aContainerID + "'";
       }
     }
 
     /**
      * Text offsets must be updated when hypertext child is removed.
      */
-    function removeChild(aContainerID, aChildID, aInitialText, aFinalText)
-    {
+    function removeChild(aContainerID, aChildID, aInitialText, aFinalText) {
       this.containerNode = getNode(aContainerID);
       this.container = getAccessible(this.containerNode, nsIAccessibleText);
       this.childNode = getNode(aChildID);
 
       // Call first to getText so offsets are cached
       is(this.container.getText(0, -1), aInitialText,
          "Wrong text before child removal");
 
       this.eventSeq = [
         new invokerChecker(EVENT_REORDER, this.containerNode)
       ];
 
-      this.invoke = function removeChild_invoke()
-      {
+      this.invoke = function removeChild_invoke() {
         this.containerNode.removeChild(this.childNode);
       }
 
-      this.finalCheck = function removeChild_finalCheck()
-      {
+      this.finalCheck = function removeChild_finalCheck() {
         is(this.container.getText(0, -1), aFinalText,
            "Wrong text after child removal");
         is(this.container.characterCount, aFinalText.length,
            "Wrong text after child removal");
       }
 
-      this.getID = function removeChild_getID()
-      {
+      this.getID = function removeChild_getID() {
         return "check text after removing child from '" + aContainerID + "'";
       }
     }
 
-    function removeFirstChild(aContainer)
-    {
+    function removeFirstChild(aContainer) {
       this.ht = getAccessible(aContainer, [ nsIAccessibleHyperText ]);
       this.eventSeq = [
         new invokerChecker(EVENT_REORDER, aContainer)
       ];
 
-      this.invoke = function removeFirstChild_invoke()
-      {
+      this.invoke = function removeFirstChild_invoke() {
         is(this.ht.linkCount, 2, "Wrong embedded objects count before removal");
 
         getNode(aContainer).removeChild(getNode(aContainer).firstElementChild);
       }
 
-      this.finalCheck = function removeFirstChild_finalCheck()
-      {
+      this.finalCheck = function removeFirstChild_finalCheck() {
         // check list index before link count
         is(this.ht.getLinkIndex(this.ht.firstChild), 0, "Wrong child index");
         is(this.ht.linkCount, 1, "Wrong embedded objects count after removal");
       }
 
-      this.getID = function removeFirstChild_getID()
-      {
+      this.getID = function removeFirstChild_getID() {
         return "Remove first child and check embedded object indeces";
       }
     }
 
-    function removeLastChild(aContainer)
-    {
+    function removeLastChild(aContainer) {
       this.ht = getAccessible(aContainer, [ nsIAccessibleHyperText ]);
       this.eventSeq = [
         new invokerChecker(EVENT_REORDER, aContainer)
       ];
 
-      this.invoke = function removeLastChild_invoke()
-      {
+      this.invoke = function removeLastChild_invoke() {
         is(this.ht.linkCount, 1, "Wrong embedded objects count before removal");
 
         getNode(aContainer).removeChild(getNode(aContainer).lastElementChild);
       }
 
-      this.finalCheck = function removeLastChild_finalCheck()
-      {
+      this.finalCheck = function removeLastChild_finalCheck() {
         is(this.ht.linkCount, 0, "Wrong embedded objects count after removal");
 
         var link = null;
         try {
           link = this.ht.getLinkAt(0);
         } catch (e) { }
         ok(!link, "No embedded object is expected");
       }
 
-      this.getID = function removeLastChild_getID()
-      {
+      this.getID = function removeLastChild_getID() {
         return "Remove last child and try its embedded object";
       }
     }
 
     // gA11yEventDumpToConsole = true; // debug stuff
 
     var gQueue = null;
-    function doTest()
-    {
+    function doTest() {
       gQueue = new eventQueue();
       gQueue.push(new addLinks("p1"));
       gQueue.push(new updateText("p2"));
       gQueue.push(new removeChild("div1","div2",
                                   "hello my good friend", "hello friend"));
       gQueue.push(new removeFirstChild("c4"));
       gQueue.push(new removeLastChild("c5"));
 
--- a/accessible/tests/mochitest/jsat/test_content_integration.html
+++ b/accessible/tests/mochitest/jsat/test_content_integration.html
@@ -320,17 +320,18 @@
                 // TODO: remove this as part of bug 820712
                 ["network.disable.ipc.security", true],
 
 
                 ["dom.ipc.browser_frames.oop_by_default", true],
                 ["dom.mozBrowserFramesEnabled", true],
                 ["browser.pagethumbnails.capturing_disabled", true]
               ]
-            }, doTest) },
+            }, doTest)
+          },
           getRootDirectory(window.location.href) + "doc_content_integration.html");
         });
   </script>
 </head>
 <body id="body">
 
   <a target="_blank"
      title="Add tests for OOP message handling and general integration"
--- a/accessible/tests/mochitest/jsat/test_traversal.html
+++ b/accessible/tests/mochitest/jsat/test_traversal.html
@@ -20,25 +20,23 @@
   <script type="application/javascript" src="../pivot.js"></script>
   <script type="application/javascript" src="../layout.js"></script>
 
   <script type="application/javascript">
     Components.utils.import("resource://gre/modules/accessibility/Traversal.jsm");
     var gBrowserWnd = null;
     var gQueue = null;
 
-    function doTest()
-    {
+    function doTest() {
       var doc = currentTabDocument();
       var docAcc = getAccessible(doc, [nsIAccessibleDocument]);
 
       gQueue = new eventQueue();
 
-      gQueue.onFinish = function onFinish()
-      {
+      gQueue.onFinish = function onFinish() {
         closeBrowserWindow();
       }
 
       queueTraversalSequence(gQueue, docAcc, TraversalRules.Heading, null,
                              ["heading-1", "heading-2", "heading-3", "heading-5"]);
 
       queueTraversalSequence(gQueue, docAcc, TraversalRules.Entry, null,
                              ["input-1-1", "label-1-2", "input-1-3",
--- a/accessible/tests/mochitest/jsat/test_traversal_helper.html
+++ b/accessible/tests/mochitest/jsat/test_traversal_helper.html
@@ -66,18 +66,17 @@
 
       ok(TraversalHelper.move(vc, "moveLast", aRule), "moveLast");
 
       accessibleIs(vc.position, aExpectedSequence[aExpectedSequence.length - 1],
         "moveLast to correct accessible");
     }
 
 
-    function doTest()
-    {
+    function doTest() {
       var doc = currentTabDocument();
       var docAcc = getAccessible(doc, [nsIAccessibleDocument]);
       vc = docAcc.virtualCursor;
 
       testTraversalHelper("Landmark",
         ["heading-1", "heading-2", "statusbar-1"]);
 
       testTraversalHelper("List",
--- a/accessible/tests/mochitest/layout.js
+++ b/accessible/tests/mochitest/layout.js
@@ -3,18 +3,17 @@
  * expected.
  *
  * @param aID            [in] accessible identifier
  * @param aX             [in] x coordinate of the point relative accessible
  * @param aY             [in] y coordinate of the point relative accessible
  * @param aChildID       [in] expected child accessible
  * @param aGrandChildID  [in] expected child accessible
  */
-function testChildAtPoint(aID, aX, aY, aChildID, aGrandChildID)
-{
+function testChildAtPoint(aID, aX, aY, aChildID, aGrandChildID) {
   var child = getChildAtPoint(aID, aX, aY, false);
   var expectedChild = getAccessible(aChildID);
 
   var msg = "Wrong direct child accessible at the point (" + aX + ", " + aY +
     ") of " + prettyName(aID);
   isObject(child, expectedChild, msg);
 
   var grandChild = getChildAtPoint(aID, aX, aY, true);
@@ -24,18 +23,17 @@ function testChildAtPoint(aID, aX, aY, a
     ") of " + prettyName(aID);
   isObject(grandChild, expectedGrandChild, msg);
 }
 
 /**
  * Test if getChildAtPoint returns the given child and grand child accessibles
  * at coordinates of child accessible (direct and deep hit test).
  */
-function hitTest(aContainerID, aChildID, aGrandChildID)
-{
+function hitTest(aContainerID, aChildID, aGrandChildID) {
   var container = getAccessible(aContainerID);
   var child = getAccessible(aChildID);
   var grandChild = getAccessible(a