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(aGrandChildID);
 
   var [x, y] = getBoundsForDOMElm(child);
 
   var actualChild = container.getChildAtPoint(x + 1, y + 1);
   isObject(actualChild, child,
@@ -44,30 +42,28 @@ function hitTest(aContainerID, aChildID,
   var actualGrandChild = container.getDeepestChildAtPoint(x + 1, y + 1);
   isObject(actualGrandChild, grandChild,
            "Wrong deepest child of " + prettyName(aContainerID));
 }
 
 /**
  * Test if getOffsetAtPoint returns the given text offset at given coordinates.
  */
-function testOffsetAtPoint(aHyperTextID, aX, aY, aCoordType, aExpectedOffset)
-{
+function testOffsetAtPoint(aHyperTextID, aX, aY, aCoordType, aExpectedOffset) {
   var hyperText = getAccessible(aHyperTextID, [nsIAccessibleText]);
   var offset = hyperText.getOffsetAtPoint(aX, aY, aCoordType);
   is(offset, aExpectedOffset,
      "Wrong offset at given point (" + aX + ", " + aY + ") for " +
      prettyName(aHyperTextID));
 }
 
 /**
  * Zoom the given document.
  */
-function zoomDocument(aDocument, aZoom)
-{
+function zoomDocument(aDocument, aZoom) {
   var docShell = aDocument.defaultView.
     QueryInterface(Components.interfaces.nsIInterfaceRequestor).
     getInterface(Components.interfaces.nsIWebNavigation).
     QueryInterface(Components.interfaces.nsIDocShell);
   var docViewer = docShell.contentViewer;
 
   docViewer.fullZoom = aZoom;
 }
@@ -77,18 +73,17 @@ function zoomDocument(aDocument, aZoom)
  *
  * @param aIdentifier        [in] accessible identifier
  * @param aX                 [in] x coordinate of the point relative accessible
  * @param aY                 [in] y coordinate of the point relative accessible
  * @param aFindDeepestChild  [in] points whether deepest or nearest child should
  *                           be returned
  * @return                   the child accessible at the given point
  */
-function getChildAtPoint(aIdentifier, aX, aY, aFindDeepestChild)
-{
+function getChildAtPoint(aIdentifier, aX, aY, aFindDeepestChild) {
   var acc = getAccessible(aIdentifier);
   if (!acc)
     return;
 
   var [screenX, screenY] = getBoundsForDOMElm(acc.DOMNode);
 
   var x = screenX + aX;
   var y = screenY + aY;
@@ -100,64 +95,60 @@ function getChildAtPoint(aIdentifier, aX
   } catch (e) { }
 
   return null;
 }
 
 /**
  * Test the accessible position.
  */
-function testPos(aID, aPoint)
-{
+function testPos(aID, aPoint) {
   var [expectedX, expectedY] =
     (aPoint != undefined) ? aPoint : getBoundsForDOMElm(aID);
 
   var [x, y] = getBounds(aID);
   is(x, expectedX, "Wrong x coordinate of " + prettyName(aID));
   is(y, expectedY, "Wrong y coordinate of " + prettyName(aID));
 }
 
 /**
  * Test the accessible boundaries.
  */
-function testBounds(aID, aRect)
-{
+function testBounds(aID, aRect) {
   var [expectedX, expectedY, expectedWidth, expectedHeight] =
     (aRect != undefined) ? aRect : getBoundsForDOMElm(aID);
 
   var [x, y, width, height] = getBounds(aID);
   is(x, expectedX, "Wrong x coordinate of " + prettyName(aID));
   is(y, expectedY, "Wrong y coordinate of " + prettyName(aID));
   is(width, expectedWidth, "Wrong width of " + prettyName(aID));
   is(height, expectedHeight, "Wrong height of " + prettyName(aID));
 }
 
 /**
  * Test text position at the given offset.
  */
-function testTextPos(aID, aOffset, aPoint, aCoordOrigin)
-{
+function testTextPos(aID, aOffset, aPoint, aCoordOrigin) {
   var [expectedX, expectedY] = aPoint;
 
   var xObj = {}, yObj = {};
   var hyperText = getAccessible(aID, [nsIAccessibleText]);
   hyperText.getCharacterExtents(aOffset, xObj, yObj, {}, {}, aCoordOrigin);
   is(xObj.value, expectedX,
      "Wrong x coordinate at offset " + aOffset + " for " + prettyName(aID));
   ok(yObj.value - expectedY < 2 && expectedY - yObj.value < 2,
      "Wrong y coordinate at offset " + aOffset + " for " + prettyName(aID) +
      " - got " + yObj.value + ", expected " + expectedY +
      "The difference doesn't exceed 1.");
 }
 
 /**
  * Test text bounds that is enclosed betwene the given offsets.
  */
-function testTextBounds(aID, aStartOffset, aEndOffset, aRect, aCoordOrigin)
-{
+function testTextBounds(aID, aStartOffset, aEndOffset, aRect, aCoordOrigin) {
   var [expectedX, expectedY, expectedWidth, expectedHeight] = aRect;
 
   var xObj = {}, yObj = {}, widthObj = {}, heightObj = {};
   var hyperText = getAccessible(aID, [nsIAccessibleText]);
   hyperText.getRangeExtents(aStartOffset, aEndOffset,
                             xObj, yObj, widthObj, heightObj, aCoordOrigin);
   is(xObj.value, expectedX,
      "Wrong x coordinate of text between offsets (" + aStartOffset + ", " +
@@ -176,42 +167,39 @@ function testTextBounds(aID, aStartOffse
   is(heightObj.value, expectedHeight,
      "Wrong height of text between offsets (" + aStartOffset + ", " +
      aEndOffset + ") for " + prettyName(aID));
 }
 
 /**
  * Return the accessible coordinates relative to the screen in device pixels.
  */
-function getPos(aID)
-{
+function getPos(aID) {
   var accessible = getAccessible(aID);
   var x = {}, y = {};
   accessible.getBounds(x, y, {}, {});
   return [x.value, y.value];
 }
 
 /**
  * Return the accessible coordinates and size relative to the screen in device
  * pixels.
  */
-function getBounds(aID)
-{
+function getBounds(aID) {
   var accessible = getAccessible(aID);
   var x = {}, y = {}, width = {}, height = {};
   accessible.getBounds(x, y, width, height);
   return [x.value, y.value, width.value, height.value];
 }
 
 /**
  * Return DOM node coordinates relative the screen and its size in device
  * pixels.
  */
-function getBoundsForDOMElm(aID)
-{
+function getBoundsForDOMElm(aID) {
   var x = 0, y = 0, width = 0, height = 0;
 
   var elm = getNode(aID);
   if (elm.localName == "area") {
     var mapName = elm.parentNode.getAttribute("name");
     var selector = "[usemap='#" + mapName + "']";
     var img = elm.ownerDocument.querySelector(selector);
 
@@ -221,35 +209,33 @@ function getBoundsForDOMElm(aID)
     var areaWidth = parseInt(areaCoords[2]) - areaX;
     var areaHeight = parseInt(areaCoords[3]) - areaY;
 
     var rect = img.getBoundingClientRect();
     x = rect.left + areaX;
     y = rect.top + areaY;
     width = areaWidth;
     height = areaHeight;
-  }
-  else {
+  } else {
     var rect = elm.getBoundingClientRect();
     x = rect.left;
     y = rect.top;
     width = rect.width;
     height = rect.height;
   }
 
   var elmWindow = elm.ownerGlobal;
   return CSSToDevicePixels(elmWindow,
                            x + elmWindow.mozInnerScreenX,
                            y + elmWindow.mozInnerScreenY,
                            width,
                            height);
 }
 
-function CSSToDevicePixels(aWindow, aX, aY, aWidth, aHeight)
-{
+function CSSToDevicePixels(aWindow, aX, aY, aWidth, aHeight) {
   var winUtil = aWindow.
     QueryInterface(Components.interfaces.nsIInterfaceRequestor).
     getInterface(Components.interfaces.nsIDOMWindowUtils);
 
   var ratio = winUtil.screenPixelsPerCSSPixel;
 
   // CSS pixels and ratio can be not integer. Device pixels are always integer.
   // Do our best and hope it works.
--- a/accessible/tests/mochitest/name.js
+++ b/accessible/tests/mochitest/name.js
@@ -1,13 +1,12 @@
 /**
  * Test accessible name for the given accessible identifier.
  */
-function testName(aAccOrElmOrID, aName, aMsg, aTodo)
-{
+function testName(aAccOrElmOrID, aName, aMsg, aTodo) {
   var msg = aMsg ? aMsg : "";
 
   var acc = getAccessible(aAccOrElmOrID);
   if (!acc)
     return;
 
   var func = aTodo ? todo_is : is;
   var txtID = prettyName(aAccOrElmOrID);
@@ -17,17 +16,16 @@ function testName(aAccOrElmOrID, aName, 
     ok(false, msg + "Can't get name of the accessible for " + txtID);
   }
   return acc;
 }
 
 /**
  * Test accessible description for the given accessible.
  */
-function testDescr(aAccOrElmOrID, aDescr)
-{
+function testDescr(aAccOrElmOrID, aDescr) {
   var acc = getAccessible(aAccOrElmOrID);
   if (!acc)
    return;
 
   is(acc.description, aDescr,
      "Wrong description for " + prettyName(aAccOrElmOrID));
 }
--- a/accessible/tests/mochitest/name/markup.js
+++ b/accessible/tests/mochitest/name/markup.js
@@ -7,18 +7,17 @@ var gRuleDoc = null;
 
 // Debuggin stuff.
 var gDumpToConsole = false;
 
 /**
  * Start name tests. Run through markup elements and test names for test
  * element (see namerules.xml for details).
  */
-function testNames()
-{
+function testNames() {
   // enableLogging("tree,stack"); // debugging
 
   var request = new XMLHttpRequest();
   request.open("get", gNameRulesFileURL, false);
   request.send();
 
   gRuleDoc = request.responseXML;
 
@@ -29,38 +28,35 @@ function testNames()
 // //////////////////////////////////////////////////////////////////////////////
 // Private section.
 
 /**
  * Helper class to interate through name tests.
  */
 var gTestIterator =
 {
-  iterateMarkups: function gTestIterator_iterateMarkups(aMarkupElms)
-  {
+  iterateMarkups: function gTestIterator_iterateMarkups(aMarkupElms) {
     this.markupElms = aMarkupElms;
 
     this.iterateNext();
   },
 
   iterateRules: function gTestIterator_iterateRules(aElm, aContainer,
                                                     aRuleSetElm, aRuleElms,
-                                                    aTestID)
-  {
+                                                    aTestID) {
     this.ruleSetElm = aRuleSetElm;
     this.ruleElms = aRuleElms;
     this.elm = aElm;
     this.container = aContainer;
     this.testID = aTestID;
 
     this.iterateNext();
   },
 
-  iterateNext: function gTestIterator_iterateNext()
-  {
+  iterateNext: function gTestIterator_iterateNext() {
     if (this.markupIdx == -1) {
       this.markupIdx++;
       testNamesForMarkup(this.markupElms[this.markupIdx]);
       return;
     }
 
     this.ruleIdx++;
     if (this.ruleIdx == this.ruleElms.length) {
@@ -103,18 +99,17 @@ var gTestIterator =
   container: null,
   testID: ""
 };
 
 /**
  * Process every 'markup' element and test names for it. Used by testNames
  * function.
  */
-function testNamesForMarkup(aMarkupElm)
-{
+function testNamesForMarkup(aMarkupElm) {
   if (gDumpToConsole)
     dump("\nProcessing markup '" + aMarkupElm.getAttribute("id") + "'\n");
 
   var div = document.createElement("div");
   div.setAttribute("id", "test");
 
   var child = aMarkupElm.firstChild;
   while (child) {
@@ -128,18 +123,17 @@ function testNamesForMarkup(aMarkupElm)
          prettyName(document) + "'\n");
   }
   waitForEvent(EVENT_REORDER, document, testNamesForMarkupRules,
                 null, aMarkupElm, div);
 
   document.body.appendChild(div);
 }
 
-function testNamesForMarkupRules(aMarkupElm, aContainer)
-{
+function testNamesForMarkupRules(aMarkupElm, aContainer) {
   var testID = aMarkupElm.getAttribute("id");
   if (gDumpToConsole)
     dump("\nProcessing markup rules '" + testID + "'\n");
 
   var expr = "//html/body/div[@id='test']/" + aMarkupElm.getAttribute("ref");
   var elm = evaluateXPath(document, expr, htmlDocResolver)[0];
 
   var ruleId = aMarkupElm.getAttribute("ruleset");
@@ -159,18 +153,17 @@ function testNamesForMarkupRules(aMarkup
   else
     waitForEvent(EVENT_SHOW, elm, processMarkupRules);
 }
 
 /**
  * Test name for current rule and current 'markup' element. Used by
  * testNamesForMarkup function.
  */
-function testNameForRule(aElm, aRuleElm)
-{
+function testNameForRule(aElm, aRuleElm) {
   if (aRuleElm.hasAttribute("attr")) {
     if (gDumpToConsole) {
       dump("\nProcessing rule { attr: " + aRuleElm.getAttribute("attr") + " }\n");
     }
 
     testNameForAttrRule(aElm, aRuleElm);
 
   } else if (aRuleElm.hasAttribute("elm")) {
@@ -186,18 +179,17 @@ function testNameForRule(aElm, aRuleElm)
       dump("\nProcessing rule { fromsubtree: " +
            aRuleElm.getAttribute("fromsubtree") + " }\n");
     }
 
     testNameForSubtreeRule(aElm, aRuleElm);
   }
 }
 
-function testNameForAttrRule(aElm, aRule)
-{
+function testNameForAttrRule(aElm, aRule) {
   var name = "";
 
   var attr = aRule.getAttribute("attr");
   var attrValue = aElm.getAttribute(attr);
 
   var type = aRule.getAttribute("type");
   if (type == "string") {
     name = attrValue;
@@ -240,26 +232,24 @@ function testNameForAttrRule(aElm, aRule
     aElm.removeAttribute(attr);
 
   } else {
     aElm.removeAttribute(attr);
     gTestIterator.iterateNext();
   }
 }
 
-function testNameForElmRule(aElm, aRule)
-{
+function testNameForElmRule(aElm, aRule) {
   var labelElm;
 
   var tagname = aRule.getAttribute("elm");
   var attrname = aRule.getAttribute("elmattr");
   if (attrname) {
     var filter = {
-      acceptNode: function filter_acceptNode(aNode)
-      {
+      acceptNode: function filter_acceptNode(aNode) {
         if (aNode.localName == this.mLocalName &&
             aNode.getAttribute(this.mAttrName) == this.mAttrValue)
           return NodeFilter.FILTER_ACCEPT;
 
         return NodeFilter.FILTER_SKIP;
       },
 
       mLocalName: tagname,
@@ -296,18 +286,17 @@ function testNameForElmRule(aElm, aRule)
          prettyName(parentNode) + "\n");
   }
   waitForEvent(EVENT_REORDER, parentNode,
                gTestIterator.iterateNext, gTestIterator);
 
   parentNode.removeChild(labelElm);
 }
 
-function testNameForSubtreeRule(aElm, aRule)
-{
+function testNameForSubtreeRule(aElm, aRule) {
   var msg = "From subtree test (" + gTestIterator.testID + ").";
   testName(aElm, aElm.getAttribute("textequiv"), msg);
   testAbsentAttrs(aElm, {"explicit-name": "true"});
 
   if (gDumpToConsole) {
     dump("\nProcessed from subtree rule. Wait for reorder event on " +
          prettyName(aElm) + "\n");
   }
@@ -316,25 +305,23 @@ function testNameForSubtreeRule(aElm, aR
   while (aElm.firstChild)
     aElm.firstChild.remove();
 }
 
 /**
  * Return array of 'rule' elements. Used in conjunction with
  * getRuleElmsFromRulesetElm() function.
  */
-function getRuleElmsByRulesetId(aRulesetId)
-{
+function getRuleElmsByRulesetId(aRulesetId) {
   var expr = "//rules/ruledfn/ruleset[@id='" + aRulesetId + "']";
   var rulesetElm = evaluateXPath(gRuleDoc, expr);
   return getRuleElmsFromRulesetElm(rulesetElm[0]);
 }
 
-function getRuleElmsFromRulesetElm(aRulesetElm)
-{
+function getRuleElmsFromRulesetElm(aRulesetElm) {
   var rulesetId = aRulesetElm.getAttribute("ref");
   if (rulesetId)
     return getRuleElmsByRulesetId(rulesetId);
 
   var ruleElms = [];
 
   var child = aRulesetElm.firstChild;
   while (child) {
@@ -347,18 +334,17 @@ function getRuleElmsFromRulesetElm(aRule
   }
 
   return ruleElms;
 }
 
 /**
  * Helper method to evaluate xpath expression.
  */
-function evaluateXPath(aNode, aExpr, aResolver)
-{
+function evaluateXPath(aNode, aExpr, aResolver) {
   var xpe = new XPathEvaluator();
 
   var resolver = aResolver;
   if (!resolver) {
     var node = aNode.ownerDocument == null ?
       aNode.documentElement : aNode.ownerDocument.documentElement;
     resolver = xpe.createNSResolver(node);
   }
--- a/accessible/tests/mochitest/name/test_counterstyle.html
+++ b/accessible/tests/mochitest/name/test_counterstyle.html
@@ -73,20 +73,18 @@
     }
     @counter-style speak-as-extended3 {
       system: extends speak-as-extended2;
     }
   </style>
 
   <script type="application/javascript">
 
-    function doTest()
-    {
-      function testRule(aRule, aNames, aTodo)
-      {
+    function doTest() {
+      function testRule(aRule, aNames, aTodo) {
         testName(aRule + "-1", aNames[0], null, aTodo);
         testName(aRule + "-7", aNames[1], null, aTodo);
         testName(aRule + "-29", aNames[2], null, aTodo);
       }
 
       var spellOutNames = ["X. 1", "Y X. 7", "Y Z Y. 29"];
       var bulletsNames = [kDiscBulletText + "1",
                           kDiscBulletText + "7",
--- a/accessible/tests/mochitest/name/test_general.html
+++ b/accessible/tests/mochitest/name/test_general.html
@@ -10,18 +10,17 @@
 
   <script type="application/javascript"
           src="../common.js"></script>
   <script type="application/javascript"
           src="../name.js"></script>
 
   <script type="application/javascript">
 
-    function doTest()
-    {
+    function doTest() {
       // aria-label
 
       // Simple label provided via ARIA
       testName("btn_simple_aria_label", "I am a button");
 
       // aria-label and aria-labelledby, expect aria-labelledby
       testName("btn_both_aria_labels", "text I am a button, two");
 
--- a/accessible/tests/mochitest/name/test_link.html
+++ b/accessible/tests/mochitest/name/test_link.html
@@ -10,18 +10,17 @@
           src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
 
   <script type="application/javascript"
           src="../common.js"></script>
   <script type="application/javascript"
           src="../name.js"></script>
 
   <script type="application/javascript">
-    function doTest()
-    {
+    function doTest() {
       // aria-label
       testName("aria_label", "anchor label");
 
       // aria-labelledby
       testName("aria_labelledby", "text");
 
       // name from content
       testName("namefromcontent", "1");
--- a/accessible/tests/mochitest/name/test_list.html
+++ b/accessible/tests/mochitest/name/test_list.html
@@ -14,55 +14,50 @@
           src="../name.js"></script>
   <script type="application/javascript"
           src="../events.js"></script>
 
   <script type="application/javascript">
     /**
      * Alter list item numbering and change list style type.
      */
-    function bulletUpdate()
-    {
+    function bulletUpdate() {
       this.eventSeq = [
         new invokerChecker(EVENT_REORDER, getNode("list"))
       ];
 
-      this.invoke = function bulletUpdate_invoke()
-      {
+      this.invoke = function bulletUpdate_invoke() {
         testName("li_end", "1. list end");
 
         var li = document.createElement("li");
         li.setAttribute("id", "li_start");
         li.textContent = "list start";
         getNode("list").insertBefore(li, getNode("li_end"));
       }
 
-      this.finalCheck = function bulletUpdate_finalCheck()
-      {
+      this.finalCheck = function bulletUpdate_finalCheck() {
         testName("li_start", "1. list start");
         testName("li_end", "2. list end");
 
         // change list style type
         var list = getNode("list");
         list.setAttribute("style", "list-style-type: disc;");
         getComputedStyle(list, "").color; // make style processing sync
 
         testName("li_start", kDiscBulletText + "list start");
         testName("li_end", kDiscBulletText + "list end");
       }
 
-      this.getID = function bulletUpdate_getID()
-      {
+      this.getID = function bulletUpdate_getID() {
         return "Update bullet of list items";
       }
     }
 
     var gQueue = null;
-    function doTest()
-    {
+    function doTest() {
       gQueue = new eventQueue();
       gQueue.push(new bulletUpdate());
       gQueue.invoke(); // SimpleTest.finish();
     }
 
     SimpleTest.waitForExplicitFinish();
     addA11yLoadEvent(doTest);
   </script>
--- a/accessible/tests/mochitest/name/test_svg.html
+++ b/accessible/tests/mochitest/name/test_svg.html
@@ -10,18 +10,17 @@
 
   <script type="application/javascript"
           src="../common.js"></script>
   <script type="application/javascript"
           src="../name.js"></script>
 
   <script type="application/javascript">
 
-    function doTest()
-    {
+    function doTest() {
       testName("svg1", "A name");
       testDescr("svg1", "A description");
       testName("svg2", "A tooltip");
       testDescr("svg2", "");
 
       SimpleTest.finish();
     }
 
--- a/accessible/tests/mochitest/pivot.js
+++ b/accessible/tests/mochitest/pivot.js
@@ -18,47 +18,43 @@ const NS_ERROR_INVALID_ARG = 0x80070057;
 // //////////////////////////////////////////////////////////////////////////////
 // Traversal rules
 
 /**
  * Rule object to traverse all focusable nodes and text nodes.
  */
 var HeadersTraversalRule =
 {
-  getMatchRoles: function(aRules)
-  {
+  getMatchRoles: function(aRules) {
     aRules.value = [ROLE_HEADING];
     return aRules.value.length;
   },
 
   preFilter: PREFILTER_INVISIBLE,
 
-  match: function(aAccessible)
-  {
+  match: function(aAccessible) {
     return FILTER_MATCH;
   },
 
   QueryInterface: XPCOMUtils.generateQI([nsIAccessibleTraversalRule])
 }
 
 /**
  * Traversal rule for all focusable nodes or leafs.
  */
 var ObjectTraversalRule =
 {
-  getMatchRoles: function(aRules)
-  {
+  getMatchRoles: function(aRules) {
     aRules.value = [];
     return 0;
   },
 
   preFilter: PREFILTER_INVISIBLE | PREFILTER_ARIA_HIDDEN | PREFILTER_TRANSPARENT,
 
-  match: function(aAccessible)
-  {
+  match: function(aAccessible) {
     var rv = FILTER_IGNORE;
     var role = aAccessible.role;
     if (hasState(aAccessible, STATE_FOCUSABLE) &&
         (role != ROLE_DOCUMENT && role != ROLE_INTERNAL_FRAME))
       rv = FILTER_IGNORE_SUBTREE | FILTER_MATCH;
     else if (aAccessible.childCount == 0 &&
              role != ROLE_STATICTEXT && aAccessible.name.trim())
       rv = FILTER_MATCH;
@@ -71,37 +67,34 @@ var ObjectTraversalRule =
 
 // //////////////////////////////////////////////////////////////////////////////
 // Virtual state invokers and checkers
 
 /**
  * A checker for virtual cursor changed events.
  */
 function VCChangedChecker(aDocAcc, aIdOrNameOrAcc, aTextOffsets, aPivotMoveMethod,
-                          aIsFromUserInput)
-{
+                          aIsFromUserInput) {
   this.__proto__ = new invokerChecker(EVENT_VIRTUALCURSOR_CHANGED, aDocAcc);
 
-  this.match = function VCChangedChecker_match(aEvent)
-  {
+  this.match = function VCChangedChecker_match(aEvent) {
     var event = null;
     try {
       event = aEvent.QueryInterface(nsIAccessibleVirtualCursorChangeEvent);
     } catch (e) {
       return false;
     }
 
     var expectedReason = VCChangedChecker.methodReasonMap[aPivotMoveMethod] ||
       nsIAccessiblePivot.REASON_NONE;
 
     return event.reason == expectedReason;
   };
 
-  this.check = function VCChangedChecker_check(aEvent)
-  {
+  this.check = function VCChangedChecker_check(aEvent) {
     SimpleTest.info("VCChangedChecker_check");
 
     var event = null;
     try {
       event = aEvent.QueryInterface(nsIAccessibleVirtualCursorChangeEvent);
     } catch (e) {
       SimpleTest.ok(false, "Does not support correct interface: " + e);
     }
@@ -137,27 +130,25 @@ function VCChangedChecker(aDocAcc, aIdOr
                     "previous end offset does not match");
     }
   };
 }
 
 VCChangedChecker.prevPosAndOffset = {};
 
 VCChangedChecker.storePreviousPosAndOffset =
-  function storePreviousPosAndOffset(aPivot)
-{
+  function storePreviousPosAndOffset(aPivot) {
   VCChangedChecker.prevPosAndOffset[aPivot] =
     {position: aPivot.position,
      startOffset: aPivot.startOffset,
      endOffset: aPivot.endOffset};
 };
 
 VCChangedChecker.getPreviousPosAndOffset =
-  function getPreviousPosAndOffset(aPivot)
-{
+  function getPreviousPosAndOffset(aPivot) {
   return VCChangedChecker.prevPosAndOffset[aPivot];
 };
 
 VCChangedChecker.methodReasonMap = {
   "moveNext": nsIAccessiblePivot.REASON_NEXT,
   "movePrevious": nsIAccessiblePivot.REASON_PREV,
   "moveFirst": nsIAccessiblePivot.REASON_FIRST,
   "moveLast": nsIAccessiblePivot.REASON_LAST,
@@ -170,30 +161,27 @@ VCChangedChecker.methodReasonMap = {
 /**
  * Set a text range in the pivot and wait for virtual cursor change event.
  *
  * @param aDocAcc         [in] document that manages the virtual cursor
  * @param aTextAccessible [in] accessible to set to virtual cursor's position
  * @param aTextOffsets    [in] start and end offsets of text range to set in
  *                        virtual cursor.
  */
-function setVCRangeInvoker(aDocAcc, aTextAccessible, aTextOffsets)
-{
-  this.invoke = function virtualCursorChangedInvoker_invoke()
-  {
+function setVCRangeInvoker(aDocAcc, aTextAccessible, aTextOffsets) {
+  this.invoke = function virtualCursorChangedInvoker_invoke() {
     VCChangedChecker.
       storePreviousPosAndOffset(aDocAcc.virtualCursor);
     SimpleTest.info(prettyName(aTextAccessible) + " " + aTextOffsets);
     aDocAcc.virtualCursor.setTextRange(aTextAccessible,
                                        aTextOffsets[0],
                                        aTextOffsets[1]);
   };
 
-  this.getID = function setVCRangeInvoker_getID()
-  {
+  this.getID = function setVCRangeInvoker_getID() {
     return "Set offset in " + prettyName(aTextAccessible) +
       " to (" + aTextOffsets[0] + ", " + aTextOffsets[1] + ")";
   };
 
   this.eventSeq = [
     new VCChangedChecker(aDocAcc, aTextAccessible, aTextOffsets, "setTextRange", true)
   ];
 }
@@ -206,21 +194,19 @@ function setVCRangeInvoker(aDocAcc, aTex
  * @param aRule            [in] traversal rule object
  * @param aIdOrNameOrAcc   [in] id, accessible or accessible name to expect
  *                         virtual cursor to land on after performing move method.
  *                         false if no move is expected.
  * @param aIsFromUserInput [in] set user input flag when invoking method, and
  *                         expect it in the event.
  */
 function setVCPosInvoker(aDocAcc, aPivotMoveMethod, aRule, aIdOrNameOrAcc,
-                         aIsFromUserInput)
-{
+                         aIsFromUserInput) {
   var expectMove = (aIdOrNameOrAcc != false);
-  this.invoke = function virtualCursorChangedInvoker_invoke()
-  {
+  this.invoke = function virtualCursorChangedInvoker_invoke() {
     VCChangedChecker.
       storePreviousPosAndOffset(aDocAcc.virtualCursor);
     if (aPivotMoveMethod && aRule) {
       var moved = false;
       switch (aPivotMoveMethod) {
         case "moveFirst":
         case "moveLast":
           moved = aDocAcc.virtualCursor[aPivotMoveMethod](aRule,
@@ -236,18 +222,17 @@ function setVCPosInvoker(aDocAcc, aPivot
       SimpleTest.is(!!moved, !!expectMove,
                     "moved pivot with " + aPivotMoveMethod +
                     " to " + aIdOrNameOrAcc);
     } else {
       aDocAcc.virtualCursor.position = getAccessible(aIdOrNameOrAcc);
     }
   };
 
-  this.getID = function setVCPosInvoker_getID()
-  {
+  this.getID = function setVCPosInvoker_getID() {
     return "Do " + (expectMove ? "" : "no-op ") + aPivotMoveMethod;
   };
 
   if (expectMove) {
     this.eventSeq = [
       new VCChangedChecker(aDocAcc, aIdOrNameOrAcc, null, aPivotMoveMethod,
         aIsFromUserInput === undefined ? !!aPivotMoveMethod : aIsFromUserInput)
     ];
@@ -269,32 +254,29 @@ function setVCPosInvoker(aDocAcc, aPivot
  *                         virtual cursor.
  * @param aIdOrNameOrAcc   [in] id, accessible or accessible name to expect
  *                         virtual cursor to land on after performing move method.
  *                         false if no move is expected.
  * @param aIsFromUserInput [in] set user input flag when invoking method, and
  *                         expect it in the event.
  */
 function setVCTextInvoker(aDocAcc, aPivotMoveMethod, aBoundary, aTextOffsets,
-                          aIdOrNameOrAcc, aIsFromUserInput)
-{
+                          aIdOrNameOrAcc, aIsFromUserInput) {
   var expectMove = (aIdOrNameOrAcc != false);
-  this.invoke = function virtualCursorChangedInvoker_invoke()
-  {
+  this.invoke = function virtualCursorChangedInvoker_invoke() {
     VCChangedChecker.storePreviousPosAndOffset(aDocAcc.virtualCursor);
     SimpleTest.info(aDocAcc.virtualCursor.position);
     var moved = aDocAcc.virtualCursor[aPivotMoveMethod](aBoundary,
       aIsFromUserInput === undefined);
     SimpleTest.is(!!moved, !!expectMove,
                   "moved pivot by text with " + aPivotMoveMethod +
                   " to " + aIdOrNameOrAcc);
   };
 
-  this.getID = function setVCPosInvoker_getID()
-  {
+  this.getID = function setVCPosInvoker_getID() {
     return "Do " + (expectMove ? "" : "no-op ") + aPivotMoveMethod + " in " +
       prettyName(aIdOrNameOrAcc) + ", " + boundaryToString(aBoundary) +
       ", [" + aTextOffsets + "]";
   };
 
   if (expectMove) {
     this.eventSeq = [
       new VCChangedChecker(aDocAcc, aIdOrNameOrAcc, aTextOffsets, aPivotMoveMethod,
@@ -318,31 +300,28 @@ function setVCTextInvoker(aDocAcc, aPivo
  * @param aIgnoreNoMatch [in] don't unset position if no object was found at
  *                       point.
  * @param aRule          [in] traversal rule object
  * @param aIdOrNameOrAcc [in] id, accessible or accessible name to expect
  *                       virtual cursor to land on after performing move method.
  *                       false if no move is expected.
  */
 function moveVCCoordInvoker(aDocAcc, aX, aY, aIgnoreNoMatch,
-                            aRule, aIdOrNameOrAcc)
-{
+                            aRule, aIdOrNameOrAcc) {
   var expectMove = (aIdOrNameOrAcc != false);
-  this.invoke = function virtualCursorChangedInvoker_invoke()
-  {
+  this.invoke = function virtualCursorChangedInvoker_invoke() {
     VCChangedChecker.
       storePreviousPosAndOffset(aDocAcc.virtualCursor);
     var moved = aDocAcc.virtualCursor.moveToPoint(aRule, aX, aY,
                                                   aIgnoreNoMatch);
     SimpleTest.ok((expectMove && moved) || (!expectMove && !moved),
                   "moved pivot");
   };
 
-  this.getID = function setVCPosInvoker_getID()
-  {
+  this.getID = function setVCPosInvoker_getID() {
     return "Do " + (expectMove ? "" : "no-op ") + "moveToPoint " + aIdOrNameOrAcc;
   };
 
   if (expectMove) {
     this.eventSeq = [
       new VCChangedChecker(aDocAcc, aIdOrNameOrAcc, null, "moveToPoint", true)
     ];
   } else {
@@ -355,35 +334,32 @@ function moveVCCoordInvoker(aDocAcc, aX,
 
 /**
  * Change the pivot modalRoot
  *
  * @param aDocAcc         [in] document that manages the virtual cursor
  * @param aModalRootAcc   [in] accessible of the modal root, or null
  * @param aExpectedResult [in] error result expected. 0 if expecting success
  */
-function setModalRootInvoker(aDocAcc, aModalRootAcc, aExpectedResult)
-{
-  this.invoke = function setModalRootInvoker_invoke()
-  {
+function setModalRootInvoker(aDocAcc, aModalRootAcc, aExpectedResult) {
+  this.invoke = function setModalRootInvoker_invoke() {
     var errorResult = 0;
     try {
       aDocAcc.virtualCursor.modalRoot = aModalRootAcc;
     } catch (x) {
       SimpleTest.ok(
         x.result, "Unexpected exception when changing modal root: " + x);
       errorResult = x.result;
     }
 
     SimpleTest.is(errorResult, aExpectedResult,
                   "Did not get expected result when changing modalRoot");
   };
 
-  this.getID = function setModalRootInvoker_getID()
-  {
+  this.getID = function setModalRootInvoker_getID() {
     return "Set modalRoot to " + prettyName(aModalRootAcc);
   };
 
   this.eventSeq = [];
   this.unexpectedEventSeq = [
     new invokerChecker(EVENT_VIRTUALCURSOR_CHANGED, aDocAcc)
   ];
 }
@@ -395,18 +371,17 @@ function setModalRootInvoker(aDocAcc, aM
  * @param aQueue     [in] event queue in which to push invoker sequence.
  * @param aDocAcc    [in] the managing document of the virtual cursor we are
  *                   testing
  * @param aRule      [in] the traversal rule to use in the invokers
  * @param aModalRoot [in] a modal root to use in this traversal sequence
  * @param aSequence  [in] a sequence of accessible names or element ids to expect
  *                   with the given rule in the given document
  */
-function queueTraversalSequence(aQueue, aDocAcc, aRule, aModalRoot, aSequence)
-{
+function queueTraversalSequence(aQueue, aDocAcc, aRule, aModalRoot, aSequence) {
   aDocAcc.virtualCursor.position = null;
 
   // Add modal root (if any)
   aQueue.push(new setModalRootInvoker(aDocAcc, aModalRoot, 0));
 
   aQueue.push(new setVCPosInvoker(aDocAcc, "moveFirst", aRule, aSequence[0]));
 
   for (var i = 1; i < aSequence.length; i++) {
@@ -441,18 +416,17 @@ function queueTraversalSequence(aQueue, 
 
   // Remove modal root (if any).
   aQueue.push(new setModalRootInvoker(aDocAcc, null, 0));
 }
 
 /**
  * A checker for removing an accessible while the virtual cursor is on it.
  */
-function removeVCPositionChecker(aDocAcc, aHiddenParentAcc)
-{
+function removeVCPositionChecker(aDocAcc, aHiddenParentAcc) {
   this.__proto__ = new invokerChecker(EVENT_REORDER, aHiddenParentAcc);
 
   this.check = function removeVCPositionChecker_check(aEvent) {
     var errorResult = 0;
     try {
       aDocAcc.virtualCursor.moveNext(ObjectTraversalRule);
     } catch (x) {
       errorResult = x.result;
@@ -465,41 +439,37 @@ function removeVCPositionChecker(aDocAcc
 
 /**
  * Put the virtual cursor's position on an object, and then remove it.
  *
  * @param aDocAcc     [in] document that manages the virtual cursor
  * @param aPosNode    [in] DOM node to hide after virtual cursor's position is
  *                    set to it.
  */
-function removeVCPositionInvoker(aDocAcc, aPosNode)
-{
+function removeVCPositionInvoker(aDocAcc, aPosNode) {
   this.accessible = getAccessible(aPosNode);
-  this.invoke = function removeVCPositionInvoker_invoke()
-  {
+  this.invoke = function removeVCPositionInvoker_invoke() {
     aDocAcc.virtualCursor.position = this.accessible;
     aPosNode.remove();
   };
 
-  this.getID = function removeVCPositionInvoker_getID()
-  {
+  this.getID = function removeVCPositionInvoker_getID() {
     return "Bring virtual cursor to accessible, and remove its DOM node.";
   };
 
   this.eventSeq = [
     new removeVCPositionChecker(aDocAcc, this.accessible.parent)
   ];
 }
 
 /**
  * A checker for removing the pivot root and then calling moveFirst, and
  * checking that an exception is thrown.
  */
-function removeVCRootChecker(aPivot)
-{
+function removeVCRootChecker(aPivot) {
   this.__proto__ = new invokerChecker(EVENT_REORDER, aPivot.root.parent);
 
   this.check = function removeVCRootChecker_check(aEvent) {
     var errorResult = 0;
     try {
       aPivot.moveLast(ObjectTraversalRule);
     } catch (x) {
       errorResult = x.result;
@@ -512,40 +482,36 @@ function removeVCRootChecker(aPivot)
 
 /**
  * Create a pivot, remove its root, and perform an operation where the root is
  * needed.
  *
  * @param aRootNode [in] DOM node of which accessible will be the root of the
  *                       pivot. Should have more than one child.
  */
-function removeVCRootInvoker(aRootNode)
-{
+function removeVCRootInvoker(aRootNode) {
   this.pivot = gAccService.createAccessiblePivot(getAccessible(aRootNode));
-  this.invoke = function removeVCRootInvoker_invoke()
-  {
+  this.invoke = function removeVCRootInvoker_invoke() {
     this.pivot.position = this.pivot.root.firstChild;
     aRootNode.remove();
   };
 
-  this.getID = function removeVCRootInvoker_getID()
-  {
+  this.getID = function removeVCRootInvoker_getID() {
     return "Remove root of pivot from tree.";
   };
 
   this.eventSeq = [
     new removeVCRootChecker(this.pivot)
   ];
 }
 
 /**
  * A debug utility for writing proper sequences for queueTraversalSequence.
  */
-function dumpTraversalSequence(aPivot, aRule)
-{
+function dumpTraversalSequence(aPivot, aRule) {
   var sequence = [];
   if (aPivot.moveFirst(aRule)) {
     do {
       sequence.push("'" + prettyName(aPivot.position) + "'");
     } while (aPivot.moveNext(aRule))
   }
   SimpleTest.info("\n[" + sequence.join(", ") + "]\n");
 }
--- a/accessible/tests/mochitest/pivot/test_virtualcursor.html
+++ b/accessible/tests/mochitest/pivot/test_virtualcursor.html
@@ -19,34 +19,32 @@
   <script type="application/javascript" src="../states.js"></script>
   <script type="application/javascript" src="../pivot.js"></script>
   <script type="application/javascript" src="../layout.js"></script>
 
   <script type="application/javascript">
     var gBrowserWnd = null;
     var gQueue = null;
 
-    function doTest()
-    {
+    function doTest() {
       var rootAcc = getAccessible(browserDocument(), [nsIAccessibleDocument]);
       ok(rootAcc.virtualCursor,
          "root document does not have virtualCursor");
 
       var doc = currentTabDocument();
       var docAcc = getAccessible(doc, [nsIAccessibleDocument]);
 
       // Test that embedded documents have their own virtual cursor.
       is(docAcc.childDocumentCount, 1, "Expecting one child document");
       ok(docAcc.getChildDocumentAt(0).virtualCursor,
          "child document does not have virtualCursor");
 
       gQueue = new eventQueue();
 
-      gQueue.onFinish = function onFinish()
-      {
+      gQueue.onFinish = function onFinish() {
         closeBrowserWindow();
       }
 
       queueTraversalSequence(gQueue, docAcc, HeadersTraversalRule, null,
                              ["heading-1-1", "heading-2-1", "heading-2-2"]);
 
       queueTraversalSequence(
         gQueue, docAcc, ObjectTraversalRule, null,
--- a/accessible/tests/mochitest/pivot/test_virtualcursor_text.html
+++ b/accessible/tests/mochitest/pivot/test_virtualcursor_text.html
@@ -20,25 +20,23 @@
   <script type="application/javascript" src="../states.js"></script>
   <script type="application/javascript" src="../pivot.js"></script>
   <script type="application/javascript" src="../layout.js"></script>
 
   <script type="application/javascript">
     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();
       }
 
       gQueue.push(new setVCPosInvoker(docAcc, null, null,
                                       getAccessible(doc.getElementById("paragraph-1"))));
       gQueue.push(new setVCTextInvoker(docAcc, "moveNextByText", WORD_BOUNDARY, [0,4],
                   getAccessible(doc.getElementById("paragraph-1"), nsIAccessibleText)));
       gQueue.push(new setVCTextInvoker(docAcc, "moveNextByText", CHAR_BOUNDARY, [4,5],
--- a/accessible/tests/mochitest/relations.js
+++ b/accessible/tests/mochitest/relations.js
@@ -33,18 +33,17 @@ const RELATION_ERRORMSG_FOR = nsIAccessi
  * Test the accessible relation.
  *
  * @param aIdentifier          [in] identifier to get an accessible, may be ID
  *                             attribute or DOM element or accessible object
  * @param aRelType             [in] relation type (see constants above)
  * @param aRelatedIdentifiers  [in] identifier or array of identifiers of
  *                             expected related accessibles
  */
-function testRelation(aIdentifier, aRelType, aRelatedIdentifiers)
-{
+function testRelation(aIdentifier, aRelType, aRelatedIdentifiers) {
   var relation = getRelationByType(aIdentifier, aRelType);
 
   var relDescr = getRelationErrorMsg(aIdentifier, aRelType);
   var relDescrStart = getRelationErrorMsg(aIdentifier, aRelType, true);
 
   if (!relation || !relation.targetsCount) {
     if (!aRelatedIdentifiers) {
       ok(true, "No" + relDescr);
@@ -105,18 +104,17 @@ function testRelation(aIdentifier, aRelT
  *
  * @param aIdentifier           [in] identifier to get an accessible, may be ID
  *                              attribute or DOM element or accessible object
  * @param aRelType              [in] relation type (see constants above)
  * @param aUnrelatedIdentifiers [in] identifier or array of identifiers of
  *                              accessibles that shouldn't exist for this
  *                              relation.
  */
-function testAbsentRelation(aIdentifier, aRelType, aUnrelatedIdentifiers)
-{
+function testAbsentRelation(aIdentifier, aRelType, aUnrelatedIdentifiers) {
   var relation = getRelationByType(aIdentifier, aRelType);
 
   var relDescr = getRelationErrorMsg(aIdentifier, aRelType);
 
   if (!aUnrelatedIdentifiers) {
     ok(false, "No identifiers given for unrelated accessibles.");
     return;
   }
@@ -156,18 +154,17 @@ function testAbsentRelation(aIdentifier,
 
 /**
  * Return related accessible for the given relation type.
  *
  * @param aIdentifier  [in] identifier to get an accessible, may be ID attribute
  *                     or DOM element or accessible object
  * @param aRelType     [in] relation type (see constants above)
  */
-function getRelationByType(aIdentifier, aRelType)
-{
+function getRelationByType(aIdentifier, aRelType) {
   var acc = getAccessible(aIdentifier);
   if (!acc)
     return;
 
   var relation = null;
   try {
     relation = acc.getRelationByType(aRelType);
   } catch (e) {
@@ -175,17 +172,16 @@ function getRelationByType(aIdentifier, 
   }
 
   return relation;
 }
 
 // //////////////////////////////////////////////////////////////////////////////
 // Private implementation details
 
-function getRelationErrorMsg(aIdentifier, aRelType, aIsStartSentence)
-{
+function getRelationErrorMsg(aIdentifier, aRelType, aIsStartSentence) {
   var relStr = relationTypeToString(aRelType);
   var msg = aIsStartSentence ? "Relation of '" : " relation of '";
   msg += relStr + "' type for '" + prettyName(aIdentifier) + "'";
   msg += aIsStartSentence ? " " : ".";
 
   return msg;
 }
--- a/accessible/tests/mochitest/relations/test_bindings.xhtml
+++ b/accessible/tests/mochitest/relations/test_bindings.xhtml
@@ -48,18 +48,17 @@
           src="chrome://mochikit/content/tests/SimpleTest/EventUtils.js"></script>
 
   <script type="application/javascript"
           src="../common.js"></script>
   <script type="application/javascript"
           src="../relations.js"></script>
 
   <script type="application/javascript">
-    function doTests()
-    {
+    function doTests() {
       var button = document.getElementById("button");
       var anonLabel = document.
         getAnonymousElementByAttribute(button, "anonid", "button.label");
       var anonButton = document.
         getAnonymousElementByAttribute(button, "anonid", "button.button");
       var anonButton2 = document.
         getAnonymousElementByAttribute(button, "anonid", "button.button2");
       var anonButton3 = document.
--- a/accessible/tests/mochitest/relations/test_general.html
+++ b/accessible/tests/mochitest/relations/test_general.html
@@ -10,18 +10,17 @@
   <script type="application/javascript"
           src="../common.js"></script>
   <script type="application/javascript"
           src="../relations.js"></script>
   <script type="application/javascript"
           src="../role.js"></script>
 
   <script type="application/javascript">
-    function doTest()
-    {
+    function doTest() {
       // html:label@for
       testRelation("label1_1", RELATION_LABEL_FOR, "control1_1");
       testRelation("control1_1", RELATION_LABELLED_BY, "label1_1");
 
       // html:label@for, multiple
       testRelation("label1_2", RELATION_LABEL_FOR, "control1_2");
       testRelation("label1_3", RELATION_LABEL_FOR, "control1_2");
       testRelation("control1_2", RELATION_LABELLED_BY,
--- a/accessible/tests/mochitest/relations/test_ui_modalprompt.html
+++ b/accessible/tests/mochitest/relations/test_ui_modalprompt.html
@@ -25,60 +25,52 @@
     function hasTabModalPrompts() {
       try {
         return SpecialPowers.getBoolPref("prompts.tab_modal.enabled");
       } catch (ex) {
         return false;
       }
     }
 
-    function showAlert()
-    {
+    function showAlert() {
       this.eventSeq = [
         {
           type: EVENT_SHOW,
-          match: function(aEvent)
-          {
+          match: function(aEvent) {
             return aEvent.accessible.role == ROLE_DIALOG;
           }
         }
       ];
 
-      this.invoke = function showAlert_invoke()
-      {
+      this.invoke = function showAlert_invoke() {
         window.setTimeout(
-          function()
-          {
+          function() {
             currentTabDocument().defaultView.alert("hello");
           }, 0);
       }
 
-      this.check = function showAlert_finalCheck(aEvent)
-      {
+      this.check = function showAlert_finalCheck(aEvent) {
         var dialog = aEvent.accessible.DOMNode;
         var info = dialog.ui.infoBody;
         testRelation(info, RELATION_DESCRIPTION_FOR, dialog);
         testRelation(dialog, RELATION_DESCRIBED_BY, info);
       }
 
-      this.getID = function showAlert_getID()
-      {
+      this.getID = function showAlert_getID() {
         return "show alert";
       }
     }
 
     // gA11yEventDumpToConsole = true; // debug
 
     var gQueue = null;
-    function doTests()
-    {
+    function doTests() {
       gQueue = new eventQueue();
       gQueue.push(new showAlert());
-      gQueue.onFinish = function()
-      {
+      gQueue.onFinish = function() {
         synthesizeKey("VK_RETURN", {}, browserWindow());
         closeBrowserWindow();
       }
       gQueue.invoke(); // will call SimpleTest.finish()
     }
 
     if (!hasTabModalPrompts()) {
       todo(false, "Test disabled when tab modal prompts are not enabled.");
--- a/accessible/tests/mochitest/relations/test_update.html
+++ b/accessible/tests/mochitest/relations/test_update.html
@@ -14,18 +14,17 @@
           src="../relations.js"></script>
   <script type="application/javascript"
           src="../role.js"></script>
   <script type="application/javascript"
           src="../events.js"></script>
 
   <script type="application/javascript">
     function testRelated(aRelAttr, aHostRelation, aDependentRelation,
-                         aHostID, aHostNodeID, aDependent1ID, aDependent2ID)
-    {
+                         aHostID, aHostNodeID, aDependent1ID, aDependent2ID) {
       // no attribute
       testRelation(aDependent1ID, aDependentRelation, null);
       testRelation(aDependent2ID, aDependentRelation, null);
       if (aHostRelation)
         testRelation(aHostID, aHostRelation, null);
 
       // set attribute
       getNode(aHostNodeID).setAttribute(aRelAttr, aDependent1ID);
@@ -45,95 +44,86 @@
       getNode(aHostNodeID).removeAttribute(aRelAttr);
       testRelation(aDependent1ID, aDependentRelation, null);
       testRelation(aDependent2ID, aDependentRelation, null);
       if (aHostRelation)
         testRelation(aHostID, aHostRelation, null);
     }
 
     function insertRelated(aHostRelAttr, aDependentID, aInsertHostFirst,
-                           aHostRelation, aDependentRelation)
-    {
+                           aHostRelation, aDependentRelation) {
       this.eventSeq = [
         new invokerChecker(EVENT_REORDER, document)
       ];
 
-      this.invoke = function insertRelated_invoke()
-      {
+      this.invoke = function insertRelated_invoke() {
         this.hostNode = document.createElement("div");
         this.hostNode.setAttribute(aHostRelAttr, aDependentID);
 
         this.dependentNode = document.createElement("div");
         this.dependentNode.setAttribute("id", aDependentID);
 
         if (aInsertHostFirst) {
           document.body.appendChild(this.hostNode);
           document.body.appendChild(this.dependentNode);
         } else {
           document.body.appendChild(this.dependentNode);
           document.body.appendChild(this.hostNode);
         }
       }
 
-      this.finalCheck = function insertRelated_finalCheck()
-      {
+      this.finalCheck = function insertRelated_finalCheck() {
         testRelation(this.dependentNode, aDependentRelation, this.hostNode);
         if (aHostRelation)
           testRelation(this.hostNode, aHostRelation, this.dependentNode);
       }
 
-      this.getID = function insertRelated_getID()
-      {
+      this.getID = function insertRelated_getID() {
         return "Insert " + aHostRelAttr + "='" + aDependentID + "' node" +
           (aInsertHostFirst ? " before" : "after") + " dependent node";
       }
     }
 
     /**
      * Relative accessible recreation shouldn't break accessible relations.
      * Note: modify this case if the invoke function doesn't change accessible
      * tree due to changes in layout module. It can be changed on any case
      * when accessibles are recreated.
      */
-    function recreateRelatives(aContainerID, aLabelID, aElmID)
-    {
+    function recreateRelatives(aContainerID, aLabelID, aElmID) {
       this.containerNode = getNode(aContainerID);
       this.container = getNode(this.containerNode);
 
       this.eventSeq = [
         new invokerChecker(EVENT_HIDE, this.container),
         new invokerChecker(EVENT_SHOW, this.containerNode)
       ];
 
-      this.invoke = function recreateRelatives_invoke()
-      {
+      this.invoke = function recreateRelatives_invoke() {
         testRelation(aLabelID, RELATION_LABEL_FOR, aElmID);
         testRelation(aElmID, RELATION_LABELLED_BY, aLabelID);
 
         this.containerNode.style.overflow = "visible";
       }
 
-      this.finalCheck = function recreateRelatives_finalCheck()
-      {
+      this.finalCheck = function recreateRelatives_finalCheck() {
         testRelation(aLabelID, RELATION_LABEL_FOR, aElmID);
         testRelation(aElmID, RELATION_LABELLED_BY, aLabelID);
       }
 
-      this.getID = function recreateRelatives_getID()
-      {
+      this.getID = function recreateRelatives_getID() {
         return "recreate relatives ";
       }
     }
 
     // gA11yEventDumpToConsole = true; // debug
 
     var gQueue = null;
 
-    function doTest()
-    {
+    function doTest() {
       // Relation updates on ARIA attribute changes.
       testRelated("aria-labelledby",
                   RELATION_LABELLED_BY, RELATION_LABEL_FOR,
                   "host", "host", "dependent1", "dependent2");
 
       testRelated("aria-describedby",
                   RELATION_DESCRIBED_BY, RELATION_DESCRIPTION_FOR,
                   "host", "host", "dependent1", "dependent2");
--- a/accessible/tests/mochitest/role.js
+++ b/accessible/tests/mochitest/role.js
@@ -129,31 +129,29 @@ const ROLE_WHITESPACE = nsIAccessibleRol
 // Public methods
 
 /**
  * Test that the role of the given accessible is the role passed in.
  *
  * @param aAccOrElmOrID  the accessible, DOM element or ID to be tested.
  * @param aRole  The role that is to be expected.
  */
-function testRole(aAccOrElmOrID, aRole)
-{
+function testRole(aAccOrElmOrID, aRole) {
   var role = getRole(aAccOrElmOrID);
   is(role, aRole, "Wrong role for " + prettyName(aAccOrElmOrID) + "!");
 }
 
 /**
  * Return the role of the given accessible. Return -1 if accessible could not
  * be retrieved.
  *
  * @param aAccOrElmOrID  [in] The accessible, DOM element or element ID the
  *                       accessible role is being requested for.
  */
-function getRole(aAccOrElmOrID)
-{
+function getRole(aAccOrElmOrID) {
   var acc = getAccessible(aAccOrElmOrID);
   if (!acc)
     return -1;
 
   var role = -1;
   try {
     role = acc.role;
   } catch (e) {
@@ -161,18 +159,17 @@ function getRole(aAccOrElmOrID)
   }
 
   return role;
 }
 
 /**
  * Analogy of SimpleTest.is function used to check the role.
  */
-function isRole(aIdentifier, aRole, aMsg)
-{
+function isRole(aIdentifier, aRole, aMsg) {
   var role = getRole(aIdentifier);
   if (role == - 1)
     return;
 
   if (role == aRole) {
     ok(true, aMsg);
     return;
   }
--- a/accessible/tests/mochitest/role/test_aria.html
+++ b/accessible/tests/mochitest/role/test_aria.html
@@ -10,18 +10,17 @@
 
   <script type="application/javascript"
           src="../common.js"></script>
   <script type="application/javascript"
           src="../role.js"></script>
 
   <script type="application/javascript">
 
-    function doTest()
-    {
+    function doTest() {
       // ARIA role map.
       testRole("aria_alert", ROLE_ALERT);
       testRole("aria_alertdialog", ROLE_DIALOG);
       testRole("aria_application", ROLE_APPLICATION);
       testRole("aria_article", ROLE_ARTICLE);
       testRole("aria_button", ROLE_PUSHBUTTON);
       testRole("aria_checkbox", ROLE_CHECKBUTTON);
       testRole("aria_columnheader", ROLE_COLUMNHEADER);
--- a/accessible/tests/mochitest/role/test_dpub_aria.html
+++ b/accessible/tests/mochitest/role/test_dpub_aria.html
@@ -10,18 +10,17 @@
 
   <script type="application/javascript"
           src="../common.js"></script>
   <script type="application/javascript"
           src="../role.js"></script>
 
   <script type="application/javascript">
 
-    function doTest()
-    {
+    function doTest() {
       // DPub ARIA role map.
       testRole("doc-abstract", ROLE_SECTION);
       testRole("doc-acknowledgments", ROLE_LANDMARK);
       testRole("doc-afterword", ROLE_LANDMARK);
       testRole("doc-appendix", ROLE_LANDMARK);
       testRole("doc-backlink", ROLE_LINK);
       testRole("doc-biblioentry", ROLE_LISTITEM);
       testRole("doc-bibliography", ROLE_LANDMARK);
--- a/accessible/tests/mochitest/role/test_general.html
+++ b/accessible/tests/mochitest/role/test_general.html
@@ -10,18 +10,17 @@
   <script type="application/javascript"
           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 doTests()
-    {
+    function doTests() {
       // landmark tests section
       testRole("frm", ROLE_FORM);
 
       // nsHyperTextAcc tests section
       // Test html:form.
       testRole("nav", ROLE_SECTION);
       testRole("header", ROLE_HEADER);
       testRole("footer", ROLE_FOOTER);
--- a/accessible/tests/mochitest/role/test_svg.html
+++ b/accessible/tests/mochitest/role/test_svg.html
@@ -10,18 +10,17 @@
   <script type="application/javascript"
           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 doTests()
-    {
+    function doTests() {
       testRole("svg", ROLE_DIAGRAM);
       testRole("rect", ROLE_GRAPHIC);
       testRole("circle", ROLE_GRAPHIC);
       testRole("ellipse", ROLE_GRAPHIC);
       testRole("line", ROLE_GRAPHIC);
       testRole("polygon", ROLE_GRAPHIC);
       testRole("polyline", ROLE_GRAPHIC);
       testRole("path", ROLE_GRAPHIC);
--- a/accessible/tests/mochitest/scroll/test_zoom.html
+++ b/accessible/tests/mochitest/scroll/test_zoom.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 testScrollToPoint()
-    {
+    function testScrollToPoint() {
       // scrollToPoint relative screen
       var anchor = getAccessible("bottom1");
       var [x, /*y*/] = getPos(anchor);
       var [docX, docY] = getPos(document);
 
       anchor.scrollToPoint(COORDTYPE_SCREEN_RELATIVE, docX, docY);
       testPos(anchor, [x, docY]);
 
@@ -43,18 +42,17 @@
       var [x, /*y*/] = getPos(anchor);
       var [parentX, parentY] = getPos(anchor.parent);
       var scrollToX = parentX - docX, scrollToY = parentY - docY;
 
       anchor.scrollToPoint(COORDTYPE_PARENT_RELATIVE, scrollToX, scrollToY);
       testPos(anchor, [x, docY]);
     }
 
-    function doTest()
-    {
+    function doTest() {
       testScrollToPoint();
       zoomDocument(document, 2.0);
       testScrollToPoint(); // zoom and test again
 
       zoomDocument(document, 1.0);
       SimpleTest.finish();
     }
 
--- a/accessible/tests/mochitest/selectable.js
+++ b/accessible/tests/mochitest/selectable.js
@@ -1,16 +1,15 @@
 /**
  * Test selection getter methods of nsIAccessibleSelectable.
  *
  * @param aIdentifier        [in] selectable container accessible
  * @param aSelectedChildren  [in] array of selected children
  */
-function testSelectableSelection(aIdentifier, aSelectedChildren, aMsg)
-{
+function testSelectableSelection(aIdentifier, aSelectedChildren, aMsg) {
   var acc = getAccessible(aIdentifier, [nsIAccessibleSelectable]);
   if (!acc)
     return;
 
   var msg = aMsg ? aMsg : "";
   var len = aSelectedChildren.length;
 
   // getSelectedChildren
@@ -42,18 +41,17 @@ function testSelectableSelection(aIdenti
 
   // isItemSelected
   testIsItemSelected(acc, acc, { value: 0 }, aSelectedChildren, msg);
 }
 
 /**
  * Test isItemSelected method, helper for testSelectableSelection
  */
-function testIsItemSelected(aSelectAcc, aTraversedAcc, aIndexObj, aSelectedChildren, aMsg)
-{
+function testIsItemSelected(aSelectAcc, aTraversedAcc, aIndexObj, aSelectedChildren, aMsg) {
   var childCount = aTraversedAcc.childCount;
   for (var idx = 0; idx < childCount; idx++) {
     var child = aTraversedAcc.getChildAt(idx);
     var [state, /*extraState*/] = getStates(child);
     if (state & STATE_SELECTABLE) {
       var isSelected = false;
       var len = aSelectedChildren.length;
       for (var jdx = 0; jdx < len; jdx++) {
--- a/accessible/tests/mochitest/selectable/test_aria.html
+++ b/accessible/tests/mochitest/selectable/test_aria.html
@@ -16,31 +16,29 @@
   <script type="application/javascript"
           src="../role.js"></script>
   <script type="application/javascript"
           src="../states.js"></script>
   <script type="application/javascript"
           src="../selectable.js"></script>
 
   <script type="application/javascript">
-    function testSelectable(aID, aSelectableChildren)
-    {
+    function testSelectable(aID, aSelectableChildren) {
       var acc = getAccessible(aID, [nsIAccessibleSelectable]);
 
       testSelectableSelection(acc, []);
 
       acc.selectAll();
       testSelectableSelection(acc, aSelectableChildren);
 
       acc.unselectAll();
       testSelectableSelection(acc, []);
     }
 
-    function doTest()
-    {
+    function doTest() {
       // ////////////////////////////////////////////////////////////////////////
       // role="tablist"
 
       id = "tablist";
       ok(isAccessible(id, [nsIAccessibleSelectable]),
          "No selectable accessible for " + id);
 
       testSelectableSelection(id, [ ]);
--- a/accessible/tests/mochitest/selectable/test_select.html
+++ b/accessible/tests/mochitest/selectable/test_select.html
@@ -17,18 +17,17 @@
           src="../role.js"></script>
   <script type="application/javascript"
           src="../states.js"></script>
   <script type="application/javascript"
           src="../selectable.js"></script>
 
   <script type="application/javascript">
 
-    function doTest()
-    {
+    function doTest() {
       // ////////////////////////////////////////////////////////////////////////
       // select@size="1" aka combobox
 
       var id = "combobox";
       var combobox = getAccessible(id);
       var comboboxList = combobox.firstChild;
       ok(isAccessible(comboboxList, [nsIAccessibleSelectable]),
          "No selectable accessible for list of " + id);
--- a/accessible/tests/mochitest/states.js
+++ b/accessible/tests/mochitest/states.js
@@ -68,18 +68,17 @@ const kExtraState = 1;
  * @param aAccOrElmOrID      The accessible, DOM element or ID to be tested.
  * @param aState             The state bits that are wanted.
  * @param aExtraState        The extra state bits that are wanted.
  * @param aAbsentState       State bits that are not wanted.
  * @param aAbsentExtraState  Extra state bits that are not wanted.
  * @param aTestName          The test name.
  */
 function testStates(aAccOrElmOrID, aState, aExtraState, aAbsentState,
-                    aAbsentExtraState, aTestName)
-{
+                    aAbsentExtraState, aTestName) {
   var [state, extraState] = getStates(aAccOrElmOrID);
   var role = getRole(aAccOrElmOrID);
   var id = prettyName(aAccOrElmOrID) + (aTestName ? " [" + aTestName + "]" : "");
 
   // Primary test.
   if (aState) {
     isState(state & aState, aState, false,
             "wrong state bits for " + id + "!");
@@ -167,18 +166,17 @@ function testStates(aAccOrElmOrID, aStat
  * Used to make sure that states are propagated to descendants, for example the
  * STATE_UNAVAILABLE from a container to its children.
  *
  * @param aAccOrElmOrID  The accessible, DOM element or ID to be tested.
  * @param aState         The state bits that are wanted.
  * @param aExtraState    The extra state bits that are wanted.
  * @param aAbsentState   State bits that are not wanted.
  */
-function testStatesInSubtree(aAccOrElmOrID, aState, aExtraState, aAbsentState)
-{
+function testStatesInSubtree(aAccOrElmOrID, aState, aExtraState, aAbsentState) {
   // test accessible and its subtree for propagated states.
   var acc = getAccessible(aAccOrElmOrID);
   if (!acc)
     return;
 
   if (getRole(acc) != ROLE_TEXT_LEAF)
     // Right now, text leafs don't get tested because the states are not being
     // propagated.
@@ -197,60 +195,55 @@ function testStatesInSubtree(aAccOrElmOr
       testStatesInSubtree(childAcc, aState, aExtraState, aAbsentState);
     }
   }
 }
 
 /**
  * Fails if no defunct state on the accessible.
  */
-function testIsDefunct(aAccessible, aTestName)
-{
+function testIsDefunct(aAccessible, aTestName) {
   var id = prettyName(aAccessible) + (aTestName ? " [" + aTestName + "]" : "");
   var [/* state*/, extraState] = getStates(aAccessible);
   isState(extraState & EXT_STATE_DEFUNCT, EXT_STATE_DEFUNCT, true,
           "no defuct state for " + id + "!");
 }
 
-function getStringStates(aAccOrElmOrID)
-{
+function getStringStates(aAccOrElmOrID) {
   var [state, extraState] = getStates(aAccOrElmOrID);
   return statesToString(state, extraState);
 }
 
-function getStates(aAccOrElmOrID)
-{
+function getStates(aAccOrElmOrID) {
   var acc = getAccessible(aAccOrElmOrID);
   if (!acc)
     return [0, 0];
 
   var state = {}, extraState = {};
   acc.getState(state, extraState);
 
   return [state.value, extraState.value];
 }
 
 /**
  * Return true if the accessible has given states.
  */
-function hasState(aAccOrElmOrID, aState, aExtraState)
-{
+function hasState(aAccOrElmOrID, aState, aExtraState) {
   var [state, exstate] = getStates(aAccOrElmOrID);
   return (aState ? state & aState : true) &&
     (aExtraState ? exstate & aExtraState : true);
 }
 
 // //////////////////////////////////////////////////////////////////////////////
 // Private implementation details
 
 /**
  * Analogy of SimpleTest.is function used to compare states.
  */
-function isState(aState1, aState2, aIsExtraStates, aMsg)
-{
+function isState(aState1, aState2, aIsExtraStates, aMsg) {
   if (aState1 == aState2) {
     ok(true, aMsg);
     return;
   }
 
   var got = "0";
   if (aState1) {
     got = statesToString(aIsExtraStates ? 0 : aState1,
--- a/accessible/tests/mochitest/states/test_aria.html
+++ b/accessible/tests/mochitest/states/test_aria.html
@@ -22,18 +22,17 @@
   <script type="application/javascript"
           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 testAriaDisabledTree(aAccOrElmOrID)
-    {
+    function testAriaDisabledTree(aAccOrElmOrID) {
       // test accessible and its subtree for propagated state.
       var acc = getAccessible(aAccOrElmOrID);
       if (!acc)
         return;
 
       var [state, /*extraState*/] = getStates(aAccOrElmOrID);
       if (state & STATE_UNAVAILABLE) {
         var role = getRole(acc);
@@ -52,18 +51,17 @@
       if (children) {
         for (var i = 0; i < children.length; i++) {
           var childAcc = children.queryElementAt(i, nsIAccessible);
           testAriaDisabledTree(childAcc);
         }
       }
     }
 
-    function doTest()
-    {
+    function doTest() {
       // aria_autocomplete
       testStates("textbox_autocomplete_inline", 0, EXT_STATE_SUPPORTS_AUTOCOMPLETION);
       testStates("textbox_autocomplete_list", STATE_HASPOPUP, EXT_STATE_SUPPORTS_AUTOCOMPLETION);
       testStates("textbox_autocomplete_both", STATE_HASPOPUP, EXT_STATE_SUPPORTS_AUTOCOMPLETION);
       testStates("combobox_autocomplete_inline", STATE_HASPOPUP, EXT_STATE_SUPPORTS_AUTOCOMPLETION);
       testStates("combobox_autocomplete_list", STATE_HASPOPUP, EXT_STATE_SUPPORTS_AUTOCOMPLETION);
       testStates("combobox_autocomplete_both", STATE_HASPOPUP, EXT_STATE_SUPPORTS_AUTOCOMPLETION);
 
--- a/accessible/tests/mochitest/states/test_aria_imgmap.html
+++ b/accessible/tests/mochitest/states/test_aria_imgmap.html
@@ -15,23 +15,21 @@
           src="../role.js"></script>
   <script type="application/javascript"
           src="../events.js"></script>
   <script type="application/javascript"
           src="../states.js"></script>
 
   <script type="application/javascript">
   // gA11yEventDumpToConsole = true;
-  function doPreTest()
-  {
+  function doPreTest() {
     waitForImageMap("imagemap", doTest);
   }
 
-  function doTest()
-  {
+  function doTest() {
     var imageMap = getAccessible("imagemap");
 
     var t1 = imageMap.getChildAt(0);
     testStates(t1, 0, EXT_STATE_EDITABLE, STATE_LINKED);
     var t2 = imageMap.getChildAt(1);
     testStates(t2, 0, EXT_STATE_EDITABLE, STATE_LINKED);
     var rb1 = imageMap.getChildAt(2);
     testStates(rb1, (STATE_CHECKABLE | STATE_CHECKED), 0, STATE_LINKED);
--- a/accessible/tests/mochitest/states/test_aria_widgetitems.html
+++ b/accessible/tests/mochitest/states/test_aria_widgetitems.html
@@ -15,74 +15,65 @@
   <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 focusARIAItem(aID, aIsSelected)
-    {
+    function focusARIAItem(aID, aIsSelected) {
       this.DOMNode = getNode(aID);
 
-      this.invoke = function focusARIAItem_invoke()
-      {
+      this.invoke = function focusARIAItem_invoke() {
         this.DOMNode.focus();
       }
 
-      this.check = function focusARIAItem_check(aEvent)
-      {
+      this.check = function focusARIAItem_check(aEvent) {
         testStates(this.DOMNode, aIsSelected ? STATE_SELECTED : 0, 0,
                    aIsSelected ? 0 : STATE_SELECTED);
       }
 
-      this.getID = function focusARIAItem_getID()
-      {
+      this.getID = function focusARIAItem_getID() {
         return "Focused ARIA widget item with aria-selected='" +
                 (aIsSelected ? "true', should" : "false', shouldn't") +
                 " have selected state on " + prettyName(aID);
       }
     }
 
-    function focusActiveDescendantItem(aItemID, aWidgetID, aIsSelected)
-    {
+    function focusActiveDescendantItem(aItemID, aWidgetID, aIsSelected) {
       this.DOMNode = getNode(aItemID);
       this.widgetDOMNode = getNode(aWidgetID);
 
-      this.invoke = function focusActiveDescendantItem_invoke()
-      {
+      this.invoke = function focusActiveDescendantItem_invoke() {
         this.widgetDOMNode.setAttribute("aria-activedescendant", aItemID);
         this.widgetDOMNode.focus();
       }
 
-      this.check = function focusActiveDescendantItem_check(aEvent)
-      {
+      this.check = function focusActiveDescendantItem_check(aEvent) {
         testStates(this.DOMNode, aIsSelected ? STATE_SELECTED : 0, 0,
                    aIsSelected ? 0 : STATE_SELECTED);
       }
 
-      this.getID = function tabActiveDescendant_getID()
-      {
+      this.getID = function tabActiveDescendant_getID() {
         return "ARIA widget item managed by activedescendant " +
                 (aIsSelected ? "should" : "shouldn't") +
                 " have the selected state on " + prettyName(aItemID);
       }
     }
 
     // //////////////////////////////////////////////////////////////////////////
     // Test
 
     // gA11yEventDumpID = "eventdump"; // debug stuff
     // gA11yEventDumpToConsole = true;
 
     var gQueue = null;
 
-    function doTest()
-    {
+    function doTest() {
       // aria-selected
       testStates("aria_tab1", 0, 0, STATE_SELECTED);
       testStates("aria_tab2", STATE_SELECTED);
       testStates("aria_tab3", 0, 0, STATE_SELECTED);
       testStates("aria_option1", 0, 0, STATE_SELECTED);
       testStates("aria_option2", STATE_SELECTED);
       testStates("aria_option3", 0, 0, STATE_SELECTED);
       testStates("aria_treeitem1", 0, 0, STATE_SELECTED);
--- a/accessible/tests/mochitest/states/test_buttons.html
+++ b/accessible/tests/mochitest/states/test_buttons.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="../states.js"></script>
 
   <script type="application/javascript">
-  function doTest()
-  {
+  function doTest() {
     // Default state.
     testStates("f1_image", STATE_DEFAULT | STATE_FOCUSABLE);
     testStates("f2_submit", STATE_DEFAULT | STATE_FOCUSABLE);
     testStates("f3_submitbutton", STATE_DEFAULT | STATE_FOCUSABLE);
     testStates("f3_disabled_reset", STATE_UNAVAILABLE, 0, STATE_FOCUSABLE, 0);
     testStates("f4_button", STATE_FOCUSABLE, 0, STATE_DEFAULT);
     testStates("f4_disabled_button", STATE_UNAVAILABLE, 0, STATE_FOCUSABLE, 0);
     testStates("f4_image1", STATE_DEFAULT | STATE_FOCUSABLE);
--- a/accessible/tests/mochitest/states/test_controls.html
+++ b/accessible/tests/mochitest/states/test_controls.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="../states.js"></script>
 
   <script type="application/javascript">
-  function doTest()
-  {
+  function doTest() {
     // Undetermined progressbar (no value or aria-value attribute): mixed state
     testStates("progress", STATE_MIXED);
     // Determined progressbar (has value): shouldn't have mixed state
     testStates("progress2", 0, 0, STATE_MIXED);
     // Determined progressbar (has aria-value): shouldn't have mixed state
     // testStates("progress3", 0, 0, STATE_MIXED);
     todo(false, "we should respect ARIA");
 
--- a/accessible/tests/mochitest/states/test_doc.html
+++ b/accessible/tests/mochitest/states/test_doc.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="../states.js"></script>
 
   <script type="application/javascript">
-    function doTest()
-    {
+    function doTest() {
       // Bug 566542: root accesible should expose active state when focused.
       testStates(getRootAccessible(), 0, EXT_STATE_ACTIVE);
 
       // Bug 509696, 607219.
       testStates(document, STATE_READONLY, 0); // role=""
 
       document.body.setAttribute("role","banner"); // no platform mapping
       testStates(document, STATE_READONLY);
--- a/accessible/tests/mochitest/states/test_doc_busy.html
+++ b/accessible/tests/mochitest/states/test_doc_busy.html
@@ -17,44 +17,40 @@
   <script type="application/javascript"
           src="../states.js"></script>
   <script type="application/javascript"
           src="../events.js"></script>
 
   <script type="application/javascript">
     // gA11yEventDumpToConsole = true; // debugging stuff
 
-    function loadFile()
-    {
+    function loadFile() {
       var eventSeq = [
         new stateChangeChecker(STATE_BUSY, false, true, document, null, false, true),
         new stateChangeChecker(STATE_BUSY, false, false, document)
       ];
       defineScenario(this, eventSeq); // both events were fired
 
       var unexpectedEventSeq = [
         new stateChangeChecker(STATE_BUSY, false, true, document),
         new stateChangeChecker(STATE_BUSY, false, false, document)
       ];
       defineScenario(this, [], unexpectedEventSeq); // events were coalesced
 
-      this.invoke = function loadFile_invoke()
-      {
+      this.invoke = function loadFile_invoke() {
         synthesizeMouse(getNode("link"), 1, 1, {});
       }
 
-      this.getID = function loadFile_getID()
-      {
+      this.getID = function loadFile_getID() {
         return "load file: state busy change events on document";
       }
     }
 
     var gQueue = null;
-    function doTest()
-    {
+    function doTest() {
       // State busy change event on file loading.
       // enableLogging("docload"); // debugging
       gQueue = new eventQueue();
       gQueue.push(new loadFile());
       // gQueue.onFinish = function() { disableLogging(); } // debugging
       gQueue.invoke(); // Will call SimpleTest.finish();
     }
 
--- a/accessible/tests/mochitest/states/test_docarticle.html
+++ b/accessible/tests/mochitest/states/test_docarticle.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="../states.js"></script>
 
   <script type="application/javascript">
-    function doTest()
-    {
+    function doTest() {
       var docAcc = getAccessible(document, [nsIAccessibleDocument]);
       if (docAcc) {
         testStates(docAcc, STATE_READONLY);
         testStates("aria_article", STATE_READONLY);
         testStates("editable_aria_article", 0, EXT_STATE_EDITABLE,
                    STATE_READONLY);
         testStates("article", STATE_READONLY);
         testStates("editable_article", 0, EXT_STATE_EDITABLE, STATE_READONLY);
--- a/accessible/tests/mochitest/states/test_editablebody.html
+++ b/accessible/tests/mochitest/states/test_editablebody.html
@@ -13,18 +13,17 @@ https://bugzilla.mozilla.org/show_bug.cg
   <script type="application/javascript"
           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() {
       testStates(document, 0, EXT_STATE_EDITABLE);
       testStates("p", 0, EXT_STATE_EDITABLE);
 
       SimpleTest.finish();
     }
 
     SimpleTest.waitForExplicitFinish();
     addA11yLoadEvent(doTest);
--- a/accessible/tests/mochitest/states/test_frames.html
+++ b/accessible/tests/mochitest/states/test_frames.html
@@ -16,18 +16,17 @@
   <script type="application/javascript"
           src="../states.js"></script>
 
   <script type="application/javascript">
     if (navigator.platform.startsWith("Win")) {
       SimpleTest.expectAssertions(0, 2);
     }
 
-    function doTest()
-    {
+    function doTest() {
       frameDoc = document.getElementById("frame_doc").contentDocument;
       frameDocArticle = document.getElementById("frame_doc_article").contentDocument;
       frameDocCheckbox = document.getElementById("frame_doc_checkbox").contentDocument;
       frameDocTextbox = document.getElementById("frame_doc_textbox").contentDocument;
 
       testStates(frameDoc, STATE_READONLY, 0, 0, 0,
                  "test1: frameDoc");
       testStates(frameDocArticle, STATE_READONLY, 0, 0, 0,
--- a/accessible/tests/mochitest/states/test_inputs.html
+++ b/accessible/tests/mochitest/states/test_inputs.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="../states.js"></script>
 
   <script type="application/javascript">
-  function doTest()
-  {
+  function doTest() {
     // //////////////////////////////////////////////////////////////////////////
     // 'editable' and 'multiline' states.
     testStates("input", 0, EXT_STATE_EDITABLE, 0, EXT_STATE_MULTI_LINE);
     testStates("textarea", 0, EXT_STATE_EDITABLE | EXT_STATE_MULTI_LINE);
 
     testStates("input_readonly", 0, EXT_STATE_EDITABLE);
     testStates("input_disabled", 0, EXT_STATE_EDITABLE);
     testStates("textarea_readonly", 0, EXT_STATE_EDITABLE);
--- a/accessible/tests/mochitest/states/test_link.html
+++ b/accessible/tests/mochitest/states/test_link.html
@@ -16,18 +16,17 @@
   <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 doTest()
-    {
+    function doTest() {
       // a@href and its text node
       testStates("link_href", STATE_LINKED);
       testStates(getAccessible("link_href").firstChild, STATE_LINKED);
 
       // a@onclick
       testStates("link_click", STATE_LINKED);
 
       // a@onmousedown
--- a/accessible/tests/mochitest/states/test_selects.html
+++ b/accessible/tests/mochitest/states/test_selects.html
@@ -15,52 +15,47 @@
   <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 openComboboxNCheckStates(aID)
-    {
+    function openComboboxNCheckStates(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 openComboboxNCheckStates_invoke()
-      {
+      this.invoke = function openComboboxNCheckStates_invoke() {
         getNode(aID).focus();
         synthesizeKey("VK_DOWN", { altKey: true });
       }
 
-      this.finalCheck = function openComboboxNCheckStates_invoke()
-      {
+      this.finalCheck = function openComboboxNCheckStates_invoke() {
         // Expanded state on combobox.
         testStates(this.combobox, STATE_EXPANDED);
 
         // Floating state on combobox list.
         testStates(this.comboboxList, STATE_FLOATING);
       }
 
-      this.getID = function openComboboxNCheckStates_getID()
-      {
+      this.getID = function openComboboxNCheckStates_getID() {
         return "open combobox and test states";
       }
     }
 
     // gA11yEventDumpToConsole = true;
 
     var gQueue = null;
-    function doTest()
-    {
+    function doTest() {
       // combobox
       var combobox = getAccessible("combobox");
       testStates(combobox,
                  STATE_HASPOPUP | STATE_COLLAPSED | STATE_FOCUSABLE, 0,
                  STATE_FOCUSED, 0);
 
       var comboboxList = combobox.firstChild;
       testStates(comboboxList, STATE_INVISIBLE, 0, STATE_FOCUSABLE, 0);
--- a/accessible/tests/mochitest/states/test_stale.html
+++ b/accessible/tests/mochitest/states/test_stale.html
@@ -13,83 +13,73 @@
   <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 addChild(aContainerID)
-    {
+    function addChild(aContainerID) {
       this.containerNode = getNode(aContainerID);
       this.childNode = null;
 
       this.eventSeq = [
         new invokerChecker(EVENT_REORDER, this.containerNode)
       ];
 
-      this.invoke = function addChild_invoke()
-      {
+      this.invoke = function addChild_invoke() {
         this.childNode = document.createElement("div");
         this.containerNode.appendChild(this.childNode);
       }
 
-      this.finalCheck = function addChild_finalCheck()
-      {
+      this.finalCheck = function addChild_finalCheck() {
         // no stale state should be set
         testStates(this.childNode, 0, 0, 0, EXT_STATE_STALE);
       }
 
-      this.getID = function addChild_getID()
-      {
+      this.getID = function addChild_getID() {
         return "add child for " + prettyName(aContainerID);
       }
     }
 
-    function removeChildChecker(aInvoker)
-    {
+    function removeChildChecker(aInvoker) {
       this.type = EVENT_HIDE;
       this.__defineGetter__("target", function() { return aInvoker.child; });
 
-      this.check = function removeChildChecker_check()
-      {
+      this.check = function removeChildChecker_check() {
         // stale state should be set
         testStates(aInvoker.child, 0, EXT_STATE_STALE);
       }
     }
 
-    function removeChild(aContainerID)
-    {
+    function removeChild(aContainerID) {
       this.containerNode = getNode(aContainerID);
       this.child = null;
 
       this.eventSeq = [
         new removeChildChecker(this)
       ];
 
-      this.invoke = function removeChild_invoke()
-      {
+      this.invoke = function removeChild_invoke() {
         var childNode = this.containerNode.firstChild;
         this.child = getAccessible(childNode);
 
         this.containerNode.removeChild(childNode);
       }
 
-      this.getID = function removeChild_getID()
-      {
+      this.getID = function removeChild_getID() {
         return "remove child from " + prettyName(aContainerID);
       }
     }
 
     // gA11yEventDumpToConsole = true; //debugging
 
     var gQueue = null;
-    function doTest()
-    {
+    function doTest() {
       gQueue = new eventQueue();
 
       gQueue.push(new addChild("container"));
       gQueue.push(new removeChild("container"));
 
       gQueue.invoke(); // will call SimpleTest.finish()
     }
 
--- a/accessible/tests/mochitest/states/test_visibility.html
+++ b/accessible/tests/mochitest/states/test_visibility.html
@@ -13,18 +13,17 @@
   <script type="application/javascript"
           src="../role.js"></script>
   <script type="application/javascript"
           src="../states.js"></script>
   
   <script type="application/javascript">
     // Tests
 
-    function doTests()
-    {
+    function doTests() {
       testStates("div", 0, 0, STATE_INVISIBLE | STATE_OFFSCREEN);
       testStates("div_off", STATE_OFFSCREEN, 0, STATE_INVISIBLE);
       testStates("div_transformed", STATE_OFFSCREEN, 0, STATE_INVISIBLE);
       testStates("div_abschild", 0, 0, STATE_INVISIBLE | STATE_OFFSCREEN);
 
       SimpleTest.finish();
     }
 
--- a/accessible/tests/mochitest/states/z_frames_update.html
+++ b/accessible/tests/mochitest/states/z_frames_update.html
@@ -1,13 +1,12 @@
 <html>
 <head>
 <script>
-function replaceBody()
-{
+function replaceBody() {
   var accService = Components.classes["@mozilla.org/accessibilityService;1"].
     getService(Components.interfaces.nsIAccessibilityService);
   accService.getAccessibleFor(document);
 
   var newBody = document.createElement("body");
   newBody.setAttribute("contentEditable", "true");
   newBody.textContent = "New Hello";
   document.documentElement.replaceChild(newBody, document.body);
--- a/accessible/tests/mochitest/table.js
+++ b/accessible/tests/mochitest/table.js
@@ -43,18 +43,17 @@ const kMathTable = 2;
  * @param  aColHeaderType  [in] specifies wether column header cells are
  *                          arranged into the list.
  * @param  aCaption        [in] caption text if any
  * @param  aSummary        [in] summary text if any
  * @param  aTableType      [in] specifies the table type.
  * @param  aRowRoles       [in] array of row roles.
  */
 function testTableStruct(aIdentifier, aCellsArray, aColHeaderType,
-                         aCaption, aSummary, aTableType, aRowRoles)
-{
+                         aCaption, aSummary, aTableType, aRowRoles) {
   var tableNode = getNode(aIdentifier);
   var isGrid = tableNode.getAttribute("role") == "grid" ||
     tableNode.getAttribute("role") == "treegrid" ||
     tableNode.localName == "tree";
 
   var rowCount = aCellsArray.length;
   var colsCount = aCellsArray[0] ? aCellsArray[0].length : 0;
 
@@ -210,18 +209,17 @@ function testTableStruct(aIdentifier, aC
 }
 
 /**
  * Test table indexes.
  *
  * @param  aIdentifier  [in] table accessible identifier
  * @param  aIdxes       [in] two dimensional array of cell indexes
  */
-function testTableIndexes(aIdentifier, aIdxes)
-{
+function testTableIndexes(aIdentifier, aIdxes) {
   var tableAcc = getAccessible(aIdentifier, [nsIAccessibleTable]);
   if (!tableAcc)
     return;
 
   var obtainedRowIdx, obtainedColIdx, obtainedIdx;
   var cellAcc;
 
   var id = prettyName(aIdentifier);
@@ -358,18 +356,17 @@ function testTableIndexes(aIdentifier, a
  * Test table getters selection methods.
  *
  * @param  aIdentifier  [in] table accessible identifier
  * @param  aCellsArray  [in] two dimensional array (row X columns) of cells
  *                       states (either boolean (selected/unselected) if cell is
  *                       origin, otherwise kRowSpanned or kColSpanned constant).
  * @param  aMsg         [in] text appended before every message
  */
-function testTableSelection(aIdentifier, aCellsArray, aMsg)
-{
+function testTableSelection(aIdentifier, aCellsArray, aMsg) {
   var msg = aMsg ? aMsg : "";
   var acc = getAccessible(aIdentifier, [nsIAccessibleTable]);
   if (!acc)
     return;
 
   var rowCount = aCellsArray.length;
   var colsCount = aCellsArray[0].length;
 
@@ -525,18 +522,17 @@ function testTableSelection(aIdentifier,
         testStates(cell, STATE_SELECTABLE, 0, STATE_SELECTED);
     }
   }
 }
 
 /**
  * Test unselectColumn method of accessible table.
  */
-function testUnselectTableColumn(aIdentifier, aColIdx, aCellsArray)
-{
+function testUnselectTableColumn(aIdentifier, aColIdx, aCellsArray) {
   var acc = getAccessible(aIdentifier, [nsIAccessibleTable]);
   if (!acc)
     return;
 
   var rowCount = aCellsArray.length;
   for (var rowIdx = 0; rowIdx < rowCount; rowIdx++) {
     // Unselect origin cell.
     var [origRowIdx, origColIdx] =
@@ -547,18 +543,17 @@ function testUnselectTableColumn(aIdenti
   acc.unselectColumn(aColIdx);
   testTableSelection(aIdentifier, aCellsArray,
                      "Unselect " + aColIdx + " column: ");
 }
 
 /**
  * Test selectColumn method of accessible table.
  */
-function testSelectTableColumn(aIdentifier, aColIdx, aCellsArray)
-{
+function testSelectTableColumn(aIdentifier, aColIdx, aCellsArray) {
   var acc = getAccessible(aIdentifier, [nsIAccessibleTable]);
   if (!acc)
     return;
 
   var rowCount = aCellsArray.length;
   var colsCount = aCellsArray[0].length;
 
   for (var rowIdx = 0; rowIdx < rowCount; rowIdx++) {
@@ -605,18 +600,17 @@ function testSelectTableColumn(aIdentifi
   acc.selectColumn(aColIdx);
   testTableSelection(aIdentifier, aCellsArray,
                      "Select " + aColIdx + " column: ");
 }
 
 /**
  * Test unselectRow method of accessible table.
  */
-function testUnselectTableRow(aIdentifier, aRowIdx, aCellsArray)
-{
+function testUnselectTableRow(aIdentifier, aRowIdx, aCellsArray) {
   var acc = getAccessible(aIdentifier, [nsIAccessibleTable]);
   if (!acc)
     return;
 
   var colsCount = aCellsArray[0].length;
   for (var colIdx = 0; colIdx < colsCount; colIdx++) {
     // Unselect origin cell.
     var [origRowIdx, origColIdx] = getOrigRowAndColumn(aCellsArray,
@@ -627,18 +621,17 @@ function testUnselectTableRow(aIdentifie
   acc.unselectRow(aRowIdx);
   testTableSelection(aIdentifier, aCellsArray,
                      "Unselect " + aRowIdx + " row: ");
 }
 
 /**
  * Test selectRow method of accessible table.
  */
-function testSelectTableRow(aIdentifier, aRowIdx, aCellsArray)
-{
+function testSelectTableRow(aIdentifier, aRowIdx, aCellsArray) {
   var acc = getAccessible(aIdentifier, [nsIAccessibleTable]);
   if (!acc)
     return;
 
   var rowCount = aCellsArray.length;
   var colsCount = aCellsArray[0].length;
 
   for (var rowIdx = 0; rowIdx < rowCount; rowIdx++) {
@@ -686,18 +679,17 @@ function testSelectTableRow(aIdentifier,
   acc.selectRow(aRowIdx);
   testTableSelection(aIdentifier, aCellsArray,
                      "Select " + aRowIdx + " row: ");
 }
 
 /**
  * Test columnHeaderCells and rowHeaderCells of accessible table.
  */
-function testHeaderCells(aHeaderInfoMap)
-{
+function testHeaderCells(aHeaderInfoMap) {
   for (var testIdx = 0; testIdx < aHeaderInfoMap.length; testIdx++) {
     var dataCellIdentifier = aHeaderInfoMap[testIdx].cell;
     var dataCell = getAccessible(dataCellIdentifier, [nsIAccessibleTableCell]);
 
     // row header cells
     var rowHeaderCells = aHeaderInfoMap[testIdx].rowHeaderCells;
     var rowHeaderCellsCount = rowHeaderCells.length;
     var actualRowHeaderCells = dataCell.rowHeaderCells;
@@ -742,18 +734,17 @@ function testHeaderCells(aHeaderInfoMap)
 }
 
 // //////////////////////////////////////////////////////////////////////////////
 // private implementation
 
 /**
  * Return row and column of orig cell for the given spanned cell.
  */
-function getOrigRowAndColumn(aCellsArray, aRowIdx, aColIdx)
-{
+function getOrigRowAndColumn(aCellsArray, aRowIdx, aColIdx) {
   var cellState = aCellsArray[aRowIdx][aColIdx];
 
   var origRowIdx = aRowIdx, origColIdx = aColIdx;
   if (cellState & kRowSpanned) {
     for (var prevRowIdx = aRowIdx - 1; prevRowIdx >= 0; prevRowIdx--) {
       var prevCellState = aCellsArray[prevRowIdx][aColIdx];
       if (!(prevCellState & kRowSpanned)) {
         origRowIdx = prevRowIdx;
--- a/accessible/tests/mochitest/table/test_css_tables.html
+++ b/accessible/tests/mochitest/table/test_css_tables.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">
 
-    function doTest()
-    {
+    function doTest() {
       // ////////////////////////////////////////////////////////////////////////
       // elements with display:table
 
       // only display:table
       var accTree =
         { SECTION: [
           { TEXT_LEAF: [ ] }
         ] };
--- a/accessible/tests/mochitest/table/test_headers_ariagrid.html
+++ b/accessible/tests/mochitest/table/test_headers_ariagrid.html
@@ -11,18 +11,17 @@
 
   <script type="application/javascript"
           src="../common.js"></script>
   <script type="application/javascript"
           src="../table.js"></script>
 
   <script type="application/javascript">
 
-    function doTest()
-    {
+    function doTest() {
       // ////////////////////////////////////////////////////////////////////////
       // column and row headers from markup
 
       headerInfoMap = [
         {
           cell: "table_dc_1",
           rowHeaderCells: [ "table_rh_1" ],
           columnHeaderCells: [ "table_ch_2" ]
--- a/accessible/tests/mochitest/table/test_headers_ariatable.html
+++ b/accessible/tests/mochitest/table/test_headers_ariatable.html
@@ -11,18 +11,17 @@
 
   <script type="application/javascript"
           src="../common.js"></script>
   <script type="application/javascript"
           src="../table.js"></script>
 
   <script type="application/javascript">
 
-    function doTest()
-    {
+    function doTest() {
       // ////////////////////////////////////////////////////////////////////////
       // column and row headers from markup
 
       headerInfoMap = [
         {
           cell: "table_dc_1",
           rowHeaderCells: [ "table_rh_1" ],
           columnHeaderCells: [ "table_ch_2" ]
--- a/accessible/tests/mochitest/table/test_headers_table.html
+++ b/accessible/tests/mochitest/table/test_headers_table.html
@@ -11,18 +11,17 @@
 
   <script type="application/javascript"
           src="../common.js"></script>
   <script type="application/javascript"
           src="../table.js"></script>
 
   <script type="application/javascript">
 
-    function doTest()
-    {
+    function doTest() {
       // ////////////////////////////////////////////////////////////////////////
       // column header from thead and row header from @scope inside of tfoot
 
       var headerInfoMap = [
         {
           cell: "table1_cell_1",
           rowHeaderCells: [],
           columnHeaderCells: [ "table1_weekday", "table1_date" ]
--- a/accessible/tests/mochitest/table/test_indexes_ariagrid.html
+++ b/accessible/tests/mochitest/table/test_indexes_ariagrid.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="../table.js"></script>
 
   <script type="application/javascript">
-    function doTest()
-    {
+    function doTest() {
       // ////////////////////////////////////////////////////////////////////////
       // ARIA grid
       var idxes = [
         [0, 1, 2],
         [3, 4, 5],
         [6, 7, 8],
         [9, 10, 11]
       ];
--- a/accessible/tests/mochitest/table/test_indexes_table.html
+++ b/accessible/tests/mochitest/table/test_indexes_table.html
@@ -12,18 +12,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="../table.js"></script>
 
   <script type="application/javascript">
-    function doTest()
-    {
+    function doTest() {
       // ////////////////////////////////////////////////////////////////////////
       // table
       var idxes = [
         [0, 1, 2],
         [3, 4, 5],
         [6, 7, 7],
         [6, 8, 9]
       ];
--- a/accessible/tests/mochitest/table/test_layoutguess.html
+++ b/accessible/tests/mochitest/table/test_layoutguess.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="../attributes.js"></script>
 
   <script type="application/javascript">
-    function doTest()
-    {
+    function doTest() {
       // Attribute we're looking for
       var attr = {
         "layout-guess": "true"
       };
 
       // table with role of grid
       testAbsentAttrs("table1", attr);
       // table with role of grid and datatable="0"
--- a/accessible/tests/mochitest/table/test_mtable.html
+++ b/accessible/tests/mochitest/table/test_mtable.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="../table.js"></script>
 
   <script type="application/javascript">
-    function doTest()
-    {
+    function doTest() {
       // 'Simple' table
       var idxes = [
         [0, 1],
         [2, 3]
       ];
       testTableIndexes("simple", idxes);
       var cellsArray = [
         [kDataCell, kDataCell],
--- a/accessible/tests/mochitest/table/test_sels_ariagrid.html
+++ b/accessible/tests/mochitest/table/test_sels_ariagrid.html
@@ -16,18 +16,17 @@ https://bugzilla.mozilla.org/show_bug.cg
   <script type="application/javascript"
           src="../role.js"></script>
   <script type="application/javascript"
           src="../states.js"></script>
   <script type="application/javascript"
           src="../table.js"></script>
 
   <script type="application/javascript">
-    function doTest()
-    {
+    function doTest() {
       // ////////////////////////////////////////////////////////////////////////
       // ARIA grid
       var cellsArray =
       [
         [ true, true,  false, true],
         [ true, false, true,  true],
         [ true, false, false, true],
         [ true, true,  true,  true],
--- a/accessible/tests/mochitest/table/test_sels_table.html
+++ b/accessible/tests/mochitest/table/test_sels_table.html
@@ -15,18 +15,17 @@
           src="../role.js"></script>
   <script type="application/javascript"
           src="../states.js"></script>
   <script type="application/javascript"
           src="../table.js"></script>
 
   <script type="text/javascript">
 
-    function doTest()
-    {
+    function doTest() {
       // ////////////////////////////////////////////////////////////////////////
       // table
 
       var cellsArray =
       [
         [false, false,       false,       kColSpanned, false, false,       false, false],
         [false, false,       false,       false,       false, false,       false, kRowSpanned],
         [false, false,       kColSpanned, false,       false, false,       false, kRowSpanned],
--- a/accessible/tests/mochitest/table/test_struct_ariagrid.html
+++ b/accessible/tests/mochitest/table/test_struct_ariagrid.html
@@ -12,18 +12,17 @@
   <script type="application/javascript"
           src="../common.js"></script>
   <script type="application/javascript"
           src="../role.js"></script>
   <script type="application/javascript"
           src="../table.js"></script>
 
   <script type="application/javascript">
-    function doTest()
-    {
+    function doTest() {
       // ////////////////////////////////////////////////////////////////////////
       // Pure ARIA grid
       var cellsArray = [
         [kColHeaderCell, kColHeaderCell, kColHeaderCell],
         [kRowHeaderCell, kDataCell,      kDataCell],
         [kRowHeaderCell, kDataCell,      kDataCell]
       ];
 
--- a/accessible/tests/mochitest/table/test_struct_ariatreegrid.html
+++ b/accessible/tests/mochitest/table/test_struct_ariatreegrid.html
@@ -12,18 +12,17 @@
   <script type="application/javascript"
           src="../common.js"></script>
   <script type="application/javascript"
           src="../role.js"></script>
   <script type="application/javascript"
           src="../table.js"></script>
 
   <script type="application/javascript">
-    function doTest()
-    {
+    function doTest() {
       // ////////////////////////////////////////////////////////////////////////
       // HTML based ARIA tree grid
 
       var cellsArray = [
         [kColHeaderCell, kColHeaderCell, kColHeaderCell],
         [kDataCell,      kDataCell,      kDataCell],
         [kDataCell,      kDataCell,      kDataCell]
       ];
--- a/accessible/tests/mochitest/table/test_struct_table.html
+++ b/accessible/tests/mochitest/table/test_struct_table.html
@@ -12,18 +12,17 @@
   <script type="application/javascript"
           src="../common.js"></script>
   <script type="application/javascript"
           src="../role.js"></script>
   <script type="application/javascript"
           src="../table.js"></script>
 
   <script type="application/javascript">
-    function doTest()
-    {
+    function doTest() {
       // ////////////////////////////////////////////////////////////////////////
       // column headers from thead and tfoot
 
       cellsArray = [
         [kColHeaderCell, kColHeaderCell, kColSpanned],
         [kRowSpanned,    kColHeaderCell, kColHeaderCell],
         [kDataCell,      kDataCell,      kDataCell],
         [kColHeaderCell, kColHeaderCell, kColHeaderCell]
--- a/accessible/tests/mochitest/table/test_table_1.html
+++ b/accessible/tests/mochitest/table/test_table_1.html
@@ -6,18 +6,17 @@
   <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 doTest()
-{
+function doTest() {
   var accTable = getAccessible("table", [nsIAccessibleTable]);
 
   var s = window.getSelection();
   if (s.rangeCount > 0)
     s.removeAllRanges();
 
   var cell = getNode("col2b");
   var range = document.createRange();
--- a/accessible/tests/mochitest/table/test_table_2.html
+++ b/accessible/tests/mochitest/table/test_table_2.html
@@ -8,18 +8,17 @@
 
   <script type="application/javascript"
           src="../common.js"></script>
   <script type="application/javascript"
           src="../role.js"></script>
 
   <script type="text/javascript">
 
-function doTest()
-{
+function doTest() {
   // Test table with role=alert.
   var tableInterfaceExposed = true;
   var accTable3 = getAccessible("table3", [nsIAccessibleTable], null, DONOTFAIL_IF_NO_INTERFACE);
   if (!accTable3)
     tableInterfaceExposed = false;
   ok(tableInterfaceExposed, "table interface is not exposed");
 
   if (tableInterfaceExposed) {
--- a/accessible/tests/mochitest/test_OuterDocAccessible.html
+++ b/accessible/tests/mochitest/test_OuterDocAccessible.html
@@ -15,18 +15,17 @@ https://bugzilla.mozilla.org/show_bug.cg
           src="states.js"></script>
   <script type="application/javascript"
           src="role.js"></script>
 
   <script type="application/javascript">
     // needed error return value
     const ns_error_invalid_arg = Components.results.NS_ERROR_INVALID_ARG;
 
-    function doTest()
-    {
+    function doTest() {
       // Get accessible for body tag.
       var docAcc = getAccessible(document);
 
       if (docAcc) {
         var outerDocAcc = getAccessible(docAcc.parent);
 
         if (outerDocAcc) {
           testRole(outerDocAcc, ROLE_INTERNAL_FRAME);
--- a/accessible/tests/mochitest/test_aria_token_attrs.html
+++ b/accessible/tests/mochitest/test_aria_token_attrs.html
@@ -13,18 +13,17 @@ https://bugzilla.mozilla.org/show_bug.cg
   <script type="application/javascript"
           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() {
       // test aria-pressed state mapping to roles PUSHBUTTON vs TOGGLEBUTTON
       testRole("button_pressed_true", ROLE_TOGGLE_BUTTON);
       testRole("button_pressed_false", ROLE_TOGGLE_BUTTON);
       testRole("button_pressed_empty", ROLE_PUSHBUTTON);
       testRole("button_pressed_undefined", ROLE_PUSHBUTTON);
       testRole("button_pressed_absent", ROLE_PUSHBUTTON);
 
       // test button aria-pressed states
--- a/accessible/tests/mochitest/test_bug420863.html
+++ b/accessible/tests/mochitest/test_bug420863.html
@@ -15,18 +15,17 @@ https://bugzilla.mozilla.org/show_bug.cg
   <script type="application/javascript"
           src="events.js"></script>
   <script type="application/javascript"
           src="actions.js"></script>
 
   <script type="application/javascript">
     var gClickHandler = null;
 
-    function doTest()
-    {
+    function doTest() {
       // Actions should be exposed on any accessible having related DOM node
       // with registered 'click' event handler.
 
       // ////////////////////////////////////////////////////////////////////////
       // generic td
       var td1Acc = getAccessible("td1");
       if (!td1Acc) {
         SimpleTest.finish();
@@ -37,18 +36,17 @@ https://bugzilla.mozilla.org/show_bug.cg
            "Simple table cell shouldn't have any actions");
 
       // ////////////////////////////////////////////////////////////////////////
       // one td with 'onclick' attribute and one with registered click handler
       var td3Node = getNode("td3");
 
       // register 'click' event handler
       gClickHandler = {
-        handleEvent: function handleEvent(aEvent)
-        {
+        handleEvent: function handleEvent(aEvent) {
         }
       };
       td3Node.addEventListener("click", gClickHandler);
 
       // check actions
       var actionsArray = [
         {
           ID: "td2", // "onclick" attribute
@@ -56,18 +54,17 @@ https://bugzilla.mozilla.org/show_bug.cg
           actionIndex: 0,
           events: CLICK_EVENTS
         },
         {
           ID: td3Node,
           actionName: "click",
           actionIndex: 0,
           events: CLICK_EVENTS,
-          checkOnClickEvent: function check(aEvent)
-          {
+          checkOnClickEvent: function check(aEvent) {
             // unregister click event handler
             this.ID.removeEventListener("click", gClickHandler);
 
             // check actions
             is(getAccessible(this.ID).actionCount, 0,
                "td3 shouldn't have actions");
           }
         }
--- a/accessible/tests/mochitest/test_descr.html
+++ b/accessible/tests/mochitest/test_descr.html
@@ -7,18 +7,17 @@
   <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"
           src="name.js"></script>
 
   <script type="application/javascript">
-    function doTest()
-    {
+    function doTest() {
       // Description from aria-describedby attribute
       testDescr("img1", "aria description");
 
       // No description from @title attribute because it is used to generate
       // name.
       testDescr("img2", "");
 
       // Description from @title attribute, name is generated from @alt
--- a/accessible/tests/mochitest/test_nsIAccessibleDocument.html
+++ b/accessible/tests/mochitest/test_nsIAccessibleDocument.html
@@ -14,18 +14,17 @@ https://bugzilla.mozilla.org/show_bug.cg
           src="role.js"></script>
   <script type="application/javascript"
           src="states.js"></script>
 
   <script type="application/javascript"
           src="chrome://mochikit/content/chrome-harness.js"></script>
 
   <script type="application/javascript">
-    function doTest()
-    {
+    function doTest() {
       var docAcc = getAccessible(document, [nsIAccessibleDocument]);
       if (docAcc) {
         // nsIAccessible
         is(docAcc.name, "nsIAccessibleDocument chrome tests",
            "Name for document accessible not correct!");
 
         testRole(docAcc, ROLE_DOCUMENT);
 
--- a/accessible/tests/mochitest/test_nsIAccessibleImage.html
+++ b/accessible/tests/mochitest/test_nsIAccessibleImage.html
@@ -15,18 +15,17 @@ https://bugzilla.mozilla.org/show_bug.cg
   <script type="application/javascript"
           src="role.js"></script>
   <script type="application/javascript"
           src="attributes.js"></script>
   <script type="application/javascript"
           src="layout.js"></script>
 
   <script type="application/javascript">
-    function testCoordinates(aID, aAcc, aWidth, aHeight)
-    {
+    function testCoordinates(aID, aAcc, aWidth, aHeight) {
       var screenX = {}, screenY = {}, windowX = {}, windowY = {}, parentX = {},
           parentY = {};
 
       // get screen coordinates.
       aAcc.getImagePosition(
                nsIAccessibleCoordinateType.COORDTYPE_SCREEN_RELATIVE,
                screenX, screenY);
       // get window coordinates.
@@ -75,18 +74,17 @@ https://bugzilla.mozilla.org/show_bug.cg
       var [expected_w, expected_h] = CSSToDevicePixels(window, aWidth, aHeight);
       var width = {}, height = {};
       aAcc.getImageSize(width, height);
       is(width.value, expected_w, "Wrong width for " + aID + "!");
       is(height.value, expected_h, "wrong height for " + aID + "!");
     }
 
     function testThis(aID, aSRC, aWidth, aHeight,
-                      aActionCount, aActionNames)
-    {
+                      aActionCount, aActionNames) {
       var acc = getAccessible(aID, [nsIAccessibleImage]);
       if (!acc)
         return;
 
       // Test role
       testRole(aID, ROLE_GRAPHIC);
 
       // test coordinates and size
@@ -102,18 +100,17 @@ https://bugzilla.mozilla.org/show_bug.cg
       if (actionCount) {
         for (index = 0; index < aActionNames.length; index++) {
           is(acc.getActionName(index), aActionNames[index],
              "Wrong action name for " + aID + ", index " + index + "!");
         }
       }
     }
 
-    function doTest()
-    {
+    function doTest() {
       // Test non-linked image
       testThis("nonLinkedImage", "moz.png", 89, 38);
 
       // Test linked image
       var actionNamesArray = ["jump"];
       testThis("linkedImage", "moz.png", 89, 38, 1,
                actionNamesArray);
 
--- a/accessible/tests/mochitest/text.js
+++ b/accessible/tests/mochitest/text.js
@@ -18,18 +18,17 @@ const kOk = 2; // a test doesn't fail
 
 /**
  * Test characterCount for the given array of accessibles.
  *
  * @param aCount    [in] the expected character count
  * @param aIDs      [in] array of accessible identifiers to test
  * @param aTodoFlag [in, optional] either kOk or kTodo
  */
-function testCharacterCount(aIDs, aCount, aTodoFlag)
-{
+function testCharacterCount(aIDs, aCount, aTodoFlag) {
   var ids = (aIDs instanceof Array) ? aIDs : [ aIDs ];
   var isFunc = (aTodoFlag == kTodo) ? todo_is : is;
   for (var i = 0; i < ids.length; i++) {
     var textacc = getAccessible(ids[i], [nsIAccessibleText]);
     isFunc(textacc.characterCount, aCount,
            "Wrong character count for " + prettyName(ids[i]));
   }
 }
@@ -38,18 +37,17 @@ function testCharacterCount(aIDs, aCount
  * Test text between two given offsets.
  *
  * @param aIDs          [in] an array of accessible IDs to test
  * @param aStartOffset  [in] the start offset within the text to test
  * @param aEndOffset    [in] the end offset up to which the text is tested
  * @param aText         [in] the expected result from the test
  * @param aTodoFlag     [in, optional] either kOk or kTodo
  */
-function testText(aIDs, aStartOffset, aEndOffset, aText, aTodoFlag)
-{
+function testText(aIDs, aStartOffset, aEndOffset, aText, aTodoFlag) {
   var ids = (aIDs instanceof Array) ? aIDs : [ aIDs ];
   var isFunc = (aTodoFlag == kTodo) ? todo_is : is;
   for (var i = 0; i < ids.length; i++) {
     var acc = getAccessible(ids[i], nsIAccessibleText);
     try {
       isFunc(acc.getText(aStartOffset, aEndOffset), aText,
              "getText: wrong text between start and end offsets '" +
              aStartOffset + "', '" + aEndOffset + " for '" +
@@ -68,20 +66,18 @@ function testText(aIDs, aStartOffset, aE
  * @param aIDs          [in] an array of accessible IDs to test
  * @param aStartOffset  [in] the start offset within the text to test
  * @param aEndOffset    [in] the end offset up to which the text is tested
  * @param aText         [in] the expected result from the test
  *
  * @note  All this function does is test that getText doe snot expose the
  *        password text itself, but something else.
  */
-function testPasswordText(aIDs, aStartOffset, aEndOffset, aText)
-{
-  for (var i = 0; i < aIDs.length; i++)
-  {
+function testPasswordText(aIDs, aStartOffset, aEndOffset, aText) {
+  for (var i = 0; i < aIDs.length; i++) {
     var acc = getAccessible(aIDs[i], nsIAccessibleText);
     try {
       isnot(acc.getText(aStartOffset, aEndOffset), aText,
          "getText: plain text between start and end offsets '" + aStartOffset +
          "', '" + aEndOffset + " for '" + prettyName(aIDs[i]) + "'");
     } catch (e) {
       ok(false,
          "getText fails between start and end offsets '" + aStartOffset +
@@ -95,18 +91,17 @@ function testPasswordText(aIDs, aStartOf
  *
  * @param aIDs          [in] the accessible identifier or array of accessible
  *                        identifiers
  * @param aOffset       [in] the offset to get a character at it
  * @param aChar         [in] the expected character
  * @param aStartOffset  [in] expected start offset of the character
  * @param aEndOffset    [in] expected end offset of the character
  */
-function testCharAtOffset(aIDs, aOffset, aChar, aStartOffset, aEndOffset)
-{
+function testCharAtOffset(aIDs, aOffset, aChar, aStartOffset, aEndOffset) {
   var IDs = (aIDs instanceof Array) ? aIDs : [ aIDs ];
   for (var i = 0; i < IDs.length; i++) {
     var acc = getAccessible(IDs[i], nsIAccessibleText);
     testTextHelper(IDs[i], aOffset, BOUNDARY_CHAR,
                    aChar, aStartOffset, aEndOffset,
                    kOk, kOk, kOk,
                    acc.getTextAtOffset, "getTextAtOffset ");
   }
@@ -131,33 +126,31 @@ function testCharAtOffset(aIDs, aOffset,
  * @param aStartOffset    [in] expected return start offset for getTextAtOffset
  * @param aEndOffset      [in] expected return end offset for getTextAtOffset
  * @param ...             [in] list of ids or list of tuples made of:
  *                              element identifier
  *                              kTodo or kOk for returned text
  *                              kTodo or kOk for returned start offset
  *                              kTodo or kOk for returned offset result
  */
-function testTextAtOffset()
-{
+function testTextAtOffset() {
   testTextSuperHelper("getTextAtOffset", arguments);
 }
 
 /**
  * Test getTextAfterOffset for BOUNDARY_CHAR over different elements.
  *
  * @param aIDs          [in] the accessible identifier or array of accessible
  *                        identifiers
  * @param aOffset       [in] the offset to get a character after it
  * @param aChar         [in] the expected character
  * @param aStartOffset  [in] expected start offset of the character
  * @param aEndOffset    [in] expected end offset of the character
  */
-function testCharAfterOffset(aIDs, aOffset, aChar, aStartOffset, aEndOffset)
-{
+function testCharAfterOffset(aIDs, aOffset, aChar, aStartOffset, aEndOffset) {
   var IDs = (aIDs instanceof Array) ? aIDs : [ aIDs ];
   for (var i = 0; i < IDs.length; i++) {
     var acc = getAccessible(IDs[i], nsIAccessibleText);
     testTextHelper(IDs[i], aOffset, BOUNDARY_CHAR,
                    aChar, aStartOffset, aEndOffset,
                    kOk, kOk, kOk,
                    acc.getTextAfterOffset, "getTextAfterOffset ");
   }
@@ -183,33 +176,31 @@ function testCharAfterOffset(aIDs, aOffs
  * @param aEndOffset      [in] expected return end offset for getTextAfterOffset
  * @param ...             [in] list of ids or list of tuples made of:
  *                              element identifier
  *                              kTodo or kOk for returned text
  *                              kTodo or kOk for returned start offset
  *                              kTodo or kOk for returned offset result
  */
 function testTextAfterOffset(aOffset, aBoundaryType,
-                             aText, aStartOffset, aEndOffset)
-{
+                             aText, aStartOffset, aEndOffset) {
   testTextSuperHelper("getTextAfterOffset", arguments);
 }
 
 /**
  * Test getTextBeforeOffset for BOUNDARY_CHAR over different elements.
  *
  * @param aIDs          [in] the accessible identifier or array of accessible
  *                        identifiers
  * @param aOffset       [in] the offset to get a character before it
  * @param aChar         [in] the expected character
  * @param aStartOffset  [in] expected start offset of the character
  * @param aEndOffset    [in] expected end offset of the character
  */
-function testCharBeforeOffset(aIDs, aOffset, aChar, aStartOffset, aEndOffset)
-{
+function testCharBeforeOffset(aIDs, aOffset, aChar, aStartOffset, aEndOffset) {
   var IDs = (aIDs instanceof Array) ? aIDs : [ aIDs ];
   for (var i = 0; i < IDs.length; i++) {
     var acc = getAccessible(IDs[i], nsIAccessibleText);
     testTextHelper(IDs[i], aOffset, BOUNDARY_CHAR,
                    aChar, aStartOffset, aEndOffset,
                    kOk, kOk, kOk,
                    acc.getTextBeforeOffset, "getTextBeforeOffset ");
   }
@@ -235,30 +226,28 @@ function testCharBeforeOffset(aIDs, aOff
  * @param aEndOffset      [in] expected return end offset for getTextBeforeOffset
  * @param ...             [in] list of ids or list of tuples made of:
  *                              element identifier
  *                              kTodo or kOk for returned text
  *                              kTodo or kOk for returned start offset
  *                              kTodo or kOk for returned offset result
  */
 function testTextBeforeOffset(aOffset, aBoundaryType,
-                              aText, aStartOffset, aEndOffset)
-{
+                              aText, aStartOffset, aEndOffset) {
   testTextSuperHelper("getTextBeforeOffset", arguments);
 }
 
 /**
  * Test word count for an element.
  *
  * @param aElement   [in] element identifier
  * @param aCount     [in] Expected word count
  * @param aToDoFlag  [in] kTodo or kOk for returned text
  */
-function testWordCount(aElement, aCount, aToDoFlag)
-{
+function testWordCount(aElement, aCount, aToDoFlag) {
   var isFunc = (aToDoFlag == kTodo) ? todo_is : is;
   var acc = getAccessible(aElement, nsIAccessibleText);
   var startOffsetObj = {}, endOffsetObj = {};
   var length = acc.characterCount;
   var offset = 0;
   var wordCount = 0;
   while (true) {
     acc.getTextAtOffset(offset, BOUNDARY_WORD_START,
@@ -277,18 +266,17 @@ function testWordCount(aElement, aCount,
 /**
  * Test word at a position for an element.
  *
  * @param aElement    [in] element identifier
  * @param aWordIndex  [in] index of the word to test
  * @param aText       [in] expected text for that word
  * @param aToDoFlag   [in] kTodo or kOk for returned text
  */
-function testWordAt(aElement, aWordIndex, aText, aToDoFlag)
-{
+function testWordAt(aElement, aWordIndex, aText, aToDoFlag) {
   var isFunc = (aToDoFlag == kTodo) ? todo_is : is;
   var acc = getAccessible(aElement, nsIAccessibleText);
 
   var textLength = acc.characterCount;
   var wordIdx = aWordIndex;
   var startOffsetObj = { value: 0 }, endOffsetObj = { value: 0 };
   for (offset = 0; offset < textLength; offset = endOffsetObj.value) {
     acc.getTextAtOffset(offset, BOUNDARY_WORD_START,
@@ -331,51 +319,48 @@ function testWordAt(aElement, aWordIndex
 
 /**
  * Test words in a element.
  *
  * @param aElement   [in]           element identifier
  * @param aWords     [in]           array of expected words
  * @param aToDoFlag  [in, optional] kTodo or kOk for returned text
  */
-function testWords(aElement, aWords, aToDoFlag)
-{
+function testWords(aElement, aWords, aToDoFlag) {
   if (aToDoFlag == null)
     aToDoFlag = kOk;
 
   testWordCount(aElement, aWords.length, aToDoFlag);
 
   for (var i = 0; i < aWords.length; i++) {
     testWordAt(aElement, i, aWords[i], aToDoFlag);
   }
 }
 
 /**
  * Remove all selections.
  *
  * @param aID  [in] Id, DOM node, or acc obj
  */
-function cleanTextSelections(aID)
-{
+function cleanTextSelections(aID) {
   var acc = getAccessible(aID, [nsIAccessibleText]);
 
   while (acc.selectionCount > 0)
     acc.removeSelection(0);
 }
 
 /**
  * Test addSelection method.
  *
  * @param aID               [in] Id, DOM node, or acc obj
  * @param aStartOffset      [in] start offset for the new selection
  * @param aEndOffset        [in] end offset for the new selection
  * @param aSelectionsCount  [in] expected number of selections after addSelection
  */
-function testTextAddSelection(aID, aStartOffset, aEndOffset, aSelectionsCount)
-{
+function testTextAddSelection(aID, aStartOffset, aEndOffset, aSelectionsCount) {
   var acc = getAccessible(aID, [nsIAccessibleText]);
   var text = acc.getText(0, -1);
 
   acc.addSelection(aStartOffset, aEndOffset);
 
   ok(acc.selectionCount, aSelectionsCount,
      text + ": failed to add selection from offset '" + aStartOffset +
      "' to offset '" + aEndOffset + "': selectionCount after");
@@ -384,18 +369,17 @@ function testTextAddSelection(aID, aStar
 /**
  * Test removeSelection method.
  *
  * @param aID               [in] Id, DOM node, or acc obj
  * @param aSelectionIndex   [in] index of the selection to be removed
  * @param aSelectionsCount  [in] expected number of selections after
  *                               removeSelection
  */
-function testTextRemoveSelection(aID, aSelectionIndex, aSelectionsCount)
-{
+function testTextRemoveSelection(aID, aSelectionIndex, aSelectionsCount) {
   var acc = getAccessible(aID, [nsIAccessibleText]);
   var text = acc.getText(0, -1);
 
   acc.removeSelection(aSelectionIndex);
 
   ok(acc.selectionCount, aSelectionsCount,
      text + ": failed to remove selection at index '" +
      aSelectionIndex + "': selectionCount after");
@@ -407,68 +391,64 @@ function testTextRemoveSelection(aID, aS
  * @param aID               [in] Id, DOM node, or acc obj
  * @param aStartOffset      [in] new start offset for the selection
  * @param aEndOffset        [in] new end offset for the selection
  * @param aSelectionIndex   [in] index of the selection to set
  * @param aSelectionsCount  [in] expected number of selections after
  *                               setSelectionBounds
  */
 function testTextSetSelection(aID, aStartOffset, aEndOffset,
-                              aSelectionIndex, aSelectionsCount)
-{
+                              aSelectionIndex, aSelectionsCount) {
   var acc = getAccessible(aID, [nsIAccessibleText]);
   var text = acc.getText(0, -1);
 
   acc.setSelectionBounds(aSelectionIndex, aStartOffset, aEndOffset);
 
   is(acc.selectionCount, aSelectionsCount,
      text + ": failed to set selection at index '" +
      aSelectionIndex + "': selectionCount after");
 }
 
 /**
  * Test selectionCount method.
  *
  * @param aID        [in] Id, DOM node, or acc obj
  * @param aCount     [in] expected selection count
  */
-function testTextSelectionCount(aID, aCount)
-{
+function testTextSelectionCount(aID, aCount) {
   var acc = getAccessible(aID, [nsIAccessibleText]);
   var text = acc.getText(0, -1);
 
   is(acc.selectionCount, aCount, text + ": wrong selectionCount: ");
 }
 
 /**
  * Test getSelectionBounds method.
  *
  * @param aID              [in] Id, DOM node, or acc obj
  * @param aStartOffset     [in] expected start offset for the selection
  * @param aEndOffset       [in] expected end offset for the selection
  * @param aSelectionIndex  [in] index of the selection to get
  */
-function testTextGetSelection(aID, aStartOffset, aEndOffset, aSelectionIndex)
-{
+function testTextGetSelection(aID, aStartOffset, aEndOffset, aSelectionIndex) {
   var acc = getAccessible(aID, [nsIAccessibleText]);
   var text = acc.getText(0, -1);
 
   var startObj = {}, endObj = {};
   acc.getSelectionBounds(aSelectionIndex, startObj, endObj);
 
   is(startObj.value, aStartOffset, text + ": wrong start offset for index '" +
      aSelectionIndex + "'");
   is(endObj.value, aEndOffset, text + ": wrong end offset for index '" +
      aSelectionIndex + "'");
 }
 
 function testTextRange(aRange, aRangeDescr, aStartContainer, aStartOffset,
                        aEndContainer, aEndOffset, aText,
-                       aCommonContainer, aChildren)
-{
+                       aCommonContainer, aChildren) {
   isObject(aRange.startContainer, getAccessible(aStartContainer),
            "Wrong start container of " + aRangeDescr);
   is(aRange.startOffset, aStartOffset,
      "Wrong start offset of " + aRangeDescr);
   isObject(aRange.endContainer, getAccessible(aEndContainer),
            "Wrong end container of " + aRangeDescr);
   is(aRange.endOffset, aEndOffset,
      "Wrong end offset of " + aRangeDescr);
@@ -494,18 +474,17 @@ function testTextRange(aRange, aRangeDes
                "Wrong child at index '" + i + "' of " + aRangeDescr);
     }
   }
 }
 
 // //////////////////////////////////////////////////////////////////////////////
 // Private
 
-function testTextSuperHelper(aFuncName, aArgs)
-{
+function testTextSuperHelper(aFuncName, aArgs) {
   // List of tests.
   if (aArgs[2] instanceof Array) {
     var ids = (aArgs[0] instanceof Array) ? aArgs[0] : [ aArgs[0] ];
     var boundaryType = aArgs[1];
     var list = aArgs[2];
     for (var i = 0; i < list.length; i++) {
       var offset1 = list[i][0], offset2 = list[i][1];
       var text = list[i][2], startOffset = list[i][3], endOffset = list[i][4];
@@ -569,18 +548,17 @@ function testTextSuperHelper(aFuncName, 
                    toDoFlag1, toDoFlag2, toDoFlag3,
                    acc[aFuncName], aFuncName + " ");
   }
 }
 
 function testTextHelper(aID, aOffset, aBoundaryType,
                         aText, aStartOffset, aEndOffset,
                         aToDoFlag1, aToDoFlag2, aToDoFlag3,
-                        aTextFunc, aTextFuncName)
-{
+                        aTextFunc, aTextFuncName) {
   var exceptionFlag = aToDoFlag1 == undefined ||
                       aToDoFlag2 == undefined ||
                       aToDoFlag3 == undefined;
 
   var startMsg = aTextFuncName + "(" + boundaryToString(aBoundaryType) + "): ";
   var endMsg = ", id: " + prettyName(aID) + ";";
 
   try {
@@ -612,18 +590,17 @@ function testTextHelper(aID, aOffset, aB
 
   } catch (e) {
     var okFunc = exceptionFlag ? todo : ok;
     okFunc(false, startMsg + "failed at offset " + aOffset + endMsg +
            ", exception: " + e);
   }
 }
 
-function boundaryToString(aBoundaryType)
-{
+function boundaryToString(aBoundaryType) {
   switch (aBoundaryType) {
     case BOUNDARY_CHAR:
       return "char";
     case BOUNDARY_WORD_START:
       return "word start";
     case BOUNDARY_WORD_END:
       return "word end";
     case BOUNDARY_LINE_START:
--- a/accessible/tests/mochitest/text/test_atcaretoffset.html
+++ b/accessible/tests/mochitest/text/test_atcaretoffset.html
@@ -20,18 +20,17 @@
   <script type="application/javascript"
           src="../events.js"></script>
   <script type="application/javascript"
           src="../text.js"></script>
 
   <script type="application/javascript">
     // gA11yEventDumpToConsole = true; // debugging
 
-    function traverseTextByLines(aQueue, aID, aLines)
-    {
+    function traverseTextByLines(aQueue, aID, aLines) {
       var wholeText = "";
       for (var i = 0; i < aLines.length ; i++)
         wholeText += aLines[i][0] + aLines[i][1];
 
       var baseInvokerFunc = synthClick;
       var charIter = new charIterator(wholeText, aLines);
       // charIter.debugOffset = 10; // enable to run tests at given offset only
 
@@ -39,20 +38,18 @@
         aQueue.push(new tmpl_moveTo(aID, baseInvokerFunc, wholeText, charIter));
         baseInvokerFunc = synthRightKey;
       }
     }
 
     /**
      * Used to get test list for each traversed character.
      */
-    function charIterator(aWholeText, aLines)
-    {
-      this.next = function charIterator_next()
-      {
+    function charIterator(aWholeText, aLines) {
+      this.next = function charIterator_next() {
         // Don't increment offset if we are at end of the wrapped line
         // (offset is shared between end of this line and start of next line).
         if (this.mAtWrappedLineEnd) {
           this.mAtWrappedLineEnd = false;
           this.mLine = this.mLine.nextLine;
           return true;
         }
 
@@ -66,29 +63,26 @@
             this.mAtWrappedLineEnd = true;
           else
             this.mLine = nextLine;
         }
 
         return true;
       }
 
-      Object.defineProperty(this, "offset", { get: function()
-        { return this.mOffset; }
+      Object.defineProperty(this, "offset", { get: function() { return this.mOffset; }
       });
 
-      Object.defineProperty(this, "offsetDescr", { get: function()
-        {
+      Object.defineProperty(this, "offsetDescr", { get: function() {
           return this.mOffset + " offset (" + this.mLine.number + " line, " +
             (this.mOffset - this.mLine.start) + " offset on the line)";
         }
       });
 
-      Object.defineProperty(this, "tests", { get: function()
-        {
+      Object.defineProperty(this, "tests", { get: function() {
           // Line boundary tests.
           var cLine = this.mLine;
           var pLine = cLine.prevLine;
           var ppLine = pLine.prevLine;
           var nLine = cLine.nextLine;
           var nnLine = nLine.nextLine;
 
           var lineTests = [
@@ -163,18 +157,17 @@
               this.mAtWrappedLineEnd ? this.offset : nextOffset,
               this.mAtWrappedLineEnd ? nextOffset : nextAfterNextOffset ]
           ];
 
           return lineTests.concat(wordTests.concat(charTests));
         }
       });
 
-      Object.defineProperty(this, "failures", { get: function()
-        {
+      Object.defineProperty(this, "failures", { get: function() {
           if (this.mOffset == this.mLine.start)
             return this.mLine.lineStartFailures;
           if (this.mOffset == this.mLine.end)
             return this.mLine.lineEndFailures;
           return [];
         }
       });
 
@@ -182,182 +175,161 @@
       this.mLine = new line(aWholeText, aLines, 0);
       this.mAtWrappedLineEnd = false;
       this.mWord = this.mLine.firstWord;
     }
 
     /**
      * A line object. Allows to navigate by lines and by words.
      */
-    function line(aWholeText, aLines, aIndex)
-    {
-      Object.defineProperty(this, "prevLine", { get: function()
-        {
+    function line(aWholeText, aLines, aIndex) {
+      Object.defineProperty(this, "prevLine", { get: function() {
           return new line(aWholeText, aLines, aIndex - 1);
         }
       });
-      Object.defineProperty(this, "nextLine", { get: function()
-        {
+      Object.defineProperty(this, "nextLine", { get: function() {
           return new line(aWholeText, aLines, aIndex + 1);
         }
       });
 
-      Object.defineProperty(this, "start", { get: function()
-        {
+      Object.defineProperty(this, "start", { get: function() {
           if (aIndex < 0)
             return 0;
 
           if (aIndex >= aLines.length)
             return aWholeText.length;
 
           return aLines[aIndex][2];
         }
       });
-      Object.defineProperty(this, "end", { get: function()
-        {
+      Object.defineProperty(this, "end", { get: function() {
           if (aIndex < 0)
             return 0;
 
           if (aIndex >= aLines.length)
             return aWholeText.length;
 
           return aLines[aIndex][3];
         }
       });
 
-      Object.defineProperty(this, "number", { get: function()
-        { return aIndex; }
+      Object.defineProperty(this, "number", { get: function() { return aIndex; }
       });
-      Object.defineProperty(this, "wholeText", { get: function()
-        { return aWholeText; }
+      Object.defineProperty(this, "wholeText", { get: function() { return aWholeText; }
       });
-      this.isFakeLine = function line_isFakeLine()
-      {
+      this.isFakeLine = function line_isFakeLine() {
         return aIndex < 0 || aIndex >= aLines.length;
       }
 
-      Object.defineProperty(this, "lastWord", { get: function()
-        {
+      Object.defineProperty(this, "lastWord", { get: function() {
           if (aIndex < 0)
             return new word(this, [], -1);
           if (aIndex >= aLines.length)
             return new word(this, [], 0);
 
           var words = aLines[aIndex][4].words;
           return new word(this, words, words.length - 2);
         }
       });
-      Object.defineProperty(this, "firstWord", { get: function()
-        {
+      Object.defineProperty(this, "firstWord", { get: function() {
           if (aIndex < 0)
             return new word(this, [], -1);
           if (aIndex >= aLines.length)
             return new word(this, [], 0);
 
           var words = aLines[aIndex][4].words;
           return new word(this, words, 0);
         }
       });
 
-      this.isLastWord = function line_isLastWord(aWord)
-      {
+      this.isLastWord = function line_isLastWord(aWord) {
         var lastWord = this.lastWord;
         return lastWord.start == aWord.start && lastWord.end == aWord.end;
       }
 
-      Object.defineProperty(this, "lineStartFailures", { get: function()
-        {
+      Object.defineProperty(this, "lineStartFailures", { get: function() {
           if (aIndex < 0 || aIndex >= aLines.length)
             return [];
 
           return aLines[aIndex][4].lsf || [];
         }
       });
-      Object.defineProperty(this, "lineEndFailures", { get: function()
-        {
+      Object.defineProperty(this, "lineEndFailures", { get: function() {
           if (aIndex < 0 || aIndex >= aLines.length)
             return [];
 
           return aLines[aIndex][4].lef || [];
         }
       });
     }
 
     /**
      * A word object. Allows to navigate by words.
      */
-    function word(aLine, aWords, aIndex)
-    {
-      Object.defineProperty(this, "prevWord", { get: function()
-        {
+    function word(aLine, aWords, aIndex) {
+      Object.defineProperty(this, "prevWord", { get: function() {
           if (aIndex >= 2)
             return new word(aLine, aWords, aIndex - 2);
 
           var prevLineLastWord = aLine.prevLine.lastWord;
           if (this.start == prevLineLastWord.start && !this.isFakeStartWord())
             return prevLineLastWord.prevWord;
           return prevLineLastWord;
         }
       });
-      Object.defineProperty(this, "nextWord", { get: function()
-        {
+      Object.defineProperty(this, "nextWord", { get: function() {
           if (aIndex + 2 < aWords.length)
             return new word(aLine, aWords, aIndex + 2);
 
           var nextLineFirstWord = aLine.nextLine.firstWord;
           if (this.end == nextLineFirstWord.end && !this.isFakeEndWord())
             return nextLineFirstWord.nextWord;
           return nextLineFirstWord;
         }
       });
 
       Object.defineProperty(this, "line", { get: function() { return aLine; } });
 
-      Object.defineProperty(this, "start", { get: function()
-        {
+      Object.defineProperty(this, "start", { get: function() {
           if (this.isFakeStartWord())
             return 0;
 
           if (this.isFakeEndWord())
             return aLine.end;
            return aWords[aIndex];
         }
       });
-      Object.defineProperty(this, "end", { get: function()
-        {
+      Object.defineProperty(this, "end", { get: function() {
           if (this.isFakeStartWord())
             return 0;
 
           return this.isFakeEndWord() ? aLine.end : aWords[aIndex + 1];
         }
       });
 
-      this.toString = function word_toString()
-      {
+      this.toString = function word_toString() {
         var start = this.start, end = this.end;
         return "'" + aLine.wholeText.substring(start, end) +
           "' at [" + start + ", " + end + "]";
       }
 
       this.isFakeStartWord = function() { return aIndex < 0; }
       this.isFakeEndWord = function() { return aIndex >= aWords.length; }
     }
 
     /**
      * A template invoker to move through the text.
      */
-    function tmpl_moveTo(aID, aInvokerFunc, aWholeText, aCharIter)
-    {
+    function tmpl_moveTo(aID, aInvokerFunc, aWholeText, aCharIter) {
       this.offset = aCharIter.offset;
 
       var checker = new caretMoveChecker(this.offset, aID);
       this.__proto__ = new (aInvokerFunc)(aID, checker);
 
-      this.finalCheck = function genericMoveTo_finalCheck()
-      {
+      this.finalCheck = function genericMoveTo_finalCheck() {
         if (this.noTests())
           return;
 
         for (var i = 0; i < this.tests.length; i++) {
           var func = this.tests[i][0];
           var boundary = this.tests[i][1];
           var startOffset = this.tests[i][2];
           var endOffset = this.tests[i][3];
@@ -373,35 +345,32 @@
             }
           }
 
           func.call(null, kCaretOffset, boundary, text, startOffset, endOffset,
                     aID, isOk1, isOk2, isOk3);
         }
       }
 
-      this.getID = function genericMoveTo_getID()
-      {
+      this.getID = function genericMoveTo_getID() {
         return "move to " + this.offsetDescr;
       }
 
-      this.noTests = function tmpl_moveTo_noTests()
-      {
+      this.noTests = function tmpl_moveTo_noTests() {
         return ("debugOffset" in aCharIter) &&
           (aCharIter.debugOffset != this.offset);
       }
 
       this.offsetDescr = aCharIter.offsetDescr;
       this.tests = this.noTests() ? null : aCharIter.tests;
       this.failures = aCharIter.failures;
     }
 
     var gQueue = null;
-    function doTest()
-    {
+    function doTest() {
       gQueue = new eventQueue();
 
       // __a__w__o__r__d__\n
       //  0  1  2  3  4  5
       // __t__w__o__ (soft line break)
       //  6  7  8  9
       // __w__o__r__d__s
       // 10 11 12 13 14 15
--- a/accessible/tests/mochitest/text/test_charboundary.html
+++ b/accessible/tests/mochitest/text/test_charboundary.html
@@ -8,18 +8,17 @@
   <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"
           src="../text.js"></script>
 
   <script type="application/javascript">
-    function doTest()
-    {
+    function doTest() {
       // ////////////////////////////////////////////////////////////////////////
       //
       // __h__e__l__l__o__ __m__y__ __f__r__i__e__n__d__
       //  0  1  2  3  4  5  6  7  8  9 10 11 12 13 14 15
 
       var IDs = [ "i1", "d1", "e1", "t1" ];
 
       testCharBeforeOffset(IDs, 0, "", 0, 0);
--- a/accessible/tests/mochitest/text/test_doc.html
+++ b/accessible/tests/mochitest/text/test_doc.html
@@ -8,18 +8,17 @@
   <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"
           src="../text.js"></script>
   <script type="application/javascript">
     
-    function doTest()
-    {
+    function doTest() {
       var iframeDoc = [ getNode("iframe").contentDocument ];
       testCharacterCount(iframeDoc, 15);
       testText(iframeDoc, 0, 15, "outbody inbody ");
 
       SimpleTest.finish();
     }
 
     SimpleTest.waitForExplicitFinish();
--- a/accessible/tests/mochitest/text/test_dynamic.html
+++ b/accessible/tests/mochitest/text/test_dynamic.html
@@ -10,64 +10,57 @@
   <script type="application/javascript"
           src="../common.js"></script>
   <script type="application/javascript"
           src="../text.js"></script>
   <script type="application/javascript"
           src="../events.js"></script>
 
   <script type="application/javascript">
-    function insertBefore(aId, aEl, aTextBefore, aTextAfter, aStartIdx, aEndIdx)
-    {
+    function insertBefore(aId, aEl, aTextBefore, aTextAfter, aStartIdx, aEndIdx) {
       this.eventSeq = [
         new invokerChecker(EVENT_REORDER, aId)
       ];
 
-      this.invoke = function insertBefore_invoke()
-      {
+      this.invoke = function insertBefore_invoke() {
         testText(aId, 0, -1, aTextBefore);
         getNode(aId).insertBefore(aEl, getNode(aId).firstChild);
       }
 
-      this.finalCheck = function insertBefore_finalCheck()
-      {
+      this.finalCheck = function insertBefore_finalCheck() {
         testText(aId, aStartIdx, aEndIdx, aTextAfter);
       }
 
       this.getID = function insertTextBefore_getID() {
         return "insert " + prettyName(aEl) + " before";
       }
     }
 
-    function insertTextBefore(aId, aTextBefore, aText)
-    {
+    function insertTextBefore(aId, aTextBefore, aText) {
       var el = document.createTextNode(aText);
       this.__proto__ = new insertBefore(aId, el, aTextBefore,
                                         aText + aTextBefore, 0, -1)
     }
 
-    function insertImgBefore(aId, aTextBefore)
-    {
+    function insertImgBefore(aId, aTextBefore) {
       var el = document.createElement("img");
       el.setAttribute("src", "../moz.png");
       el.setAttribute("alt", "mozilla");
 
       this.__proto__ = new insertBefore(aId, el, aTextBefore,
                                         kEmbedChar + aTextBefore, 0, -1)
     }
 
-    function insertTextBefore2(aId)
-    {
+    function insertTextBefore2(aId) {
       var el = document.createTextNode("hehe");
       this.__proto__ = new insertBefore(aId, el, "ho", "ho", 4, -1)
     }
 
     var gQueue = null;
-    function doTest()
-    {
+    function doTest() {
       gQueue = new eventQueue();
       gQueue.push(new insertTextBefore("c1", "ho", "ha"));
       gQueue.push(new insertImgBefore("c1", "haho"));
       gQueue.push(new insertImgBefore("c2", kEmbedChar));
       gQueue.push(new insertTextBefore2("c3"));
       gQueue.invoke(); // will call SimpleTest.finish();
     }
 
--- a/accessible/tests/mochitest/text/test_gettext.html
+++ b/accessible/tests/mochitest/text/test_gettext.html
@@ -8,18 +8,17 @@
   <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"
           src="../text.js"></script>
 
   <script type="application/javascript">
-    function doTest()
-    {
+    function doTest() {
       // ////////////////////////////////////////////////////////////////////////
       //
       // __h__e__l__l__o__ __m__y__ __f__r__i__e__n__d__
       //  0  1  2  3  4  5  6  7  8  9 10 11 12 13 14 15
 
       var IDs = [ "i1", "d1", "e1", "t1" ];
 
       testCharacterCount(IDs, 15);
--- a/accessible/tests/mochitest/text/test_hypertext.html
+++ b/accessible/tests/mochitest/text/test_hypertext.html
@@ -17,18 +17,17 @@
   <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"
           src="../text.js"></script>
 
   <script type="application/javascript">
-    function doTest()
-    {
+    function doTest() {
       // ////////////////////////////////////////////////////////////////////////
       // null getText
       // ////////////////////////////////////////////////////////////////////////
 
       var emptyTextAcc = getAccessible("nulltext", [nsIAccessibleText]);
       is(emptyTextAcc.getText(0, -1), "", "getText() END_OF_TEXT with null string");
       is(emptyTextAcc.getText(0, 0), "", "getText() Len==0 with null string");
 
--- a/accessible/tests/mochitest/text/test_lineboundary.html
+++ b/accessible/tests/mochitest/text/test_lineboundary.html
@@ -6,18 +6,17 @@
 
   <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"
           src="../text.js"></script>
   <script type="application/javascript">
-    function doTest()
-    {
+    function doTest() {
       testTextAtOffset("line_test_1", BOUNDARY_LINE_START,
                        [[0, 6, "Line 1 ", 0, 7],
                         [7, 7, "", 7, 7],
                         [8, 15, "Line 3 ", 8, 15]]);
 
       // ////////////////////////////////////////////////////////////////////////
       // __h__e__l__l__o__ __m__y__ __f__r__i__e__n__d__
       //  0  1  2  3  4  5  6  7  8  9 10 11 12 13 14 15
--- a/accessible/tests/mochitest/text/test_passwords.html
+++ b/accessible/tests/mochitest/text/test_passwords.html
@@ -8,18 +8,17 @@
   <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"
           src="../text.js"></script>
 
   <script type="application/javascript">
-    function doTest()
-    {
+    function doTest() {
       // ////////////////////////////////////////////////////////////////////////
       // regular text and password inputs
       // ////////////////////////////////////////////////////////////////////////
 
       // //////////////////////////////////////////////////////////////////////
       // characterCount and getText for regular text field
 
       var IDs = [ "username" ];
--- a/accessible/tests/mochitest/text/test_selection.html
+++ b/accessible/tests/mochitest/text/test_selection.html
@@ -12,18 +12,17 @@
 
   <script type="application/javascript"
           src="../common.js"></script>
   <script type="application/javascript"
           src="../text.js"></script>
 
   <script type="application/javascript">
 
-    function doTest()
-    {
+    function doTest() {
       // Test selection count: clean selection / check count.
       testTextAddSelection("div0", 0, 2, 1); // |Test selection...
       cleanTextSelections("div0");
       testTextSelectionCount("div0", 0);
 
       // Test addition: adding two equal selections, the second one should
       // not be added.
       testTextAddSelection("div1", 7, 9, 1); // Test ad|di|ng two...
--- a/accessible/tests/mochitest/text/test_wordboundary.html
+++ b/accessible/tests/mochitest/text/test_wordboundary.html
@@ -8,18 +8,17 @@
   <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"
           src="../text.js"></script>
 
   <script type="application/javascript">
-    function doTest()
-    {
+    function doTest() {
       // "hello"
       // __h__e__l__l__o__
       //  0  1  2  3  4  5
       var ids = [ "i1", "d1", "e1", "t1" ];
       testTextBeforeOffset(ids, BOUNDARY_WORD_START,
                            [ [ 0, 5, "", 0, 0 ] ]);
       testTextBeforeOffset(ids, BOUNDARY_WORD_END,
                            [ [ 0, 5, "", 0, 0 ] ]);
--- a/accessible/tests/mochitest/text/test_words.html
+++ b/accessible/tests/mochitest/text/test_words.html
@@ -13,18 +13,17 @@
           src="../text.js"></script>
   <script type="application/javascript">
     if (navigator.platform.startsWith("Mac")) {
       SimpleTest.expectAssertions(0, 1);
     } else {
       SimpleTest.expectAssertions(0, 1);
     }
 
-    function doTest()
-    {
+    function doTest() {
       // "one two"
       testWords("div1", ["one", "two"]);
 
       // "one  two"
       testWords("div2", ["one", "two"]);
 
       // "one,two"
       testWordCount("div3", 2, kOk);
--- a/accessible/tests/mochitest/textattrs/test_general.html
+++ b/accessible/tests/mochitest/textattrs/test_general.html
@@ -18,18 +18,17 @@
   <script type="application/javascript"
           src="../attributes.js"></script>
   <script type="application/javascript"
           src="../events.js"></script>
 
   <script type="application/javascript">
     var gComputedStyle = null;
 
-    function doTest()
-    {
+    function doTest() {
       // ////////////////////////////////////////////////////////////////////////
       // area1
       var ID = "area1";
       var defAttrs = buildDefaultTextAttrs(ID, "10pt");
       testDefaultTextAttrs(ID, defAttrs);
 
       var attrs = {};
       testTextAttrs(ID, 0, attrs, defAttrs, 0, 7);
--- a/accessible/tests/mochitest/textattrs/test_invalid.html
+++ b/accessible/tests/mochitest/textattrs/test_invalid.html
@@ -18,18 +18,17 @@
   <script type="application/javascript"
           src="../states.js"></script>
   <script type="application/javascript"
           src="../events.js"></script>
   <script type="application/javascript"
           src="../attributes.js"></script>
 
   <script type="application/javascript">
-    function doTests()
-    {
+    function doTests() {
       testDefaultTextAttrs("aria_invalid_empty", {}, true);
       testDefaultTextAttrs("aria_invalid_true", { "invalid": "true" }, true);
       testDefaultTextAttrs("aria_invalid_false", { "invalid": "false" }, true);
       testDefaultTextAttrs("aria_invalid_grammar", { "invalid": "grammar" }, true);
       testDefaultTextAttrs("aria_invalid_spelling", { "invalid": "spelling" }, true);
       testDefaultTextAttrs("aria_invalid_erroneous", { "invalid": "true" }, true);
 
       SimpleTest.finish();
--- a/accessible/tests/mochitest/textcaret/test_general.html
+++ b/accessible/tests/mochitest/textcaret/test_general.html
@@ -13,41 +13,37 @@
           src="../common.js"></script>
   <script type="application/javascript"
           src="../events.js"></script>
 
   <script type="application/javascript">
     /**
      * Turn on/off the caret browsing mode.
      */
-    function turnCaretBrowsing(aIsOn)
-    {
+    function turnCaretBrowsing(aIsOn) {
       var prefs = Components.classes["@mozilla.org/preferences-service;1"].
         getService(Components.interfaces.nsIPrefBranch);
       prefs.setBoolPref("accessibility.browsewithcaret", aIsOn);
     }
 
     /**
      * Test caret offset for the given accessible.
      */
-    function testCaretOffset(aID, aCaretOffset)
-    {
+    function testCaretOffset(aID, aCaretOffset) {
       var acc = getAccessible(aID, [nsIAccessibleText]);
       is(acc.caretOffset, aCaretOffset,
          "Wrong caret offset for " + aID);
     }
 
-    function testCaretOffsets(aList)
-    {
+    function testCaretOffsets(aList) {
       for (var i = 0; i < aList.length; i++)
         testCaretOffset(aList[0][0], aList[0][1]);
     }
 
-    function queueTraversalList(aList, aFocusNode)
-    {
+    function queueTraversalList(aList, aFocusNode) {
       for (var i = 0 ; i < aList.length; i++) {
         var node = aList[i].DOMPoint[0];
         var nodeOffset = aList[i].DOMPoint[1];
 
         var textAcc = aList[i].point[0];
         var textOffset = aList[i].point[1];
         var textList = aList[i].pointList;
         var invoker =
@@ -61,18 +57,17 @@
     /**
      * Do tests.
      */
     var gQueue = null;
 
     // gA11yEventDumpID = "eventdump"; // debug stuff
     // gA11yEventDumpToConsole = true;
 
-    function doTests()
-    {
+    function doTests() {
       turnCaretBrowsing(true);
 
       // test caret offsets
       testCaretOffset(document, 16);
       testCaretOffset("textbox", -1);
       testCaretOffset("textarea", -1);
       testCaretOffset("p", -1);
 
@@ -120,18 +115,17 @@
         { // after 'c'
           DOMPoint: [ getNode("p2", p2Doc).lastChild, 1 ],
           point: [ getNode("p2", p2Doc), 3 ],
           pointList: [ [ p2Doc, 0 ] ]
         }
       ];
       queueTraversalList(traversalList, getNode("p2", p2Doc));
 
-      gQueue.onFinish = function()
-      {
+      gQueue.onFinish = function() {
         turnCaretBrowsing(false);
       }
 
       gQueue.invoke(); // Will call SimpleTest.finish();
     }
 
     SimpleTest.waitForExplicitFinish();
     addA11yLoadEvent(doTests);
--- a/accessible/tests/mochitest/textrange/test_general.html
+++ b/accessible/tests/mochitest/textrange/test_general.html
@@ -10,18 +10,17 @@
   <script type="application/javascript"
           src="../common.js"></script>
   <script type="application/javascript"
           src="../text.js"></script>
   <script type="application/javascript"
           src="../layout.js"></script>
   <script type="application/javascript">
 
-    function doTest()
-    {
+    function doTest() {
       // enclosingRange
       var input = getAccessible("input", [ nsIAccessibleText ]);
       testTextRange(input.enclosingRange, "enclosing range for 'input'",
                     input, 0, input, 5, "hello", input);
 
       var ta = getAccessible("textarea", [ nsIAccessibleText ]);
       testTextRange(ta.enclosingRange, "enclosing range for 'textarea'",
                     ta, 0, ta, 5, "hello", textarea);
--- a/accessible/tests/mochitest/textrange/test_selection.html
+++ b/accessible/tests/mochitest/textrange/test_selection.html
@@ -10,18 +10,17 @@
   <script type="application/javascript"
           src="../common.js"></script>
   <script type="application/javascript"
           src="../text.js"></script>
   <script type="application/javascript"
           src="../layout.js"></script>
   <script type="application/javascript">
 
-    function doTest()
-    {
+    function doTest() {
       var sel = window.getSelection();
       var p = getNode("p1");
       var a = getNode("p2_a");
 
       var range = document.createRange();
       sel.addRange(range);
 
       // the accessible is contained by the range
--- a/accessible/tests/mochitest/textselection/test_general.html
+++ b/accessible/tests/mochitest/textselection/test_general.html
@@ -13,168 +13,150 @@
           src="../common.js"></script>
   <script type="application/javascript"
           src="../events.js"></script>
 
   <script type="application/javascript">
     /**
      * Invokers
      */
-    function addSelection(aID, aStartOffset, aEndOffset)
-    {
+    function addSelection(aID, aStartOffset, aEndOffset) {
       this.hyperTextNode = getNode(aID);
       this.hyperText = getAccessible(aID, [ nsIAccessibleText ]);
 
       this.eventSeq = [
         new invokerChecker(EVENT_TEXT_SELECTION_CHANGED, aID)
       ];
 
-      this.invoke = function addSelection_invoke()
-      {
+      this.invoke = function addSelection_invoke() {
         this.hyperText.addSelection(aStartOffset, aEndOffset);
       }
 
-      this.finalCheck = function addSelection_finalCheck()
-      {
+      this.finalCheck = function addSelection_finalCheck() {
         is(this.hyperText.selectionCount, 1,
            "addSelection: Wrong selection count for " + aID);
         var startOffset = {}, endOffset = {};
         this.hyperText.getSelectionBounds(0, startOffset, endOffset);
 
         is(startOffset.value, aStartOffset,
            "addSelection: Wrong start offset for " + aID);
         is(endOffset.value, aEndOffset,
            "addSelection: Wrong end offset for " + aID);
       }
 
-      this.getID = function addSelection_getID()
-      {
+      this.getID = function addSelection_getID() {
         return "nsIAccessibleText::addSelection test for " + aID;
       }
     }
 
-    function changeSelection(aID, aStartOffset, aEndOffset)
-    {
+    function changeSelection(aID, aStartOffset, aEndOffset) {
       this.hyperTextNode = getNode(aID);
       this.hyperText = getAccessible(aID, [ nsIAccessibleText ]);
 
       this.eventSeq = [
         new invokerChecker(EVENT_TEXT_SELECTION_CHANGED, aID)
       ];
 
-      this.invoke = function changeSelection_invoke()
-      {
+      this.invoke = function changeSelection_invoke() {
         this.hyperText.setSelectionBounds(0, aStartOffset, aEndOffset);
       }
 
-      this.finalCheck = function changeSelection_finalCheck()
-      {
+      this.finalCheck = function changeSelection_finalCheck() {
         is(this.hyperText.selectionCount, 1,
            "setSelectionBounds: Wrong selection count for " + aID);
         var startOffset = {}, endOffset = {};
         this.hyperText.getSelectionBounds(0, startOffset, endOffset);
 
         is(startOffset.value, aStartOffset,
            "setSelectionBounds: Wrong start offset for " + aID);
         is(endOffset.value, aEndOffset,
            "setSelectionBounds: Wrong end offset for " + aID);
       }
 
-      this.getID = function changeSelection_getID()
-      {
+      this.getID = function changeSelection_getID() {
         return "nsIAccessibleText::setSelectionBounds test for " + aID;
       }
     }
 
-    function removeSelection(aID)
-    {
+    function removeSelection(aID) {
       this.hyperText = getAccessible(aID, [ nsIAccessibleText ]);
 
       this.eventSeq = [
         new invokerChecker(EVENT_TEXT_SELECTION_CHANGED, document)
       ];
 
-      this.invoke = function removeSelection_invoke()
-      {
+      this.invoke = function removeSelection_invoke() {
         this.hyperText.removeSelection(0);
       }
 
-      this.finalCheck = function removeSelection_finalCheck()
-      {
+      this.finalCheck = function removeSelection_finalCheck() {
         is(this.hyperText.selectionCount, 0,
            "removeSelection: Wrong selection count for " + aID);
       }
 
-      this.getID = function removeSelection_getID()
-      {
+      this.getID = function removeSelection_getID() {
         return "nsIAccessibleText::removeSelection test for " + aID;
       }
     }
 
     function changeDOMSelection(aID, aNodeID1, aNodeOffset1,
                                 aNodeID2, aNodeOffset2,
-                                aTests)
-    {
+                                aTests) {
       this.hyperText = getAccessible(aID, [ nsIAccessibleText ]);
 
       this.eventSeq = [
         new invokerChecker(EVENT_TEXT_SELECTION_CHANGED, aID)
       ];
 
-      this.invoke = function changeDOMSelection_invoke()
-      {
+      this.invoke = function changeDOMSelection_invoke() {
         var sel = window.getSelection();
         var range = document.createRange();
         range.setStart(getNode(aNodeID1), aNodeOffset1);
         range.setEnd(getNode(aNodeID2), aNodeOffset2);
         sel.addRange(range);
       }
 
-      this.finalCheck = function changeDOMSelection_finalCheck()
-      {
+      this.finalCheck = function changeDOMSelection_finalCheck() {
         for (var i = 0; i < aTests.length; i++) {
           var text = getAccessible(aTests[i][0], nsIAccessibleText);
           is(text.selectionCount, 1,
              "setSelectionBounds: Wrong selection count for " + aID);
           var startOffset = {}, endOffset = {};
           text.getSelectionBounds(0, startOffset, endOffset);
 
           is(startOffset.value, aTests[i][1],
              "setSelectionBounds: Wrong start offset for " + aID);
           is(endOffset.value, aTests[i][2],
              "setSelectionBounds: Wrong end offset for " + aID);
         }
       }
 
-      this.getID = function changeDOMSelection_getID()
-      {
+      this.getID = function changeDOMSelection_getID() {
         return "DOM selection change for " + aID;
       }
     }
 
-    function onfocusEventSeq(aID)
-    {
+    function onfocusEventSeq(aID) {
       var caretMovedChecker =
         new invokerChecker(EVENT_TEXT_CARET_MOVED, aID);
       var selChangedChecker =
         new invokerChecker(EVENT_TEXT_SELECTION_CHANGED, aID);
       selChangedChecker.unexpected = true;
 
       return [ caretMovedChecker, selChangedChecker ];
     }
 
     /**
      * Do tests
      */
 
     // gA11yEventDumpToConsole = true; // debug stuff
 
     var gQueue = null;
-    function doTests()
-    {
+    function doTests() {
       gQueue = new eventQueue();
 
       gQueue.push(new addSelection("paragraph", 1, 3));
       gQueue.push(new changeSelection("paragraph", 2, 4));
       gQueue.push(new removeSelection("paragraph"));
 
       gQueue.push(new synthFocus("textbox", onfocusEventSeq("textbox")));
       gQueue.push(new changeSelection("textbox", 1, 3));
--- a/accessible/tests/mochitest/textselection/test_userinput.html
+++ b/accessible/tests/mochitest/textselection/test_userinput.html
@@ -19,52 +19,48 @@
           src="../states.js"></script>
   <script type="application/javascript"
           src="../events.js"></script>
 
   <script type="application/javascript">
     /**
      * Invokers
      */
-    function synthTabAndCheckPrevTabbed(aID, aPrevID)
-    {
+    function synthTabAndCheckPrevTabbed(aID, aPrevID) {
       this.__proto__ = new synthTab(aID, new focusChecker(aID));
 
-      this.finalCheck = function changeSelection_finalCheck()
-      {
+      this.finalCheck = function changeSelection_finalCheck() {
         var prevTabbed = getAccessible(aPrevID, [ nsIAccessibleText ]);
         is(prevTabbed.selectionCount, 0,
            "Wrong selection count for " + aPrevID);
 
         var exceptionCaught = false;
         try {
           var startOffsetObj = {}, endOffsetObj = {};
           prevTabbed.getSelectionBounds(0, startOffsetObj, endOffsetObj);
         } catch (e) {
           exceptionCaught = true;
         }
 
         ok(exceptionCaught, "No selection was expected for " + aPrevID);
       }
 
-      this.getID = function changeSelection_getID()
-      {
+      this.getID = function changeSelection_getID() {
         return "Hidden selection check for " + aPrevID;
       }
     }
 
     /**
      * Do tests
      */
 
     // gA11yEventDumpToConsole = true; // debug stuff
 
     var gQueue = null;
-    function doTests()
-    {
+    function doTests() {
       gQueue = new eventQueue();
 
       // Tab to 't2' and then tab out it: it must has no selection.
       gQueue.push(new synthFocus("t1"));
       gQueue.push(new synthTab("t2", new focusChecker("t2")));
       gQueue.push(new synthTabAndCheckPrevTabbed("t3", "t2"));
 
       gQueue.invoke(); // Will call SimpleTest.finish();
--- a/accessible/tests/mochitest/tree/test_aria_globals.html
+++ b/accessible/tests/mochitest/tree/test_aria_globals.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() {
       var globalIds = [
         "atomic",
         "busy",
         "controls",
         "describedby",
         "disabled",
         "dropeffect",
         "flowto",
--- a/accessible/tests/mochitest/tree/test_aria_grid.html
+++ b/accessible/tests/mochitest/tree/test_aria_grid.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() {
       // ////////////////////////////////////////////////////////////////////////
       // grid having rowgroups
 
       var accTree =
         { TABLE: [
           { GROUPING: [
             { ROW: [
               { GRID_CELL: [
--- a/accessible/tests/mochitest/tree/test_aria_imgmap.html
+++ b/accessible/tests/mochitest/tree/test_aria_imgmap.html
@@ -15,23 +15,21 @@
           src="../role.js"></script>
   <script type="application/javascript"
           src="../events.js"></script>
   <script type="application/javascript"
           src="../states.js"></script>
 
   <script type="application/javascript">
   // gA11yEventDumpToConsole = true;
-  function doPreTest()
-  {
+  function doPreTest() {
     waitForImageMap("imagemap", doTest);
   }
 
-  function doTest()
-  {
+  function doTest() {
     var accTree = {
       role: ROLE_IMAGE_MAP,
       children: [
         {
           role: ROLE_ENTRY,
           name: "first name"
         },
         {
--- a/accessible/tests/mochitest/tree/test_aria_list.html
+++ b/accessible/tests/mochitest/tree/test_aria_list.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() {
       // ////////////////////////////////////////////////////////////////////////
       // list
 
       var accTree =
         { LIST: [
           { LISTITEM: [
             { TEXT_LEAF: [ ] }
           ] }
--- a/accessible/tests/mochitest/tree/test_aria_menu.html
+++ b/accessible/tests/mochitest/tree/test_aria_menu.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() {
     // Menuitem with no popup.
     tree =
       { SECTION: [ // container
         { MENUPOPUP: [ // menu
           { MENUITEM: [
             { STATICTEXT: [] }, // bullet
             { TEXT_LEAF: [] }
           ] }
--- a/accessible/tests/mochitest/tree/test_aria_owns.html
+++ b/accessible/tests/mochitest/tree/test_aria_owns.html
@@ -19,18 +19,17 @@
     // //////////////////////////////////////////////////////////////////////////
     // Tests
     // //////////////////////////////////////////////////////////////////////////
 
     // enableLogging("tree,verbose"); // debug stuff
 
     var gQueue = null;
 
-    function doTest()
-    {
+    function doTest() {
       var tree =
         { SECTION: [ // t1_1
           { HEADING: [ // t1_2
             // no kids, no loop
           ] }
         ] };
       testAccessibleTree("t1_1", tree);
 
--- a/accessible/tests/mochitest/tree/test_aria_presentation.html
+++ b/accessible/tests/mochitest/tree/test_aria_presentation.html
@@ -11,18 +11,17 @@
           src="chrome://mochikit/content/tests/SimpleTest/EventUtils.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() {
     // Presentation role don't allow accessible.
     var tree =
       { SECTION: [ // container
         { TEXT_LEAF: [ ] }, // child text of 'presentation' node
         { TEXT_LEAF: [ ] } // child text of 'none' node
       ] };
     testAccessibleTree("div_cnt", tree);
 
--- a/accessible/tests/mochitest/tree/test_aria_table.html
+++ b/accessible/tests/mochitest/tree/test_aria_table.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() {
       // ////////////////////////////////////////////////////////////////////////
       // table having rowgroups
 
       var accTree =
         { TABLE: [
           { GROUPING: [
             { ROW: [
               { CELL: [
--- a/accessible/tests/mochitest/tree/test_brokencontext.html
+++ b/accessible/tests/mochitest/tree/test_brokencontext.html
@@ -14,32 +14,28 @@
           src="../role.js"></script>
   <script type="application/javascript"
           src="../states.js"></script>
 
   <script type="application/javascript">
   /**
    * Return true if TD element has a generic accessible.
    */
-  function isTDGeneric(aID)
-  {
+  function isTDGeneric(aID) {
     return isAccessible(aID) && !isAccessible(aID, nsIAccessibleTableCell);
   }
 
-  function checkIfNotAccessible(aID)
-  {
+  function checkIfNotAccessible(aID) {
     ok(!isAccessible(aID), "'" + aID + "' shouldn't be accessible");
   }
-  function checkIfTDGeneric(aID)
-  {
+  function checkIfTDGeneric(aID) {
     ok(isTDGeneric(aID), "'" + aID + "' shouldn't have cell accessible");
   }
 
-  function doTest()
-  {
+  function doTest() {
     // //////////////////////////////////////////////////////////////////////////
     // HTML table elements outside table context.
 
     // HTML table role="presentation"
     checkIfNotAccessible("tr_in_presentation_table");
     checkIfTDGeneric("th_in_presentation_table");
     checkIfTDGeneric("td_in_presentation_table");
 
--- a/accessible/tests/mochitest/tree/test_canvas.html
+++ b/accessible/tests/mochitest/tree/test_canvas.html
@@ -11,18 +11,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="../role.js"></script>
 
   <script type="application/javascript">
-    function doTest()
-    {
+    function doTest() {
       var accTree =
         { CANVAS: [
           { CHECKBUTTON: [] },
           { ENTRY: [] }
         ] };
 
       testAccessibleTree("canvas", accTree);
       SimpleTest.finish();
--- a/accessible/tests/mochitest/tree/test_cssflexbox.html
+++ b/accessible/tests/mochitest/tree/test_cssflexbox.html
@@ -10,18 +10,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() {
       // Ensure that flexbox ordering and absolute positioning do not affect
       // the accessibility tree.
       // Note that there is no accessible for a div with display:flex style.
       var accTree = {
         role: ROLE_SECTION,
         children: [
           { // Bug 1277559. Button outside the flexed content
             role: ROLE_PUSHBUTTON,
--- a/accessible/tests/mochitest/tree/test_cssoverflow.html
+++ b/accessible/tests/mochitest/tree/test_cssoverflow.html
@@ -21,77 +21,68 @@
           src="../common.js"></script>
   <script type="application/javascript"
           src="../events.js"></script>
 
   <script type="application/javascript">
     // //////////////////////////////////////////////////////////////////////////
     // Invokers
 
-    function focusAnchor(aID)
-    {
+    function focusAnchor(aID) {
       this.linkNode = getNode(aID);
       this.link = getAccessible(this.linkNode);
 
       this.eventSeq = [
         new invokerChecker(EVENT_FOCUS, getAccessible, this.linkNode)
       ];
 
-      this.invoke = function focusAnchor_invoke()
-      {
+      this.invoke = function focusAnchor_invoke() {
         this.linkNode.focus();
       }
 
-      this.check = function focusAnchor_check(aEvent)
-      {
+      this.check = function focusAnchor_check(aEvent) {
         todo_is(this.link, aEvent.accessible,
                 "Focus should be fired against new link accessible!");
       }
 
-      this.getID = function focusAnchor_getID()
-      {
+      this.getID = function focusAnchor_getID() {
         return "focus a:focus{overflow:scroll} #1";
       }
     }
 
-    function tabAnchor(aID)
-    {
+    function tabAnchor(aID) {
       this.linkNode = getNode(aID);
       this.link = getAccessible(this.linkNode);
 
       this.eventSeq = [
         new invokerChecker(EVENT_FOCUS, getAccessible, this.linkNode)
       ];
 
-      this.invoke = function tabAnchor_invoke()
-      {
+      this.invoke = function tabAnchor_invoke() {
         synthesizeKey("VK_TAB", { shiftKey: false });
       }
 
-      this.check = function tabAnchor_check(aEvent)
-      {
+      this.check = function tabAnchor_check(aEvent) {
         todo_is(this.link, aEvent.accessible,
                    "Focus should be fired against new link accessible!");
       }
 
-      this.getID = function tabAnchor_getID()
-      {
+      this.getID = function tabAnchor_getID() {
         return "focus a:focus{overflow:scroll} #2";
       }
     }
 
     // //////////////////////////////////////////////////////////////////////////
     // Do tests
 
     var gQueue = null;
     // gA11yEventDumpID = "eventdump"; // debug stuff
     // gA11yEventDumpToConsole = true;
 
-    function doTests()
-    {
+    function doTests() {
       // Shift+Tab not working, and a test timeout, bug 746977
       if (MAC) {
         todo(false, "Shift+tab isn't working on OS X, needs to be disabled until bug 746977 is fixed!");
         SimpleTest.finish();
         return;
       }
 
       gQueue = new eventQueue();
--- a/accessible/tests/mochitest/tree/test_dochierarchy.html
+++ b/accessible/tests/mochitest/tree/test_dochierarchy.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="../states.js"></script>
 
   <script type="application/javascript">
-  function doTest()
-  {
+  function doTest() {
     // tabDoc and testDoc are different documents depending on whether test
     // is running in standalone mode or not.
 
     var root = getRootAccessible();
     var tabDoc = window.parent ?
       getAccessible(window.parent.document, [nsIAccessibleDocument]) :
       getAccessible(document, [nsIAccessibleDocument]);
     var testDoc = getAccessible(document, [nsIAccessibleDocument]);
--- a/accessible/tests/mochitest/tree/test_dockids.html
+++ b/accessible/tests/mochitest/tree/test_dockids.html
@@ -13,18 +13,17 @@
   <script type="application/javascript"
           src="../role.js"></script>
   <script type="application/javascript"
           src="../states.js"></script>
 
   <script type="application/javascript">
   // gA11yEventDumpToConsole = true;
   // enableLogging("tree,verbose");
-  function doTest()
-  {
+  function doTest() {
     var tree =
      { DOCUMENT: [
        { TEXT_CONTAINER: [ // head
          { TEXT_CONTAINER: [ // link
            { STATICTEXT: [] }, // generated content
            { STATICTEXT: [] } // generated content
          ] }
        ] },
--- a/accessible/tests/mochitest/tree/test_filectrl.html
+++ b/accessible/tests/mochitest/tree/test_filectrl.html
@@ -11,18 +11,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="../role.js"></script>
 
   <script type="application/javascript">
-    function doTest()
-    {
+    function doTest() {
       var accTree = {
         role: ROLE_TEXT_CONTAINER,
         children: [
           {
             role: ROLE_PUSHBUTTON
           },
           {
             role: ROLE_LABEL,
--- a/accessible/tests/mochitest/tree/test_formctrl.html
+++ b/accessible/tests/mochitest/tree/test_formctrl.html
@@ -10,18 +10,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() {
       // input@type="checkbox"
       var accTree = {
         role: ROLE_CHECKBUTTON,
         children: [ ]
       };
 
       testAccessibleTree("checkbox", accTree);
 
--- a/accessible/tests/mochitest/tree/test_gencontent.html
+++ b/accessible/tests/mochitest/tree/test_gencontent.html
@@ -19,18 +19,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() {
       // :before and :after pseudo styles
       var accTree = {
         role: ROLE_SECTION,
         children: [
           {
             role: ROLE_STATICTEXT,
             name: "START"
           },
--- a/accessible/tests/mochitest/tree/test_iframe.html
+++ b/accessible/tests/mochitest/tree/test_iframe.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() {
       var accTree = {
         role: ROLE_INTERNAL_FRAME,
         children: [
           {
             role: ROLE_DOCUMENT
           }
         ]
       };
--- a/accessible/tests/mochitest/tree/test_img.html
+++ b/accessible/tests/mochitest/tree/test_img.html
@@ -14,23 +14,21 @@
           src="../common.js"></script>
   <script type="application/javascript"
           src="../role.js"></script>
   <script type="application/javascript"
           src="../events.js"></script>
 
   <script type="application/javascript">
     // gA11yEventDumpToConsole = true;
-    function doPreTest()
-    {
+    function doPreTest() {
       waitForImageMap("imgmap", doTest);
     }
 
-    function doTest()
-    {
+    function doTest() {
       // image map
       var accTree = {
         role: ROLE_IMAGE_MAP,
         children: [
           {
             role: ROLE_LINK,
             children: []
           },
--- a/accessible/tests/mochitest/tree/test_invalid_img.xhtml
+++ b/accessible/tests/mochitest/tree/test_invalid_img.xhtml
@@ -10,18 +10,17 @@
 
   <script type="application/javascript"
           src="../common.js"></script>
   <script type="application/javascript"
           src="../role.js"></script>
 
   <script>
   <![CDATA[
-    function doTest()
-    {
+    function doTest() {
       document.getElementsByTagName("img")[0].firstChild.data = "2";
 
       var accTree = {
         role: ROLE_TEXT,
         children: [ { role: ROLE_TEXT_LEAF } ]
       };
       testAccessibleTree("the_img", accTree);
       SimpleTest.finish();
--- a/accessible/tests/mochitest/tree/test_invalidationlist.html
+++ b/accessible/tests/mochitest/tree/test_invalidationlist.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="../states.js"></script>
 
   <script type="application/javascript">
-  function doTest()
-  {
+  function doTest() {
     var tree =
      { SECTION: [
        { SECTION: [ // div
          { LABEL: [ ] } // link
        ] },
        { SECTION: [ // div table-cell referred by label
          { TEXT_LEAF: [ ] }, // 'Z'
          { TEXT_LEAF: [ ] } // ' '
--- a/accessible/tests/mochitest/tree/test_list.html
+++ b/accessible/tests/mochitest/tree/test_list.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 listItemTree(aBulletText, aName, aSubtree)
-    {
+    function listItemTree(aBulletText, aName, aSubtree) {
       var obj = {
         role: ROLE_LISTITEM,
         children: [
           {
             role: ROLE_STATICTEXT,
             name: aBulletText
           },
           {
@@ -31,18 +30,17 @@
       };
 
       if (aSubtree)
         obj.children.push(aSubtree);
 
       return obj;
     }
 
-    function doTest()
-    {
+    function doTest() {
       // list1
       var discAccTree = {
         role: ROLE_LIST,
         children: [
           new listItemTree(kDiscBulletText, "Oranges"),
           new listItemTree(kDiscBulletText, "Apples"),
           new listItemTree(kDiscBulletText, "Bananas")
         ]
--- a/accessible/tests/mochitest/tree/test_map.html
+++ b/accessible/tests/mochitest/tree/test_map.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() {
       // map used as imagemap, not accessible
       var accTree =
         { SECTION: [ ] };
 
       testAccessibleTree("imagemapcontainer", accTree);
 
       // map group.  Imagemaps are inlines by default, so TEXT_CONTAINER.
       accTree =
--- a/accessible/tests/mochitest/tree/test_media.html
+++ b/accessible/tests/mochitest/tree/test_media.html
@@ -14,18 +14,17 @@ https://bugzilla.mozilla.org/show_bug.cg
           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() {
       // ////////////////////////////////////////////////////////////////////////
       // test the accessible tree
 
       var accTree = {
         role: ROLE_GROUPING,
         children: [
           { // start/stop button
             role: ROLE_PUSHBUTTON,
--- a/accessible/tests/mochitest/tree/test_select.html
+++ b/accessible/tests/mochitest/tree/test_select.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() {
       var accTree = {
         role: ROLE_LISTBOX,
         children: [
           {
             role: ROLE_GROUPING,
             children: [
               {
                 role: ROLE_STATICTEXT,
--- a/accessible/tests/mochitest/tree/test_table.html
+++ b/accessible/tests/mochitest/tree/test_table.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() {
       // ////////////////////////////////////////////////////////////////////////
       // tables having captions
 
       // Two captions, first is used, second is ignored.
       var accTree =
         { TABLE: [
           { CAPTION: [
             {
--- a/accessible/tests/mochitest/tree/test_txtcntr.html
+++ b/accessible/tests/mochitest/tree/test_txtcntr.html
@@ -10,18 +10,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 accTree = {
         role: ROLE_SECTION,
         children: [
           { // text child
             role: ROLE_TEXT_LEAF,
             children: []
           }
         ]
--- a/accessible/tests/mochitest/tree/test_txtctrl.html
+++ b/accessible/tests/mochitest/tree/test_txtctrl.html
@@ -10,18 +10,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() {
       // editable div
       var accTree = {
         role: ROLE_SECTION,
         children: [
           { // text child
             role: ROLE_TEXT_LEAF,
             children: []
           }
--- a/accessible/tests/mochitest/treeupdate/test_ariadialog.html
+++ b/accessible/tests/mochitest/treeupdate/test_ariadialog.html
@@ -17,66 +17,61 @@
   <script type="application/javascript"
           src="../events.js"></script>
 
   <script type="application/javascript">
 
     // //////////////////////////////////////////////////////////////////////////
     // Invokers
 
-    function showARIADialog(aID)
-    {
+    function showARIADialog(aID) {
       this.node = getNode(aID);
 
       this.eventSeq = [
         new invokerChecker(EVENT_SHOW, this.node)
       ];
 
-      this.invoke = function showARIADialog_invoke()
-      {
+      this.invoke = function showARIADialog_invoke() {
         getNode("dialog").style.display = "block";
         getNode("table").style.visibility = "visible";
         getNode("a").textContent = "link";
         getNode("input").value = "hello";
         getNode("input").focus();
       }
 
-      this.finalCheck = function showARIADialog_finalCheck()
-      {
+      this.finalCheck = function showARIADialog_finalCheck() {
         var tree = {
           role: ROLE_DIALOG,
           children: [
             {
               role: ROLE_PUSHBUTTON,
               children: [ { role: ROLE_TEXT_LEAF } ]
             },
             {
               role: ROLE_ENTRY
             }
           ]
         };
         testAccessibleTree(aID, tree);
       }
 
-      this.getID = function showARIADialog_getID()
-      {
+      this.getID = function showARIADialog_getID() {
         return "show ARIA dialog";
       }
     }
 
     // //////////////////////////////////////////////////////////////////////////
     // Test
 
     // gA11yEventDumpID = "eventdump"; // debug stuff
     // gA11yEventDumpToConsole = true;
 
     var gQueue = null;
 
-    function doTest()
-    {
+    function doTest() {
       // enableLogging("tree");
       gQueue = new eventQueue();
 
       // make the accessible an inaccessible
       gQueue.push(new showARIADialog("dialog"));
 
       gQueue.invoke(); // SimpleTest.finish() will be called in the end
     }
--- a/accessible/tests/mochitest/treeupdate/test_ariaowns.html
+++ b/accessible/tests/mochitest/treeupdate/test_ariaowns.html
@@ -18,572 +18,508 @@
           src="../events.js"></script>
 
   <script type="application/javascript">
 
     // //////////////////////////////////////////////////////////////////////////
     // Invokers
     // //////////////////////////////////////////////////////////////////////////
 
-    function changeARIAOwns()
-    {
+    function changeARIAOwns() {
       this.eventSeq = [
         new invokerChecker(EVENT_HIDE, getNode("t1_button")),
         // no hide for t1_subdiv because it is contained by hidden t1_checkbox
         new invokerChecker(EVENT_HIDE, getNode("t1_checkbox")),
         new invokerChecker(EVENT_SHOW, getNode("t1_checkbox")),
         new invokerChecker(EVENT_SHOW, getNode("t1_button")),
         new invokerChecker(EVENT_SHOW, getNode("t1_subdiv")),
         new invokerChecker(EVENT_REORDER, getNode("t1_container"))
       ];
 
-      this.invoke = function setARIAOwns_invoke()
-      {
+      this.invoke = function setARIAOwns_invoke() {
         // children are swapped by ARIA owns
         var tree =
           { SECTION: [
               { CHECKBUTTON: [
                 { SECTION: [] }
               ] },
               { PUSHBUTTON: [ ] }
           ] };
         testAccessibleTree("t1_container", tree);
 
         getNode("t1_container").
           setAttribute("aria-owns", "t1_button t1_subdiv");
       }
 
-      this.finalCheck = function setARIAOwns_finalCheck()
-      {
+      this.finalCheck = function setARIAOwns_finalCheck() {
         // children are swapped again, button and subdiv are appended to
         // the children.
         var tree =
           { SECTION: [
               { CHECKBUTTON: [ ] }, // checkbox, native order
               { PUSHBUTTON: [ ] }, // button, rearranged by ARIA own
               { SECTION: [ ] } // subdiv from the subtree, ARIA owned
           ] };
         testAccessibleTree("t1_container", tree);
       }
 
-      this.getID = function setARIAOwns_getID()
-      {
+      this.getID = function setARIAOwns_getID() {
         return "Change @aria-owns attribute";
       }
     }
 
-    function removeARIAOwns()
-    {
+    function removeARIAOwns() {
       this.eventSeq = [
         new invokerChecker(EVENT_HIDE, getNode("t1_button")),
         new invokerChecker(EVENT_HIDE, getNode("t1_subdiv")),
         new orderChecker(),
         new asyncInvokerChecker(EVENT_SHOW, getNode("t1_button")),
         new asyncInvokerChecker(EVENT_SHOW, getNode("t1_subdiv")),
         new orderChecker(),
         new invokerChecker(EVENT_REORDER, getNode("t1_container")),
         new unexpectedInvokerChecker(EVENT_REORDER, getNode("t1_checkbox"))
       ];
 
-      this.invoke = function removeARIAOwns_invoke()
-      {
+      this.invoke = function removeARIAOwns_invoke() {
         getNode("t1_container").removeAttribute("aria-owns");
       }
 
-      this.finalCheck = function removeARIAOwns_finalCheck()
-      {
+      this.finalCheck = function removeARIAOwns_finalCheck() {
         // children follow the DOM order
         var tree =
           { SECTION: [
               { PUSHBUTTON: [ ] },
               { CHECKBUTTON: [
                   { SECTION: [] }
               ] }
           ] };
         testAccessibleTree("t1_container", tree);
       }
 
-      this.getID = function removeARIAOwns_getID()
-      {
+      this.getID = function removeARIAOwns_getID() {
         return "Remove @aria-owns attribute";
       }
     }
 
-    function setARIAOwns()
-    {
+    function setARIAOwns() {
       this.eventSeq = [
         new invokerChecker(EVENT_HIDE, getNode("t1_button")),
         new invokerChecker(EVENT_HIDE, getNode("t1_subdiv")),
         new invokerChecker(EVENT_SHOW, getNode("t1_button")),
         new invokerChecker(EVENT_SHOW, getNode("t1_subdiv")),
         new invokerChecker(EVENT_REORDER, getNode("t1_container"))
       ];
 
-      this.invoke = function setARIAOwns_invoke()
-      {
+      this.invoke = function setARIAOwns_invoke() {
         getNode("t1_container").
           setAttribute("aria-owns", "t1_button t1_subdiv");
       }
 
-      this.finalCheck = function setARIAOwns_finalCheck()
-      {
+      this.finalCheck = function setARIAOwns_finalCheck() {
         // children are swapped again, button and subdiv are appended to
         // the children.
         var tree =
           { SECTION: [
               { CHECKBUTTON: [ ] }, // checkbox
               { PUSHBUTTON: [ ] }, // button, rearranged by ARIA own
               { SECTION: [ ] } // subdiv from the subtree, ARIA owned
           ] };
         testAccessibleTree("t1_container", tree);
       }
 
-      this.getID = function setARIAOwns_getID()
-      {
+      this.getID = function setARIAOwns_getID() {
         return "Set @aria-owns attribute";
       }
     }
 
-    function addIdToARIAOwns()
-    {
+    function addIdToARIAOwns() {
       this.eventSeq = [
         new invokerChecker(EVENT_HIDE, getNode("t1_group")),
         new invokerChecker(EVENT_SHOW, getNode("t1_group")),
         new invokerChecker(EVENT_REORDER, document)
       ];
 
-      this.invoke = function addIdToARIAOwns_invoke()
-      {
+      this.invoke = function addIdToARIAOwns_invoke() {
         getNode("t1_container").
           setAttribute("aria-owns", "t1_button t1_subdiv t1_group");
       }
 
-      this.finalCheck = function addIdToARIAOwns_finalCheck()
-      {
+      this.finalCheck = function addIdToARIAOwns_finalCheck() {
         // children are swapped again, button and subdiv are appended to
         // the children.
         var tree =
           { SECTION: [
               { CHECKBUTTON: [ ] }, // t1_checkbox
               { PUSHBUTTON: [ ] }, // button, t1_button
               { SECTION: [ ] }, // subdiv from the subtree, t1_subdiv
               { GROUPING: [ ] } // group from outside, t1_group
           ] };
         testAccessibleTree("t1_container", tree);
       }
 
-      this.getID = function addIdToARIAOwns_getID()
-      {
+      this.getID = function addIdToARIAOwns_getID() {
         return "Add id to @aria-owns attribute value";
       }
     }
 
-    function appendEl()
-    {
+    function appendEl() {
       this.eventSeq = [
         new invokerChecker(EVENT_SHOW, getNode, "t1_child3"),
         new invokerChecker(EVENT_REORDER, getNode("t1_container"))
       ];
 
-      this.invoke = function appendEl_invoke()
-      {
+      this.invoke = function appendEl_invoke() {
         var div = document.createElement("div");
         div.setAttribute("id", "t1_child3");
         div.setAttribute("role", "radio")
         getNode("t1_container").appendChild(div);
       }
 
-      this.finalCheck = function appendEl_finalCheck()
-      {
+      this.finalCheck = function appendEl_finalCheck() {
         // children are invalidated, they includes aria-owns swapped kids and
         // newly inserted child.
         var tree =
           { SECTION: [
               { CHECKBUTTON: [ ] }, // existing explicit, t1_checkbox
               { RADIOBUTTON: [ ] }, // new explicit, t1_child3
               { PUSHBUTTON: [ ] }, // ARIA owned, t1_button
               { SECTION: [ ] }, // ARIA owned, t1_subdiv
               { GROUPING: [ ] } // ARIA owned, t1_group
           ] };
         testAccessibleTree("t1_container", tree);
       }
 
-      this.getID = function appendEl_getID()
-      {
+      this.getID = function appendEl_getID() {
         return "Append child under @aria-owns element";
       }
     }
 
-    function removeEl()
-    {
+    function removeEl() {
       this.eventSeq = [
         new invokerChecker(EVENT_HIDE, getNode, "t1_checkbox"),
         new invokerChecker(EVENT_SHOW, getNode, "t1_checkbox"),
         new invokerChecker(EVENT_REORDER, getNode("t1_container"))
       ];
 
-      this.invoke = function removeEl_invoke()
-      {
+      this.invoke = function removeEl_invoke() {
         // remove a container of t1_subdiv
         getNode("t1_span").remove();
       }
 
-      this.finalCheck = function removeEl_finalCheck()
-      {
+      this.finalCheck = function removeEl_finalCheck() {
         // subdiv should go away
         var tree =
           { SECTION: [
               { CHECKBUTTON: [ ] }, // explicit, t1_checkbox
               { RADIOBUTTON: [ ] }, // explicit, t1_child3
               { PUSHBUTTON: [ ] }, // ARIA owned, t1_button
               { GROUPING: [ ] } // ARIA owned, t1_group
           ] };
         testAccessibleTree("t1_container", tree);
       }
 
-      this.getID = function removeEl_getID()
-      {
+      this.getID = function removeEl_getID() {
         return "Remove a container of ARIA owned element";
       }
     }
 
-    function removeId()
-    {
+    function removeId() {
       this.eventSeq = [
         new invokerChecker(EVENT_HIDE, getNode("t1_group")),
         new invokerChecker(EVENT_SHOW, getNode("t1_group")),
         new invokerChecker(EVENT_REORDER, document)
       ];
 
-      this.invoke = function removeId_invoke()
-      {
+      this.invoke = function removeId_invoke() {
         getNode("t1_group").removeAttribute("id");
       }
 
-      this.finalCheck = function removeId_finalCheck()
-      {
+      this.finalCheck = function removeId_finalCheck() {
         var tree =
           { SECTION: [
               { CHECKBUTTON: [ ] },
               { RADIOBUTTON: [ ] },
               { PUSHBUTTON: [ ] } // ARIA owned, t1_button
           ] };
         testAccessibleTree("t1_container", tree);
       }
 
-      this.getID = function removeId_getID()
-      {
+      this.getID = function removeId_getID() {
         return "Remove ID from ARIA owned element";
       }
     }
 
-    function setId()
-    {
+    function setId() {
       this.eventSeq = [
         new invokerChecker(EVENT_HIDE, getNode("t1_grouptmp")),
         new invokerChecker(EVENT_SHOW, getNode("t1_grouptmp")),
         new invokerChecker(EVENT_REORDER, document)
       ];
 
-      this.invoke = function setId_invoke()
-      {
+      this.invoke = function setId_invoke() {
         getNode("t1_grouptmp").setAttribute("id", "t1_group");
       }
 
-      this.finalCheck = function setId_finalCheck()
-      {
+      this.finalCheck = function setId_finalCheck() {
         var tree =
           { SECTION: [
               { CHECKBUTTON: [ ] },
               { RADIOBUTTON: [ ] },
               { PUSHBUTTON: [ ] }, // ARIA owned, t1_button
               { GROUPING: [ ] } // ARIA owned, t1_group, previously t1_grouptmp
           ] };
         testAccessibleTree("t1_container", tree);
       }
 
-      this.getID = function setId_getID()
-      {
+      this.getID = function setId_getID() {
         return "Set ID that is referred by ARIA owns";
       }
     }
 
     /**
      * Remove an accessible DOM element containing an element referred by
      * ARIA owns.
      */
-    function removeA11eteiner()
-    {
+    function removeA11eteiner() {
       this.eventSeq = [
         new invokerChecker(EVENT_REORDER, getNode("t2_container1"))
       ];
 
-      this.invoke = function removeA11eteiner_invoke()
-      {
+      this.invoke = function removeA11eteiner_invoke() {
         var tree =
           { SECTION: [
               { CHECKBUTTON: [ ] } // ARIA owned, 't2_owned'
           ] };
         testAccessibleTree("t2_container1", tree);
 
         getNode("t2_container2").removeChild(getNode("t2_container3"));
       }
 
-      this.finalCheck = function removeA11eteiner_finalCheck()
-      {
+      this.finalCheck = function removeA11eteiner_finalCheck() {
         var tree =
           { SECTION: [
           ] };
         testAccessibleTree("t2_container1", tree);
       }
 
-      this.getID = function removeA11eteiner_getID()
-      {
+      this.getID = function removeA11eteiner_getID() {
         return "Remove an accessible DOM element containing an element referred by ARIA owns";
       }
     }
 
     /**
      * Steal an element from other ARIA owns element. This use case guarantees
      * that result of setAttribute/removeAttribute doesn't depend on their order.
      */
-    function stealFromOtherARIAOwns()
-    {
+    function stealFromOtherARIAOwns() {
       this.eventSeq = [
         new invokerChecker(EVENT_REORDER, getNode("t3_container2"))
       ];
 
-      this.invoke = function stealFromOtherARIAOwns_invoke()
-      {
+      this.invoke = function stealFromOtherARIAOwns_invoke() {
         getNode("t3_container2").setAttribute("aria-owns", "t3_child");
       }
 
-      this.finalCheck = function stealFromOtherARIAOwns_finalCheck()
-      {
+      this.finalCheck = function stealFromOtherARIAOwns_finalCheck() {
         var tree =
           { SECTION: [
           ] };
         testAccessibleTree("t3_container1", tree);
 
         tree =
           { SECTION: [
             { CHECKBUTTON: [
             ] }
           ] };
         testAccessibleTree("t3_container2", tree);
       }
 
-      this.getID = function stealFromOtherARIAOwns_getID()
-      {
+      this.getID = function stealFromOtherARIAOwns_getID() {
         return "Steal an element from other ARIA owns element";
       }
     }
 
-    function appendElToRecacheChildren()
-    {
+    function appendElToRecacheChildren() {
       this.eventSeq = [
         new invokerChecker(EVENT_REORDER, getNode("t3_container2"))
       ];
 
-      this.invoke = function appendElToRecacheChildren_invoke()
-      {
+      this.invoke = function appendElToRecacheChildren_invoke() {
         var div = document.createElement("div");
         div.setAttribute("role", "radio")
         getNode("t3_container2").appendChild(div);
       }
 
-      this.finalCheck = function appendElToRecacheChildren_finalCheck()
-      {
+      this.finalCheck = function appendElToRecacheChildren_finalCheck() {
         var tree =
           { SECTION: [
           ] };
         testAccessibleTree("t3_container1", tree);
 
         tree =
           { SECTION: [
             { RADIOBUTTON: [ ] },
             { CHECKBUTTON: [ ] } // ARIA owned
           ] };
         testAccessibleTree("t3_container2", tree);
       }
 
-      this.getID = function appendElToRecacheChildren_getID()
-      {
+      this.getID = function appendElToRecacheChildren_getID() {
         return "Append a child under @aria-owns element to trigger children recache";
       }
     }
 
-    function showHiddenElement()
-    {
+    function showHiddenElement() {
       this.eventSeq = [
         new invokerChecker(EVENT_REORDER, getNode("t4_container1"))
       ];
 
-      this.invoke = function showHiddenElement_invoke()
-      {
+      this.invoke = function showHiddenElement_invoke() {
         var tree =
           { SECTION: [
             { RADIOBUTTON: [] }
           ] };
         testAccessibleTree("t4_container1", tree);
 
         getNode("t4_child1").style.display = "block";
       }
 
-      this.finalCheck = function showHiddenElement_finalCheck()
-      {
+      this.finalCheck = function showHiddenElement_finalCheck() {
         var tree =
           { SECTION: [
             { CHECKBUTTON: [] },
             { RADIOBUTTON: [] }
           ] };
         testAccessibleTree("t4_container1", tree);
       }
 
-      this.getID = function showHiddenElement_getID()
-      {
+      this.getID = function showHiddenElement_getID() {
         return "Show hidden ARIA owns referred element";
       }
     }
 
-    function rearrangeARIAOwns(aContainer, aAttr, aIdList, aRoleList)
-    {
+    function rearrangeARIAOwns(aContainer, aAttr, aIdList, aRoleList) {
       this.eventSeq = [];
       for (var id of aIdList) {
         this.eventSeq.push(new invokerChecker(EVENT_HIDE, getNode(id)));
       }
 
       for (var id of aIdList) {
         this.eventSeq.push(new invokerChecker(EVENT_SHOW, getNode(id)));
       }
       this.eventSeq.push(new invokerChecker(EVENT_REORDER, getNode(aContainer)));
 
-      this.invoke = function rearrangeARIAOwns_invoke()
-      {
+      this.invoke = function rearrangeARIAOwns_invoke() {
         getNode(aContainer).setAttribute("aria-owns", aAttr);
       }
 
-      this.finalCheck = function rearrangeARIAOwns_finalCheck()
-      {
+      this.finalCheck = function rearrangeARIAOwns_finalCheck() {
         var tree = { SECTION: [ ] };
         for (var role of aRoleList) {
           var ch = {};
           ch[role] = [];
           tree.SECTION.push(ch);
         }
         testAccessibleTree(aContainer, tree);
       }
 
-      this.getID = function rearrangeARIAOwns_getID()
-      {
+      this.getID = function rearrangeARIAOwns_getID() {
         return `Rearrange @aria-owns attribute to '${aAttr}'`;
       }
     }
 
-    function removeNotARIAOwnedEl(aContainer, aChild)
-    {
+    function removeNotARIAOwnedEl(aContainer, aChild) {
       this.eventSeq = [
         new invokerChecker(EVENT_REORDER, aContainer)
       ];
 
-      this.invoke = function removeNotARIAOwnedEl_invoke()
-      {
+      this.invoke = function removeNotARIAOwnedEl_invoke() {
         var tree = {
           SECTION: [
             { TEXT_LEAF: [ ] },
             { GROUPING: [ ] }
           ]
         };
         testAccessibleTree(aContainer, tree);
 
         getNode(aContainer).removeChild(getNode(aChild));
       }
 
-      this.finalCheck = function removeNotARIAOwnedEl_finalCheck()
-      {
+      this.finalCheck = function removeNotARIAOwnedEl_finalCheck() {
         var tree = {
           SECTION: [
             { GROUPING: [ ] }
           ]
         };
         testAccessibleTree(aContainer, tree);
       }
 
-      this.getID = function removeNotARIAOwnedEl_getID()
-      {
+      this.getID = function removeNotARIAOwnedEl_getID() {
         return `remove not ARIA owned child`;
       }
     }
 
-    function setARIAOwnsOnElToRemove(aParent, aChild)
-    {
+    function setARIAOwnsOnElToRemove(aParent, aChild) {
       this.eventSeq = [
         new invokerChecker(EVENT_HIDE, getAccessible(aParent))
       ];
 
-      this.invoke = function setARIAOwnsOnElToRemove_invoke()
-      {
+      this.invoke = function setARIAOwnsOnElToRemove_invoke() {
         getNode(aChild).setAttribute("aria-owns", "no_id");
         getNode(aParent).removeChild(getNode(aChild));
         getNode(aParent).remove();
       }
 
-      this.getID = function setARIAOwnsOnElToRemove_getID()
-      {
+      this.getID = function setARIAOwnsOnElToRemove_getID() {
         return `set ARIA owns on an element, and then remove it, and then remove its parent`;
       }
     }
 
     /**
      * Set ARIA owns on inaccessible span element that contains
      * accessible children. This will move children from the container for
      * the span.
      */
-    function test8()
-    {
+    function test8() {
       this.eventSeq = [
         new invokerChecker(EVENT_REORDER, "t8_container")
       ];
 
-      this.invoke = function test8_invoke()
-      {
+      this.invoke = function test8_invoke() {
         var tree =
           { SECTION: [
             { PUSHBUTTON: [] },
             { ENTRY: [] },
             { ENTRY: [] },
             { ENTRY: [] }
           ] };
         testAccessibleTree("t8_container", tree);
 
         getNode(t8_container).setAttribute("aria-owns", "t8_span t8_button");
       }
 
-      this.finalCheck = function test8_finalCheck()
-      {
+      this.finalCheck = function test8_finalCheck() {
         var tree =
           { SECTION: [
             { TEXT: [
               { ENTRY: [] },
               { ENTRY: [] },
               { ENTRY: [] }
             ] },
             { PUSHBUTTON: [] }
           ] };
         testAccessibleTree("t8_container", tree);
       }
 
-      this.getID = function test8_getID()
-      {
+      this.getID = function test8_getID() {
         return `Set ARIA owns on inaccessible span element that contains accessible children`;
       }
     }
 
-    function test9_prepare()
-    {
+    function test9_prepare() {
       this.eventSeq = [
         new invokerChecker(EVENT_SHOW, () => {
           let doc = getNode("t9_container").contentDocument;
           return doc && doc.getElementById("container");
         })
       ];
 
       this.invoke = () => {
@@ -611,18 +547,17 @@
         testAccessibleTree("t9_container", tree);
       }
 
       this.getID = () => {
         return `Set ARIA owns on a document (part1)`;
       }
     }
 
-    function test9_setARIAOwns()
-    {
+    function test9_setARIAOwns() {
       this.eventSeq = [
         new invokerChecker(EVENT_SHOW, () => {
           let doc = getNode("t9_container").contentDocument;
           return doc && doc.getElementById("input");
         })
       ];
 
       this.invoke = () => {
@@ -641,18 +576,17 @@
         testAccessibleTree("t9_container", tree);
       }
 
       this.getID = () => {
         return `Set ARIA owns on a document (part2)`;
       }
     }
 
-    function test9_finish()
-    {
+    function test9_finish() {
       this.eventSeq = [
         new invokerChecker(EVENT_REORDER, () => {
           return getNode("t9_container").contentDocument;
         })
       ];
 
       this.invoke = () => {
         // trigger a tree update.
@@ -675,18 +609,17 @@
       this.getID = () => {
         return `Set ARIA owns on a document (part3)`;
       }
     }
 
     /**
      * Put ARIA owned child back when ARIA owner removed.
      */
-    function test10_removeARIAOwner()
-    {
+    function test10_removeARIAOwner() {
       this.eventSeq = [
         new invokerChecker(EVENT_HIDE, getAccessible("t10_owner"))
       ];
 
       this.invoke = () => {
         let tree =
           { SECTION: [ // t10_container
             { SECTION: [ // t10_owner
@@ -698,18 +631,17 @@
         getNode("t10_owner").remove();
       }
 
       this.getID = () => {
         return "Put aria owned child back when aria owner removed";
       }
     }
 
-    function test10_finishTest()
-    {
+    function test10_finishTest() {
       this.eventSeq = [
         new invokerChecker(EVENT_REORDER, "t10_container")
       ];
 
       this.invoke = () => {
         // trigger a tree update.
         getNode("t10_container").append(document.createElement("p"));
       }
@@ -733,18 +665,17 @@
     // Test
     // //////////////////////////////////////////////////////////////////////////
 
     // gA11yEventDumpToConsole = true;
     // enableLogging("tree,eventTree,verbose"); // debug stuff
 
     var gQueue = null;
 
-    function doTest()
-    {
+    function doTest() {
       gQueue = new eventQueue();
 
       // test1
       gQueue.push(new changeARIAOwns());
       gQueue.push(new removeARIAOwns());
       gQueue.push(new setARIAOwns());
       gQueue.push(new addIdToARIAOwns());
       gQueue.push(new appendEl());
--- a/accessible/tests/mochitest/treeupdate/test_bug1040735.html
+++ b/accessible/tests/mochitest/treeupdate/test_bug1040735.html
@@ -7,18 +7,17 @@
         href="chrome://mochikit/content/tests/SimpleTest/test.css" />
 
   <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 doTest()
-    {
+    function doTest() {
       document.body.appendChild(document.getElementById("mw_a"));
       setTimeout(function() { ok(true, "no crash and assertions"); SimpleTest.finish(); } , 0);
     }
 
     SimpleTest.waitForExplicitFinish();
     addA11yLoadEvent(doTest);
   </script>
 </head>
--- a/accessible/tests/mochitest/treeupdate/test_bug1100602.html
+++ b/accessible/tests/mochitest/treeupdate/test_bug1100602.html
@@ -14,75 +14,66 @@
           src="../name.js"></script>
   <script type="application/javascript"
           src="../events.js"></script>
 
   <script type="application/javascript">
     /**
      * Change list style type to none.
      */
-    function hideBullet()
-    {
+    function hideBullet() {
       this.eventSeq = [];
       this.liAcc = getAccessible("list_element");
       this.bullet = this.liAcc.firstChild;
 
       this.eventSeq.push(new invokerChecker(EVENT_HIDE, this.bullet));
       this.eventSeq.push(new invokerChecker(EVENT_REORDER, this.liAcc));
 
-      this.invoke = function hideBullet_invoke()
-      {
+      this.invoke = function hideBullet_invoke() {
         getNode("list").setAttribute("style", "list-style-type: none;");
       }
 
-      this.finalCheck = function hideBullet_finalCheck()
-      {
+      this.finalCheck = function hideBullet_finalCheck() {
         is(this.liAcc.name, "list element",
           "Check that first child of LI is not a bullet.");
       }
 
-      this.getID = function hideBullet_getID()
-      {
+      this.getID = function hideBullet_getID() {
         return "Hide bullet by setting style to none";
       }
     }
 
     /**
      * Change list style type to circles.
      */
-    function showBullet()
-    {
+    function showBullet() {
       this.eventSeq = [];
       this.liAcc = getAccessible("list_element");
 
       this.eventSeq.push(new invokerChecker(EVENT_SHOW,
                                             function(aNode) { return aNode.firstChild; },
                                             this.liAcc));
       this.eventSeq.push(new invokerChecker(EVENT_REORDER, this.liAcc));
 
-      this.invoke = function showBullet_invoke()
-      {
+      this.invoke = function showBullet_invoke() {
         getNode("list").setAttribute("style", "list-style-type: circle;");
       }
 
-      this.finalCheck = function showBullet_finalCheck()
-      {
+      this.finalCheck = function showBullet_finalCheck() {
         is(this.liAcc.name, "â—¦ list element",
           "Check that first child of LI is a circle bullet.");
       }
 
-      this.getID = function showBullet_getID()
-      {
+      this.getID = function showBullet_getID() {
         return "Show bullet by setting style to circle";
       }
     }
 
     var gQueue = null;
-    function doTest()
-    {
+    function doTest() {
 
       var list = getNode("list");
       list.setAttribute("style", "list-style-type: circle;");
 
       gQueue = new eventQueue();
       gQueue.push(new hideBullet());
       gQueue.push(new showBullet());
       gQueue.invoke(); // SimpleTest.finish();
--- a/accessible/tests/mochitest/treeupdate/test_bug1175913.html
+++ b/accessible/tests/mochitest/treeupdate/test_bug1175913.html
@@ -14,69 +14,60 @@
           src="../role.js"></script>
   <script type="application/javascript"
           src="../events.js"></script>
 
   <script type="application/javascript">
 
     function dummyListener() {}
 
-    function testAddListener()
-    {
+    function testAddListener() {
       this.eventSeq = [
         new invokerChecker(EVENT_SHOW, getNode("parent")),
       ];
 
-      this.invoke = function testAddListener_invoke()
-      {
+      this.invoke = function testAddListener_invoke() {
         is(getAccessible("parent", null, null, DONOTFAIL_IF_NO_ACC), null, "Check that parent is not accessible.");
         is(getAccessible("child", null, null, DONOTFAIL_IF_NO_ACC), null, "Check that child is not accessible.");
         getNode("parent").addEventListener("click", dummyListener);
       }
 
-      this.finalCheck = function testAddListener_finalCheck()
-      {
+      this.finalCheck = function testAddListener_finalCheck() {
         var tree = { TEXT: [] };
         testAccessibleTree("parent", tree);
       }
 
-      this.getID = function testAddListener_getID()
-      {
+      this.getID = function testAddListener_getID() {
         return "Test that show event is sent when click listener is added";
       }
     }
 
-    function testRemoveListener()
-    {
+    function testRemoveListener() {
       this.eventSeq = [
         new unexpectedInvokerChecker(EVENT_HIDE, getNode("parent")),
       ];
 
-      this.invoke = function testRemoveListener_invoke()
-      {
+      this.invoke = function testRemoveListener_invoke() {
         getNode("parent").removeEventListener("click", dummyListener);
       }
 
-      this.finalCheck = function testRemoveListener_finalCheck()
-      {
+      this.finalCheck = function testRemoveListener_finalCheck() {
         ok(getAccessible("parent", null, null, DONOTFAIL_IF_NO_ACC),
            "Parent stays accessible after click event listener is removed");
         ok(!getAccessible("child", null, null, DONOTFAIL_IF_NO_ACC),
            "Child stays inaccessible");
       }
 
-      this.getID = function testRemoveListener_getID()
-      {
+      this.getID = function testRemoveListener_getID() {
         return "Test that hide event is sent when click listener is removed";
       }
     }
 
     var gQueue = null;
-    function doTest()
-    {
+    function doTest() {
       gQueue = new eventQueue();
       gQueue.push(new testAddListener());
       gQueue.push(new testRemoveListener());
       gQueue.invoke(); // SimpleTest.finish();
     }
 
     SimpleTest.waitForExplicitFinish();
     addA11yLoadEvent(doTest);
--- a/accessible/tests/mochitest/treeupdate/test_bug1189277.html
+++ b/accessible/tests/mochitest/treeupdate/test_bug1189277.html
@@ -11,51 +11,47 @@
   <script type="application/javascript"
           src="../common.js"></script>
   <script type="application/javascript"
           src="../name.js"></script>
   <script type="application/javascript"
           src="../events.js"></script>
 
   <script type="application/javascript">
-    function runTest()
-    {
+    function runTest() {
       this.containerNode = getNode("outerDiv");
 
       this.eventSeq = [
         new invokerChecker(EVENT_HIDE, getNode("child")),
         new invokerChecker(EVENT_HIDE, getNode("childDoc")),
         new invokerChecker(EVENT_SHOW, "newChildDoc"),
         new invokerChecker(EVENT_REORDER, this.containerNode)
       ];
 
-      this.invoke = function runTest_invoke()
-      {
+      this.invoke = function runTest_invoke() {
         this.containerNode.removeChild(getNode("child"));
 
         var docContainer = getNode("docContainer");
         var iframe = document.createElement("iframe");
         iframe.setAttribute("src", "http://example.com");
         iframe.setAttribute("id", "newChildDoc");
 
         docContainer.removeChild(getNode("childDoc"));
         docContainer.appendChild(iframe);
       }
 
-      this.getID = function runTest_getID()
-      {
+      this.getID = function runTest_getID() {
         return "check show events are not incorrectly coalesced";
       }
     }
 
     // enableLogging("tree");
     gA11yEventDumpToConsole = true;
     var gQueue = null;
-    function doTest()
-    {
+    function doTest() {
       gQueue = new eventQueue();
       gQueue.push(new runTest());
       gQueue.invoke(); // SimpleTest.finish();
     }
 
     SimpleTest.waitForExplicitFinish();
     addA11yLoadEvent(doTest);
   </script>
--- a/accessible/tests/mochitest/treeupdate/test_bug1276857.html
+++ b/accessible/tests/mochitest/treeupdate/test_bug1276857.html
@@ -12,18 +12,17 @@
   <script type="application/javascript"
           src="../common.js"></script>
   <script type="application/javascript"
           src="../role.js"></script>
   <script type="application/javascript"
           src="../events.js"></script>
 
   <script type="application/javascript">
-    function runTest()
-    {
+    function runTest() {
       // children change will recreate the table
       this.eventSeq = [
         new invokerChecker(EVENT_REORDER, getNode("c1"))
       ];
 
       this.invoke = function runTest_invoke() {
         var tree = {
           SECTION: [ // c1
@@ -44,24 +43,22 @@
           SECTION: [ // c1
             { TEXT_LEAF: [] }, // Some text
             { TEXT_LEAF: [] } // More text
           ]
         };
         testAccessibleTree("c1", tree);
       };
 
-      this.getID = function runTest_getID()
-      {
+      this.getID = function runTest_getID() {
         return "child DOM node is removed before the layout notifies the a11y about parent removal/show";
       };
     }
 
-    function runShadowTest()
-    {
+    function runShadowTest() {
       // children change will recreate the table
       this.eventSeq = [
         new invokerChecker(EVENT_REORDER, "c2")
       ];
 
       this.invoke = function runShadowTest_invoke() {
         var tree = {
           SECTION: [ // c2
@@ -91,18 +88,17 @@
         return "child DOM node is removed before the layout notifies the a11y about parent removal/show in shadow DOM";
       };
     }
 
     // enableLogging("tree");
     // gA11yEventDumpToConsole = true;
 
     var gQueue = null;
-    function doTest()
-    {
+    function doTest() {
       gQueue = new eventQueue();
       gQueue.push(new runTest());
       gQueue.push(new runShadowTest());
       gQueue.invoke(); // will call SimpleTest.finish();
     }
 
     SimpleTest.waitForExplicitFinish();
     addA11yLoadEvent(doTest);
--- a/accessible/tests/mochitest/treeupdate/test_bug852150.xhtml
+++ b/accessible/tests/mochitest/treeupdate/test_bug852150.xhtml
@@ -10,18 +10,17 @@
 
   <script type="application/javascript"
           src="../common.js"></script>
   <script type="application/javascript"
           src="../role.js"></script>
 
   <script>
   <![CDATA[
-    function doTest()
-    {
+    function doTest() {
       var the_displayNone = getNode("the_displaynone");
       var the_table = getNode("the_table");
       var the_row = getNode("the_row");
       ok(isAccessible(the_table), "table should be accessible");
       the_displayNone.appendChild(the_table);
       ok(!isAccessible(the_table), "table in display none tree shouldn't be accessible");
 
       setTimeout(function() {
--- a/accessible/tests/mochitest/treeupdate/test_bug883708.xhtml
+++ b/accessible/tests/mochitest/treeupdate/test_bug883708.xhtml
@@ -1,17 +1,16 @@
 <html xmlns="http://www.w3.org/1999/xhtml">
 <head>
   <script type="application/javascript"
           src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
 
 <script>
 
-function boom()
-{
+function boom() {
   var newSpan = document.createElementNS("http://www.w3.org/1999/xhtml", "span");
   c.insertBefore(newSpan, d);
   a.style.visibility = "visible";
   ok(true, "test didn't crash or assert");
   SimpleTest.finish();
 }
 
 </script>
--- a/accessible/tests/mochitest/treeupdate/test_bug884251.xhtml
+++ b/accessible/tests/mochitest/treeupdate/test_bug884251.xhtml
@@ -1,17 +1,16 @@
 <html xmlns="http://www.w3.org/1999/xhtml">
 <head>
   <script type="application/javascript"
           src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
 
 <script>
 
-function boom()
-{
+function boom() {
   document.getElementById("k").removeAttribute("href");
   ok(true, "changing iframe contents doesn't cause assertions");
   SimpleTest.finish();
 }
 
 </script>
 </head>
 
--- a/accessible/tests/mochitest/treeupdate/test_bug895082.html
+++ b/accessible/tests/mochitest/treeupdate/test_bug895082.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="../events.js"></script>
 
   <script type="application/javascript">
-function doTest()
-{
+function doTest() {
   var y = document.getElementById("y");
   var oldBody = document.body;
   var newBody = document.createElement("body")
   document.documentElement.insertBefore(newBody, oldBody);
   setTimeout(function() {
     document.documentElement.removeChild(oldBody);
     newBody.appendChild(y);
     ok(true, "we didn't assert");
--- a/accessible/tests/mochitest/treeupdate/test_canvas.html
+++ b/accessible/tests/mochitest/treeupdate/test_canvas.html
@@ -17,51 +17,47 @@
   <script type="application/javascript"
           src="../events.js"></script>
 
   <script type="application/javascript">
 
     // //////////////////////////////////////////////////////////////////////////
     // Invokers
 
-    function addSubtree(aID)
-    {
+    function addSubtree(aID) {
       this.node = getNode(aID);
 
       this.eventSeq = [
         new invokerChecker(EVENT_SHOW, this.node)
       ];
 
-      this.invoke = function addSubtree_invoke()
-      {
+      this.invoke = function addSubtree_invoke() {
         // ensure we start with no subtree
         testAccessibleTree("canvas", { CANVAS: [] });
         getNode("dialog").style.display = "block";
       }
 
       this.finalCheck = function addSubtree_finalCheck() {
         testAccessibleTree("dialog", { DIALOG: [] });
       }
 
-      this.getID = function addSubtree_getID()
-      {
+      this.getID = function addSubtree_getID() {
         return "show canvas subdom";
       }
     }
 
     // //////////////////////////////////////////////////////////////////////////
     // Test
 
     // gA11yEventDumpID = "eventdump"; // debug stuff
     // gA11yEventDumpToConsole = true;
 
     var gQueue = null;
 
-    function doTest()
-    {
+    function doTest() {
       gQueue = new eventQueue();
 
       // make the subdom come alive!
       gQueue.push(new addSubtree("dialog"));
 
       gQueue.invoke(); // SimpleTest.finish() will be called in the end
     }
 
--- a/accessible/tests/mochitest/treeupdate/test_cssoverflow.html
+++ b/accessible/tests/mochitest/treeupdate/test_cssoverflow.html
@@ -24,98 +24,89 @@
 
     /**
      * Change scroll range to not empty size and inserts a child into container
      * to trigger tree update of the container. Prior to bug 677154 not empty
      * size resulted to accessible creation for scroll area, container tree
      * update picked up that accessible unattaching scroll area accessible
      * subtree.
      */
-    function changeScrollRange(aContainerID, aScrollAreaID)
-    {
+    function changeScrollRange(aContainerID, aScrollAreaID) {
       this.containerNode = getNode(aContainerID);
       this.container = getAccessible(this.containerNode);
       this.scrollAreaNode = getNode(aScrollAreaID);
 
       this.eventSeq = [
         new invokerChecker(EVENT_REORDER, this.container)
       ];
 
-      this.invoke = function changeScrollRange_invoke()
-      {
+      this.invoke = function changeScrollRange_invoke() {
         this.scrollAreaNode.style.width = "20px";
         this.containerNode.appendChild(document.createElement("input"));
       }
 
-      this.finalCheck = function changeScrollRange_finalCheck()
-      {
+      this.finalCheck = function changeScrollRange_finalCheck() {
         var accTree =
           { SECTION: [ // container
             { SECTION: [ // scroll area
               { ENTRY: [] } // child content
             ] },
             { ENTRY: [] } // inserted input
           ] };
         testAccessibleTree(this.container, accTree);
       }
 
-      this.getID = function changeScrollRange_getID()
-      {
+      this.getID = function changeScrollRange_getID() {
         return "change scroll range for " + prettyName(aScrollAreaID);
       }
     }
 
     /**
      * Change scrollbar styles from hidden to auto. That makes us to create an
      * accessible for scroll area.
      */
-    function changeScrollbarStyles(aContainerID, aScrollAreaID)
-    {
+    function changeScrollbarStyles(aContainerID, aScrollAreaID) {
       this.container = getAccessible(aContainerID);
       this.scrollAreaNode = getNode(aScrollAreaID);
 
       this.eventSeq = [
         new invokerChecker(EVENT_SHOW, getAccessible, this.scrollAreaNode),
         new invokerChecker(EVENT_REORDER, this.container)
       ];
 
-      this.invoke = function changeScrollbarStyles_invoke()
-      {
+      this.invoke = function changeScrollbarStyles_invoke() {
         var accTree =
           { SECTION: [] };
         testAccessibleTree(this.container, accTree);
 
         this.scrollAreaNode.style.overflow = "auto";
       }
 
-      this.finalCheck = function changeScrollbarStyles_finalCheck()
-      {
+      this.finalCheck = function changeScrollbarStyles_finalCheck() {
         var accTree =
           { SECTION: [ // container
             { SECTION: [] } // scroll area
           ] };
         testAccessibleTree(this.container, accTree);
       }
 
-      this.getID = function changeScrollbarStyles_getID()
-      {
+      this.getID = function changeScrollbarStyles_getID() {
         return "change scrollbar styles " + prettyName(aScrollAreaID);
       }
     }
 
     // //////////////////////////////////////////////////////////////////////////
     // Do tests
     // //////////////////////////////////////////////////////////////////////////
 
     var gQueue = null;
     // gA11yEventDumpID = "eventdump"; // debug stuff
     // gA11yEventDumpToConsole = true;
 
-    function doTests()
-    {
+    function doTests() {
       gQueue = new eventQueue();
 
       gQueue.push(new changeScrollRange("container", "scrollarea"));
       gQueue.push(new changeScrollbarStyles("container2", "scrollarea2"));
 
       gQueue.invoke(); // Will call SimpleTest.finish();
     }
 
--- a/accessible/tests/mochitest/treeupdate/test_doc.html
+++ b/accessible/tests/mochitest/treeupdate/test_doc.html
@@ -18,137 +18,122 @@
   <script type="application/javascript"
           src="../events.js"></script>
 
   <script type="application/javascript">
 
     // //////////////////////////////////////////////////////////////////////////
     // Helpers
 
-    function getDocNode(aID)
-    {
+    function getDocNode(aID) {
       return getNode(aID).contentDocument;
     }
-    function getDocChildNode(aID)
-    {
+    function getDocChildNode(aID) {
       return getDocNode(aID).body.firstChild;
     }
 
-    function rootContentReplaced(aID, aTextName, aRootContentRole)
-    {
+    function rootContentReplaced(aID, aTextName, aRootContentRole) {
       this.eventSeq = [
         new invokerChecker(EVENT_SHOW, getDocChildNode, aID),
         new invokerChecker(EVENT_REORDER, getDocNode, aID)
       ];
 
-      this.finalCheck = function rootContentReplaced_finalCheck()
-      {
+      this.finalCheck = function rootContentReplaced_finalCheck() {
         var tree = {
           role: aRootContentRole || ROLE_DOCUMENT,
           children: [
             {
               role: ROLE_TEXT_LEAF,
               name: aTextName
             }
           ]
         };
         testAccessibleTree(getDocNode(aID), tree);
       }
     }
 
-    function rootContentRemoved(aID)
-    {
+    function rootContentRemoved(aID) {
       this.eventSeq = [
         new invokerChecker(EVENT_HIDE, null),
         new invokerChecker(EVENT_REORDER, getDocNode, aID)
       ];
 
-      this.preinvoke = function rootContentRemoved_preinvoke()
-      {
+      this.preinvoke = function rootContentRemoved_preinvoke() {
         // Set up target for hide event before we invoke.
         var text = getAccessible(getAccessible(getDocNode(aID)).firstChild);
         this.eventSeq[0].target = text;
       }
 
-      this.finalCheck = function rootContentRemoved_finalCheck()
-      {
+      this.finalCheck = function rootContentRemoved_finalCheck() {
         var tree = {
           role: ROLE_DOCUMENT,
           children: [ ]
         };
         testAccessibleTree(getDocNode(aID), tree);
       }
     }
 
-    function rootContentInserted(aID, aTextName)
-    {
+    function rootContentInserted(aID, aTextName) {
       this.eventSeq = [
         new invokerChecker(EVENT_SHOW, getDocChildNode, aID),
         new invokerChecker(EVENT_REORDER, getDocNode, aID)
       ];
 
-      this.finalCheck = function rootContentInserted_finalCheck()
-      {
+      this.finalCheck = function rootContentInserted_finalCheck() {
         var tree = {
           role: ROLE_DOCUMENT,
           children: [
             {
               role: ROLE_TEXT_LEAF,
               name: aTextName
             }
           ]
         };
         testAccessibleTree(getDocNode(aID), tree);
       }
     }
 
     // //////////////////////////////////////////////////////////////////////////
     // Invokers
 
-    function writeIFrameDoc(aID)
-    {
+    function writeIFrameDoc(aID) {
       this.__proto__ = new rootContentReplaced(aID, "hello");
 
-      this.invoke = function writeIFrameDoc_invoke()
-      {
+      this.invoke = function writeIFrameDoc_invoke() {
         var docNode = getDocNode(aID);
 
         // We can't use open/write/close outside of iframe document because of
         // security error.
         var script = docNode.createElement("script");
         script.textContent = "document.open(); document.write('hello'); document.close();";
         docNode.body.appendChild(script);
       }
 
-      this.getID = function writeIFrameDoc_getID()
-      {
+      this.getID = function writeIFrameDoc_getID() {
         return "write document";
       }
     }
 
     /**
      * Replace HTML element.
      */
-    function replaceIFrameHTMLElm(aID)
-    {
+    function replaceIFrameHTMLElm(aID) {
       this.eventSeq = [
         new invokerChecker(EVENT_SHOW, getDocChildNode, aID),
         new invokerChecker(EVENT_REORDER, getDocNode, aID)
       ];
 
-      this.invoke = function replaceIFrameHTMLElm_invoke()
-      {
+      this.invoke = function replaceIFrameHTMLElm_invoke() {
         var docNode = getDocNode(aID);
         var newHTMLNode = docNode.createElement("html");
         newHTMLNode.innerHTML = `<body><p>New Wave</p></body`;
         docNode.replaceChild(newHTMLNode, docNode.documentElement);
       }
 
-      this.finalCheck = function replaceIFrameHTMLElm_finalCheck()
-      {
+      this.finalCheck = function replaceIFrameHTMLElm_finalCheck() {
         var tree = {
           role: ROLE_DOCUMENT,
           children: [
             {
               role: ROLE_PARAGRAPH,
               children: [
                 {
                   role: ROLE_TEXT_LEAF,
@@ -156,272 +141,237 @@
                 }
               ]
             }
           ]
         };
         testAccessibleTree(getDocNode(aID), tree);
       }
 
-      this.getID = function replaceIFrameHTMLElm_getID()
-      {
+      this.getID = function replaceIFrameHTMLElm_getID() {
         return "replace HTML element";
       }
     }
 
     /**
      * Replace HTML body on new body having ARIA role.
      */
-    function replaceIFrameBody(aID)
-    {
+    function replaceIFrameBody(aID) {
       this.__proto__ = new rootContentReplaced(aID, "New Hello");
 
-      this.invoke = function replaceIFrameBody_invoke()
-      {
+      this.invoke = function replaceIFrameBody_invoke() {
         var docNode = getDocNode(aID);
         var newBodyNode = docNode.createElement("body");
         var newTextNode = docNode.createTextNode("New Hello");
         newBodyNode.appendChild(newTextNode);
         docNode.documentElement.replaceChild(newBodyNode, docNode.body);
       }
 
-      this.getID = function replaceIFrameBody_getID()
-      {
+      this.getID = function replaceIFrameBody_getID() {
         return "replace body";
       }
     }
 
     /**
      * Replace HTML body on new body having ARIA role.
      */
-    function replaceIFrameBodyOnARIARoleBody(aID)
-    {
+    function replaceIFrameBodyOnARIARoleBody(aID) {
       this.__proto__ = new rootContentReplaced(aID, "New Hello",
                                                ROLE_PUSHBUTTON);
 
-      this.invoke = function replaceIFrameBodyOnARIARoleBody_invoke()
-      {
+      this.invoke = function replaceIFrameBodyOnARIARoleBody_invoke() {
         var docNode = getDocNode(aID);
         var newBodyNode = docNode.createElement("body");
         var newTextNode = docNode.createTextNode("New Hello");
         newBodyNode.appendChild(newTextNode);
         newBodyNode.setAttribute("role", "button");
         docNode.documentElement.replaceChild(newBodyNode, docNode.body);
       }
 
-      this.getID = function replaceIFrameBodyOnARIARoleBody_getID()
-      {
+      this.getID = function replaceIFrameBodyOnARIARoleBody_getID() {
         return "replace body on body having ARIA role";
       }
     }
 
     /**
      * Open/close document pair.
      */
-    function openIFrameDoc(aID)
-    {
+    function openIFrameDoc(aID) {
       this.__proto__ = new rootContentRemoved(aID);
 
-      this.invoke = function openIFrameDoc_invoke()
-      {
+      this.invoke = function openIFrameDoc_invoke() {
         this.preinvoke();
 
         // Open document.
         var docNode = getDocNode(aID);
         var script = docNode.createElement("script");
         script.textContent = "function closeMe() { document.write('Works?'); document.close(); } window.closeMe = closeMe; document.open();";
         docNode.body.appendChild(script);
       }
 
-      this.getID = function openIFrameDoc_getID()
-      {
+      this.getID = function openIFrameDoc_getID() {
         return "open document";
       }
     }
 
-    function closeIFrameDoc(aID)
-    {
+    function closeIFrameDoc(aID) {
       this.__proto__ = new rootContentInserted(aID, "Works?");
 
-      this.invoke = function closeIFrameDoc_invoke()
-      {
+      this.invoke = function closeIFrameDoc_invoke() {
         // Write and close document.
         getDocNode(aID).write("Works?"); getDocNode(aID).close();
       }
 
-      this.getID = function closeIFrameDoc_getID()
-      {
+      this.getID = function closeIFrameDoc_getID() {
         return "close document";
       }
     }
 
     /**
      * Remove/insert HTML element pair.
      */
-    function removeHTMLFromIFrameDoc(aID)
-    {
+    function removeHTMLFromIFrameDoc(aID) {
       this.__proto__ = new rootContentRemoved(aID);
 
-      this.invoke = function removeHTMLFromIFrameDoc_invoke()
-      {
+      this.invoke = function removeHTMLFromIFrameDoc_invoke() {
         this.preinvoke();
 
         // Remove HTML element.
         var docNode = getDocNode(aID);
         docNode.firstChild.remove();
       }
 
-      this.getID = function removeHTMLFromIFrameDoc_getID()
-      {
+      this.getID = function removeHTMLFromIFrameDoc_getID() {
         return "remove HTML element";
       }
     }
 
-    function insertHTMLToIFrameDoc(aID)
-    {
+    function insertHTMLToIFrameDoc(aID) {
       this.__proto__ = new rootContentInserted(aID, "Haha");
 
-      this.invoke = function insertHTMLToIFrameDoc_invoke()
-      {
+      this.invoke = function insertHTMLToIFrameDoc_invoke() {
         // Insert HTML element.
         var docNode = getDocNode(aID);
         var html = docNode.createElement("html");
         var body = docNode.createElement("body");
         var text = docNode.createTextNode("Haha");
         body.appendChild(text);
         html.appendChild(body);
         docNode.appendChild(html);
       }
 
-      this.getID = function insertHTMLToIFrameDoc_getID()
-      {
+      this.getID = function insertHTMLToIFrameDoc_getID() {
         return "insert HTML element document";
       }
     }
 
     /**
      * Remove/insert HTML body pair.
      */
-    function removeBodyFromIFrameDoc(aID)
-    {
+    function removeBodyFromIFrameDoc(aID) {
       this.__proto__ = new rootContentRemoved(aID);
 
-      this.invoke = function removeBodyFromIFrameDoc_invoke()
-      {
+      this.invoke = function removeBodyFromIFrameDoc_invoke() {
         this.preinvoke();
 
         // Remove body element.
         var docNode = getDocNode(aID);
         docNode.documentElement.removeChild(docNode.body);
       }
 
-      this.getID = function removeBodyFromIFrameDoc_getID()
-      {
+      this.getID = function removeBodyFromIFrameDoc_getID() {
         return "remove body element";
       }
     }
 
-    function insertElmUnderDocElmWhileBodyMissed(aID)
-    {
+    function insertElmUnderDocElmWhileBodyMissed(aID) {
       this.docNode = null;
       this.inputNode = null;
 
-      function getInputNode()
-        { return this.inputNode; }
+      function getInputNode() { return this.inputNode; }
 
       this.eventSeq = [
         new invokerChecker(EVENT_SHOW, getInputNode.bind(this)),
         new invokerChecker(EVENT_REORDER, getDocNode, aID)
       ];
 
-      this.invoke = function invoke()
-      {
+      this.invoke = function invoke() {
         this.docNode = getDocNode(aID);
         this.inputNode = this.docNode.createElement("input");
         this.docNode.documentElement.appendChild(this.inputNode);
       }
 
-      this.finalCheck = function finalCheck()
-      {
+      this.finalCheck = function finalCheck() {
         var tree =
           { DOCUMENT: [
             { ENTRY: [ ] }
           ] };
         testAccessibleTree(this.docNode, tree);
 
         // Remove aftermath of this test before next test starts.
         this.docNode.documentElement.removeChild(this.inputNode);
       }
 
-      this.getID = function getID()
-      {
+      this.getID = function getID() {
         return "Insert element under document element while body is missed.";
       }
     }
 
-    function insertBodyToIFrameDoc(aID)
-    {
+    function insertBodyToIFrameDoc(aID) {
       this.__proto__ = new rootContentInserted(aID, "Yo ho ho i butylka roma!");
 
-      this.invoke = function insertBodyToIFrameDoc_invoke()
-      {
+      this.invoke = function insertBodyToIFrameDoc_invoke() {
         // Insert body element.
         var docNode = getDocNode(aID);
         var body = docNode.createElement("body");
         var text = docNode.createTextNode("Yo ho ho i butylka roma!");
         body.appendChild(text);
         docNode.documentElement.appendChild(body);
       }
 
-      this.getID = function insertBodyToIFrameDoc_getID()
-      {
+      this.getID = function insertBodyToIFrameDoc_getID() {
         return "insert body element";
       }
     }
 
-    function changeSrc(aID)
-    {
+    function changeSrc(aID) {
       this.containerNode = getNode(aID);
 
       this.eventSeq = [
         new invokerChecker(EVENT_REORDER, this.containerNode)
       ];
 
-      this.invoke = function changeSrc_invoke()
-      {
+      this.invoke = function changeSrc_invoke() {
         this.containerNode.src = "data:text/html,<html><input></html>";
       }
 
-      this.finalCheck = function changeSrc_finalCheck()
-      {
+      this.finalCheck = function changeSrc_finalCheck() {
         var tree =
           { INTERNAL_FRAME: [
             { DOCUMENT: [
               { ENTRY: [ ] }
             ] }
           ] };
         testAccessibleTree(this.containerNode, tree);
       }
 
-      this.getID = function changeSrc_getID()
-      {
+      this.getID = function changeSrc_getID() {
         return "change src on iframe";
       }
     }
 
     // //////////////////////////////////////////////////////////////////////////
     // Test
 
     // gA11yEventDumpToConsole = true;
     // enableLogging('tree,verbose');
 
     var gQueue = null;
 
-    function doTest()
-    {
+    function doTest() {
       gQueue = new eventQueue();
 
       gQueue.push(new writeIFrameDoc("iframe"));
       gQueue.push(new replaceIFrameHTMLElm("iframe"));
       gQueue.push(new replaceIFrameBody("iframe"));
       gQueue.push(new openIFrameDoc("iframe"));
       gQueue.push(new closeIFrameDoc("iframe"));
       gQueue.push(new removeHTMLFromIFrameDoc("iframe"));
--- a/accessible/tests/mochitest/treeupdate/test_gencontent.html
+++ b/accessible/tests/mochitest/treeupdate/test_gencontent.html
@@ -29,110 +29,99 @@
 
     // //////////////////////////////////////////////////////////////////////////
     // Invokers
     // //////////////////////////////////////////////////////////////////////////
 
     /**
      * Insert new node with CSS generated content style applied to container.
      */
-    function insertNodeHavingGenContent(aContainerID)
-    {
+    function insertNodeHavingGenContent(aContainerID) {
       this.containerNode = getNode(aContainerID);
       this.container = getAccessible(this.containerNode);
 
       this.eventSeq = [
         new invokerChecker(EVENT_SHOW, getFirstChild, this.container),
         new invokerChecker(EVENT_REORDER, this.container)
       ];
 
-      this.invoke = function insertNodeHavingGenContent_invoke()
-      {
+      this.invoke = function insertNodeHavingGenContent_invoke() {
         var node = document.createElement("div");
         node.textContent = "text";
         node.setAttribute("class", "gentext");
         this.containerNode.appendChild(node);
       }
 
-      this.finalCheck = function insertNodeHavingGenContent_finalCheck()
-      {
+      this.finalCheck = function insertNodeHavingGenContent_finalCheck() {
         var accTree =
           { SECTION: [ // container
             { SECTION: [ // inserted node
               { STATICTEXT: [] }, // :before
               { TEXT_LEAF: [] }, // primary text
               { STATICTEXT: [] } // :after
             ] }
           ] };
         testAccessibleTree(this.container, accTree);
       }
 
-      this.getID = function insertNodeHavingGenContent_getID()
-      {
+      this.getID = function insertNodeHavingGenContent_getID() {
         return "insert node having generated content to " + prettyName(aContainerID);
       }
     }
 
     /**
      * Add CSS generated content to the given node contained by container node.
      */
-    function addGenContent(aContainerID, aNodeID)
-    {
+    function addGenContent(aContainerID, aNodeID) {
       this.container = getAccessible(aContainerID);
       this.node = getNode(aNodeID);
 
       this.eventSeq = [
         new invokerChecker(EVENT_HIDE, this.container.firstChild),
         new invokerChecker(EVENT_SHOW, getFirstChild, this.container),
         new invokerChecker(EVENT_REORDER, this.container)
       ];
 
-      this.invoke = function addGenContent_invoke()
-      {
+      this.invoke = function addGenContent_invoke() {
         this.node.setAttribute("class", "gentext");
       }
 
-      this.finalCheck = function insertNodeHavingGenContent_finalCheck()
-      {
+      this.finalCheck = function insertNodeHavingGenContent_finalCheck() {
         var accTree =
           { SECTION: [ // container
             { SECTION: [ // inserted node
               { STATICTEXT: [] }, // :before
               { TEXT_LEAF: [] }, // primary text
               { STATICTEXT: [] } // :after
             ] }
           ] };
         testAccessibleTree(this.container, accTree);
       }
 
-      this.getID = function addGenContent_getID()
-      {
+      this.getID = function addGenContent_getID() {
         return "add generated content to" + prettyName(aNodeID);
       }
     }
 
     /**
      * Target getters.
      */
-    function getFirstChild(aAcc)
-    {
-      try { return aAcc.getChildAt(0); }
-      catch (e) { return null; }
+    function getFirstChild(aAcc) {
+      try { return aAcc.getChildAt(0); } catch (e) { return null; }
     }
 
     // //////////////////////////////////////////////////////////////////////////
     // Do tests
     // //////////////////////////////////////////////////////////////////////////
 
     var gQueue = null;
     // gA11yEventDumpID = "eventdump"; // debug stuff
     // gA11yEventDumpToConsole = true;
 
-    function doTests()
-    {
+    function doTests() {
       gQueue = new eventQueue();
 
       gQueue.push(new insertNodeHavingGenContent("container1"));
       gQueue.push(new addGenContent("container2", "container2_child"));
 
       gQueue.invoke(); // Will call SimpleTest.finish();
     }
 
--- a/accessible/tests/mochitest/treeupdate/test_general.html
+++ b/accessible/tests/mochitest/treeupdate/test_general.html
@@ -17,116 +17,103 @@
           src="../events.js"></script>
 
   <script type="application/javascript">
 
     // //////////////////////////////////////////////////////////////////////////
     // Invokers
     // //////////////////////////////////////////////////////////////////////////
 
-    function prependAppend(aContainer)
-    {
+    function prependAppend(aContainer) {
       this.eventSeq = [
         new invokerChecker(EVENT_REORDER, aContainer)
       ];
 
-      this.invoke = function prependAppend_invoke()
-      {
+      this.invoke = function prependAppend_invoke() {
         var checkbox = document.createElement("input");
         checkbox.setAttribute("type", "checkbox");
         getNode(aContainer).insertBefore(checkbox, getNode(aContainer).firstChild);
 
         var button = document.createElement("input");
         button.setAttribute("type", "button");
         getNode(aContainer).appendChild(button);
       }
 
-      this.finalCheck = function prependAppend_finalCheck()
-      {
+      this.finalCheck = function prependAppend_finalCheck() {
         var accTree =
           { SECTION: [ // container
             { CHECKBUTTON: [ ] },
             { ENTRY: [ ] },
             { PUSHBUTTON: [ ] }
           ] };
         testAccessibleTree(aContainer, accTree);
       }
 
-      this.getID = function prependAppend_getID()
-      {
+      this.getID = function prependAppend_getID() {
         return "prepends a child and appends a child";
       }
     }
 
-    function removeRemove(aContainer)
-    {
+    function removeRemove(aContainer) {
       this.eventSeq = [
         new invokerChecker(EVENT_REORDER, aContainer)
       ];
 
-      this.invoke = function removeRemove_invoke()
-      {
+      this.invoke = function removeRemove_invoke() {
         getNode(aContainer).firstChild.remove();
       }
 
-      this.finalCheck = function removeRemove_finalCheck()
-      {
+      this.finalCheck = function removeRemove_finalCheck() {
         var accTree =
           { SECTION: [ // container
             { PUSHBUTTON: [ ] }
           ] };
         testAccessibleTree(aContainer, accTree);
       }
 
-      this.getID = function removeRemove_getID()
-      {
+      this.getID = function removeRemove_getID() {
         return "remove first and second children";
       }
     }
 
-    function insertInaccessibleAccessibleSiblings()
-    {
+    function insertInaccessibleAccessibleSiblings() {
       this.eventSeq = [
         new invokerChecker(EVENT_REORDER, "c3")
       ];
 
-      this.invoke = function insertInaccessibleAccessibleSiblings_invoke()
-      {
+      this.invoke = function insertInaccessibleAccessibleSiblings_invoke() {
         getNode("c3").appendChild(document.createElement("span"));
         getNode("c3").appendChild(document.createElement("input"));
       }
 
-      this.finalCheck = function insertInaccessibleAccessibleSiblings_finalCheck()
-      {
+      this.finalCheck = function insertInaccessibleAccessibleSiblings_finalCheck() {
         var accTree =
           { SECTION: [ // container
             { PUSHBUTTON: [
               { TEXT_LEAF: [] }
             ] },
             { ENTRY: [ ] }
           ] };
         testAccessibleTree("c3", accTree);
       }
 
-      this.getID = function insertInaccessibleAccessibleSiblings_getID()
-      {
+      this.getID = function insertInaccessibleAccessibleSiblings_getID() {
         return "insert inaccessible and then accessible siblings";
       }
     }
 
     // //////////////////////////////////////////////////////////////////////////
     // Do tests
     // //////////////////////////////////////////////////////////////////////////
 
     var gQueue = null;
     // gA11yEventDumpID = "eventdump"; // debug stuff
     // gA11yEventDumpToConsole = true;
 
-    function doTests()
-    {
+    function doTests() {
       gQueue = new eventQueue();
 
       gQueue.push(new prependAppend("c1"));
       gQueue.push(new removeRemove("c2"));
       gQueue.push(new insertInaccessibleAccessibleSiblings());
 
       gQueue.invoke(); // Will call SimpleTest.finish();
     }
--- a/accessible/tests/mochitest/treeupdate/test_hidden.html
+++ b/accessible/tests/mochitest/treeupdate/test_hidden.html
@@ -21,94 +21,85 @@
 
     // //////////////////////////////////////////////////////////////////////////
     // Invokers
     // //////////////////////////////////////////////////////////////////////////
 
     /**
      * Set @hidden attribute
      */
-    function setHiddenAttr(aContainerID, aChildID)
-    {
+    function setHiddenAttr(aContainerID, aChildID) {
       this.eventSeq = [
         new invokerChecker(EVENT_REORDER, getNode(aContainerID))
       ];
 
-      this.invoke = function setHiddenAttr_invoke()
-      {
+      this.invoke = function setHiddenAttr_invoke() {
         var tree =
           { SECTION: [
               { ENTRY: [
               ] }
           ] };
         testAccessibleTree(aContainerID, tree);
 
         getNode(aChildID).setAttribute("hidden", "true");
       }
 
-      this.finalCheck = function setHiddenAttr_finalCheck()
-      {
+      this.finalCheck = function setHiddenAttr_finalCheck() {
         var tree =
           { SECTION: [
           ] };
         testAccessibleTree(aContainerID, tree);
       }
 
-      this.getID = function setHiddenAttr_getID()
-      {
+      this.getID = function setHiddenAttr_getID() {
         return "Set @hidden attribute on input and test accessible tree for div";
       }
     }
 
     /**
      * Remove @hidden attribute
      */
-    function removeHiddenAttr(aContainerID, aChildID)
-    {
+    function removeHiddenAttr(aContainerID, aChildID) {
       this.eventSeq = [
         new invokerChecker(EVENT_REORDER, getNode(aContainerID))
       ];
 
-      this.invoke = function removeHiddenAttr_invoke()
-      {
+      this.invoke = function removeHiddenAttr_invoke() {
         var tree =
           { SECTION: [
           ] };
         testAccessibleTree(aContainerID, tree);
 
         getNode(aChildID).removeAttribute("hidden");
       }
 
-      this.finalCheck = function removeHiddenAttr_finalCheck()
-      {
+      this.finalCheck = function removeHiddenAttr_finalCheck() {
         var tree =
           { SECTION: [
               { ENTRY: [
               ] }
           ] };
         testAccessibleTree(aContainerID, tree);
       }
 
-      this.getID = function removeHiddenAttr_getID()
-      {
+      this.getID = function removeHiddenAttr_getID() {
         return "Remove @hidden attribute on input and test accessible tree for div";
       }
     }
 
     // //////////////////////////////////////////////////////////////////////////
     // Test
     // //////////////////////////////////////////////////////////////////////////
 
     // gA11yEventDumpID = "eventdump"; // debug stuff
     // gA11yEventDumpToConsole = true;
 
     var gQueue = null;
 
-    function doTest()
-    {
+    function doTest() {
       gQueue = new eventQueue();
 
       gQueue.push(new setHiddenAttr("container", "child"));
       gQueue.push(new removeHiddenAttr("container", "child"));
 
       gQueue.invoke(); // SimpleTest.finish() will be called in the end
     }
 
--- a/accessible/tests/mochitest/treeupdate/test_imagemap.html
+++ b/accessible/tests/mochitest/treeupdate/test_imagemap.html
@@ -13,96 +13,87 @@
   <script type="application/javascript"
           src="../common.js"></script>
   <script type="application/javascript"
           src="../role.js"></script>
   <script type="application/javascript"
           src="../events.js"></script>
 
   <script type="application/javascript">
-    function insertArea(aImageMapID, aMapID)
-    {
+    function insertArea(aImageMapID, aMapID) {
       this.imageMap = getAccessible(aImageMapID);
       this.mapNode = getNode(aMapID);
 
-      function getInsertedArea(aThisObj)
-      {
+      function getInsertedArea(aThisObj) {
         return aThisObj.imageMap.firstChild;
       }
 
       this.eventSeq = [
         new invokerChecker(EVENT_SHOW, getInsertedArea, this),
         new invokerChecker(EVENT_REORDER, this.imageMap)
       ];
 
-      this.invoke = function insertArea_invoke()
-      {
+      this.invoke = function insertArea_invoke() {
         var areaElm = document.createElement("area");
         areaElm.setAttribute("href",
                              "http://www.bbc.co.uk/radio4/atoz/index.shtml#a");
         areaElm.setAttribute("coords", "0,0,13,14");
         areaElm.setAttribute("alt", "a");
         areaElm.setAttribute("shape", "rect");
 
         this.mapNode.insertBefore(areaElm, this.mapNode.firstChild);
       }
 
-      this.finalCheck = function insertArea_finalCheck()
-      {
+      this.finalCheck = function insertArea_finalCheck() {
         var accTree =
           { IMAGE_MAP: [
             {
               role: ROLE_LINK,
               name: "a",
               children: [ ]
             },
             {
               role: ROLE_LINK,
               name: "b",
               children: [ ]
             },
           ] };
         testAccessibleTree(this.imageMap, accTree);
       }
 
-      this.getID = function insertArea_getID()
-      {
+      this.getID = function insertArea_getID() {
         return "insert area element";
       }
     }
 
-    function appendArea(aImageMapID, aMapID)
-    {
+    function appendArea(aImageMapID, aMapID) {
       this.imageMap = getAccessible(aImageMapID);
       this.mapNode = getNode(aMapID);
 
-      function getAppendedArea(aThisObj)
-      {
+      function getAppendedArea(aThisObj) {
         return aThisObj.imageMap.lastChild;
       }
 
       this.eventSeq = [
         new invokerChecker(EVENT_SHOW, getAppendedArea, this),
         new invokerChecker(EVENT_REORDER, this.imageMap)
       ];
 
-      this.invoke = function appendArea_invoke()
-      {
+      this.invoke = function appendArea_invoke() {
         var areaElm = document.createElement("area");
         areaElm.setAttribute("href",
                              "http://www.bbc.co.uk/radio4/atoz/index.shtml#c");
         areaElm.setAttribute("coords", "34,0,47,14");
         areaElm.setAttribute("alt", "c");
         areaElm.setAttribute("shape", "rect");
 
         this.mapNode.appendChild(areaElm);
       }
 
-      this.finalCheck = function appendArea_finalCheck()
-      {
+      this.finalCheck = function appendArea_finalCheck() {
         var accTree =
           { IMAGE_MAP: [
             {
               role: ROLE_LINK,
               name: "a",
               children: [ ]
             },
             {
@@ -114,208 +105,185 @@
               role: ROLE_LINK,
               name: "c",
               children: [ ]
             }
           ] };
         testAccessibleTree(this.imageMap, accTree);
       }
 
-      this.getID = function appendArea_getID()
-      {
+      this.getID = function appendArea_getID() {
         return "append area element";
       }
     }
 
-    function removeArea(aImageMapID, aMapID)
-    {
+    function removeArea(aImageMapID, aMapID) {
       this.imageMap = getAccessible(aImageMapID);
       this.area = null;
       this.mapNode = getNode(aMapID);
 
-      function getRemovedArea(aThisObj)
-      {
+      function getRemovedArea(aThisObj) {
         return aThisObj.area;
       }
 
       this.eventSeq = [
         new invokerChecker(EVENT_HIDE, getRemovedArea, this),
         new invokerChecker(EVENT_REORDER, this.imageMap)
       ];
 
-      this.invoke = function removeArea_invoke()
-      {
+      this.invoke = function removeArea_invoke() {
         this.area = this.imageMap.firstChild;
         this.mapNode.removeChild(this.mapNode.firstElementChild);
       }
 
-      this.finalCheck = function removeArea_finalCheck()
-      {
+      this.finalCheck = function removeArea_finalCheck() {
         var accTree =
           { IMAGE_MAP: [
             {
               role: ROLE_LINK,
               name: "b",
               children: [ ]
             },
             {
               role: ROLE_LINK,
               name: "c",
               children: [ ]
             }
           ] };
         testAccessibleTree(this.imageMap, accTree);
       }
 
-      this.getID = function removeArea_getID()
-      {
+      this.getID = function removeArea_getID() {
         return "remove area element";
       }
     }
 
-    function removeNameOnMap(aImageMapContainerID, aImageMapID, aMapID)
-    {
+    function removeNameOnMap(aImageMapContainerID, aImageMapID, aMapID) {
       this.container = getAccessible(aImageMapContainerID);
       this.containerNode = this.container.DOMNode;
       this.imageMap = getAccessible(aImageMapID);
       this.imgNode = this.imageMap.DOMNode;
       this.mapNode = getNode(aMapID);
 
       this.eventSeq = [
         new invokerChecker(EVENT_HIDE, this.imageMap),
         new invokerChecker(EVENT_SHOW, this.imgNode),
         new invokerChecker(EVENT_REORDER, this.container)
       ];
 
-      this.invoke = function removeNameOnMap_invoke()
-      {
+      this.invoke = function removeNameOnMap_invoke() {
         this.mapNode.removeAttribute("name");
       }
 
-      this.finalCheck = function removeNameOnMap_finalCheck()
-      {
+      this.finalCheck = function removeNameOnMap_finalCheck() {
         var accTree =
           { SECTION: [
             { GRAPHIC: [ ] }
           ] };
         testAccessibleTree(this.container, accTree);
       }
 
-      this.getID = function removeNameOnMap_getID()
-      {
+      this.getID = function removeNameOnMap_getID() {
         return "remove @name on map element";
       }
     }
 
-    function restoreNameOnMap(aImageMapContainerID, aImageMapID, aMapID)
-    {
+    function restoreNameOnMap(aImageMapContainerID, aImageMapID, aMapID) {
       this.container = getAccessible(aImageMapContainerID);
       this.containerNode = this.container.DOMNode;
       this.imageMap = null;
       this.imgNode = getNode(aImageMapID);
       this.mapNode = getNode(aMapID);
 
-      function getImageMap(aThisObj)
-      {
+      function getImageMap(aThisObj) {
         return aThisObj.imageMap;
       }
 
       this.eventSeq = [
         new invokerChecker(EVENT_HIDE, getImageMap, this),
         new invokerChecker(EVENT_SHOW, this.imgNode),
         new invokerChecker(EVENT_REORDER, this.container)
       ];
 
-      this.invoke = function restoreNameOnMap_invoke()
-      {
+      this.invoke = function restoreNameOnMap_invoke() {
         this.imageMap = getAccessible(aImageMapID);
         this.mapNode.setAttribute("name", "atoz_map");
 
         // XXXhack: force repainting of the image (see bug 745788 for details).
         waveOverImageMap(aImageMapID);
       }
 
-      this.finalCheck = function removeNameOnMap_finalCheck()
-      {
+      this.finalCheck = function removeNameOnMap_finalCheck() {
         var accTree =
           { SECTION: [
             { IMAGE_MAP: [
               { LINK: [ ] },
               { LINK: [ ] }
             ] }
           ] };
         testAccessibleTree(this.container, accTree);
       }
 
-      this.getID = function removeNameOnMap_getID()
-      {
+      this.getID = function removeNameOnMap_getID() {
         return "restore @name on map element";
       }
     }
 
-    function removeMap(aImageMapContainerID, aImageMapID, aMapID)
-    {
+    function removeMap(aImageMapContainerID, aImageMapID, aMapID) {
       this.container = getAccessible(aImageMapContainerID);
       this.containerNode = this.container.DOMNode;
       this.imageMap = null;
       this.imgNode = getNode(aImageMapID);
       this.mapNode = getNode(aMapID);
 
-      function getImageMap(aThisObj)
-      {
+      function getImageMap(aThisObj) {
         return aThisObj.imageMap;
       }
 
       this.eventSeq = [
         new invokerChecker(EVENT_HIDE, getImageMap, this),
         new invokerChecker(EVENT_SHOW, this.imgNode),
         new invokerChecker(EVENT_REORDER, this.container)
       ];
 
-      this.invoke = function removeMap_invoke()
-      {
+      this.invoke = function removeMap_invoke() {
         this.imageMap = getAccessible(aImageMapID);
         this.mapNode.remove();
       }
 
-      this.finalCheck = function removeMap_finalCheck()
-      {
+      this.finalCheck = function removeMap_finalCheck() {
         var accTree =
           { SECTION: [
             { GRAPHIC: [ ] }
           ] };
         testAccessibleTree(this.container, accTree);
       }
 
-      this.getID = function removeMap_getID()
-      {
+      this.getID = function removeMap_getID() {
         return "remove map element";
       }
     }
 
-    function insertMap(aImageMapContainerID, aImageID)
-    {
+    function insertMap(aImageMapContainerID, aImageID) {
       this.container = getAccessible(aImageMapContainerID);
       this.containerNode = this.container.DOMNode;
       this.image = null;
       this.imgMapNode = getNode(aImageID);
 
-      function getImage(aThisObj)
-      {
+      function getImage(aThisObj) {
         return aThisObj.image;
       }
 
       this.eventSeq = [
         new invokerChecker(EVENT_HIDE, getImage, this),
         new invokerChecker(EVENT_SHOW, this.imgMapNode),
         new invokerChecker(EVENT_REORDER, this.container)
       ];
 
-      this.invoke = function insertMap_invoke()
-      {
+      this.invoke = function insertMap_invoke() {
         this.image = getAccessible(aImageID);
 
         var map = document.createElement("map");
         map.setAttribute("name", "atoz_map");
         map.setAttribute("id", "map");
 
         var area = document.createElement("area")
         area.setAttribute("href",
@@ -324,77 +292,68 @@
         area.setAttribute("alt", "b");
         area.setAttribute("shape", "rect");
 
         map.appendChild(area);
 
         this.containerNode.appendChild(map);
       }
 
-      this.finalCheck = function insertMap_finalCheck()
-      {
+      this.finalCheck = function insertMap_finalCheck() {
         var accTree =
           { SECTION: [
             { IMAGE_MAP: [
               { LINK: [ ] }
             ] }
           ] };
         testAccessibleTree(this.container, accTree);
       }
 
-      this.getID = function insertMap_getID()
-      {
+      this.getID = function insertMap_getID() {
         return "insert map element";
       }
     }
 
-    function hideImageMap(aContainerID, aImageID)
-    {
+    function hideImageMap(aContainerID, aImageID) {
       this.container = getAccessible(aContainerID);
       this.imageMap = null;
       this.imageMapNode = getNode(aImageID);
 
-      function getImageMap(aThisObj)
-      {
+      function getImageMap(aThisObj) {
         return aThisObj.imageMap;
       }
 
       this.eventSeq = [
         new invokerChecker(EVENT_HIDE, getImageMap, this),
         new invokerChecker(EVENT_REORDER, aContainerID)
       ];
 
-      this.invoke = function hideImageMap_invoke()
-      {
+      this.invoke = function hideImageMap_invoke() {
         this.imageMap = getAccessible(this.imageMapNode);
         this.imageMapNode.style.display = "none";
       }
 
-      this.finalCheck = function hideImageMap_finalCheck()
-      {
+      this.finalCheck = function hideImageMap_finalCheck() {
         var accTree =
           { SECTION: [ ] };
         testAccessibleTree(this.container, accTree);
       }
 
-      this.getID = function hideImageMap_getID()
-      {
+      this.getID = function hideImageMap_getID() {
         return "display:none image";
       }
     }
 
     // gA11yEventDumpToConsole = true; // debug stuff
-    function doPreTest()
-    {
+    function doPreTest() {
       waitForImageMap("imgmap", doTest);
     }
 
     var gQueue = null;
-    function doTest()
-    {
+    function doTest() {
       gQueue = new eventQueue();
 
       gQueue.push(new insertArea("imgmap", "map"));
       gQueue.push(new appendArea("imgmap", "map"));
       gQueue.push(new removeArea("imgmap", "map"));
       gQueue.push(new removeNameOnMap("container", "imgmap", "map"));
       gQueue.push(new restoreNameOnMap("container", "imgmap", "map"));
       gQueue.push(new removeMap("container", "imgmap", "map"));
--- a/accessible/tests/mochitest/treeupdate/test_list.html
+++ b/accessible/tests/mochitest/treeupdate/test_list.html
@@ -16,18 +16,17 @@
   <script type="application/javascript"
           src="../events.js"></script>
 
   <script type="application/javascript">
 
     // //////////////////////////////////////////////////////////////////////////
     // Helpers
 
-    function testLiAccessibleTree()
-    {
+    function testLiAccessibleTree() {
       // Test accessible tree.
       var accTree = {
         role: ROLE_LISTITEM,
         children: [
           {
             role: ROLE_STATICTEXT,
             children: []
           },
@@ -39,69 +38,59 @@
       };
 
       testAccessibleTree("li", accTree);
     }
 
     // //////////////////////////////////////////////////////////////////////////
     // Sequence item processors
 
-    function hideProcessor()
-    {
+    function hideProcessor() {
       this.liNode = getNode("li");
       this.li = getAccessible(this.liNode);
       this.bullet = this.li.firstChild;
 
-      this.process = function hideProcessor_process()
-      {
+      this.process = function hideProcessor_process() {
         this.liNode.style.display = "none";
       }
 
-      this.onProcessed = function hideProcessor_onProcessed()
-      {
+      this.onProcessed = function hideProcessor_onProcessed() {
         window.setTimeout(
-          function(aLiAcc, aLiNode, aBulletAcc)
-          {
+          function(aLiAcc, aLiNode, aBulletAcc) {
             testDefunctAccessible(aLiAcc, aLiNode);
             testDefunctAccessible(aBulletAcc);
 
             gSequence.processNext();
           },
           0, this.li, this.liNode, this.bullet
         );
       }
     }
 
-    function showProcessor()
-    {
+    function showProcessor() {
       this.liNode = getNode("li");
 
-      this.process = function showProcessor_process()
-      {
+      this.process = function showProcessor_process() {
         this.liNode.style.display = "list-item";
       }
 
-      this.onProcessed = function showProcessor_onProcessed()
-      {
+      this.onProcessed = function showProcessor_onProcessed() {
         testLiAccessibleTree();
         gSequence.processNext();
       }
     }
 
-    function textReplaceProcessor()
-    {
+    function textReplaceProcessor() {
       this.liNode = getNode("li");
 
-      this.process = function textReplaceProcessor_process()
-      {
+      this.process = function textReplaceProcessor_process() {
         this.liNode.textContent = "hey";
       }
 
-      this.onProcessed = function textReplaceProcessor_onProcessed()
-      {
+      this.onProcessed = function textReplaceProcessor_onProcessed() {
         var tree = {
           LISTITEM: [
             { STATICTEXT: [] },
             { TEXT_LEAF: [] }
           ]
         };
         testAccessibleTree(this.liNode, tree);
         SimpleTest.finish();
@@ -109,18 +98,17 @@
     }
 
     // //////////////////////////////////////////////////////////////////////////
     // Test
 
     // gA11yEventDumpToConsole = true;
 
     var gSequence = null;
-    function doTest()
-    {
+    function doTest() {
       testLiAccessibleTree();
 
       gSequence = new sequence();
 
       gSequence.append(new hideProcessor(), EVENT_HIDE, getAccessible("li"),
                        "hide HTML li");
       gSequence.append(new showProcessor(), EVENT_SHOW, getNode("li"),
                        "show HTML li");
--- a/accessible/tests/mochitest/treeupdate/test_list_editabledoc.html
+++ b/accessible/tests/mochitest/treeupdate/test_list_editabledoc.html
@@ -16,34 +16,31 @@
   <script type="application/javascript"
           src="../events.js"></script>
 
   <script type="application/javascript">
 
     // //////////////////////////////////////////////////////////////////////////
     // Invokers
 
-    function addLi(aID)
-    {
+    function addLi(aID) {
       this.listNode = getNode(aID);
       this.liNode = document.createElement("li");
       this.liNode.textContent = "item";
 
       this.eventSeq = [
         new invokerChecker(EVENT_SHOW, getAccessible, this.liNode),
         new invokerChecker(EVENT_REORDER, this.listNode)
       ];
 
-      this.invoke = function addLi_invoke()
-      {
+      this.invoke = function addLi_invoke() {
         this.listNode.appendChild(this.liNode);
       }
 
-      this.finalCheck = function addLi_finalCheck()
-      {
+      this.finalCheck = function addLi_finalCheck() {
         var tree = {
           role: ROLE_LIST,
           children: [
             {
               role: ROLE_LISTITEM,
               children: [
                 {
                   role: ROLE_STATICTEXT,
@@ -56,31 +53,29 @@
                 }
               ]
             }
           ]
         };
         testAccessibleTree(aID, tree);
       }
 
-      this.getID = function addLi_getID()
-      {
+      this.getID = function addLi_getID() {
         return "add li";
       }
     }
 
     // //////////////////////////////////////////////////////////////////////////
     // Test
 
     // gA11yEventDumpID = "eventdump"; // debug stuff
 
     var gQueue = null;
 
-    function doTest()
-    {
+    function doTest() {
       gQueue = new eventQueue();
 
       gQueue.push(new addLi("list"));
 
       gQueue.invoke(); // SimpleTest.finish() will be called in the end
     }
 
     SimpleTest.waitForExplicitFinish();
--- a/accessible/tests/mochitest/treeupdate/test_optgroup.html
+++ b/accessible/tests/mochitest/treeupdate/test_optgroup.html
@@ -12,24 +12,22 @@
           src="../common.js"></script>
   <script type="application/javascript"
           src="../role.js"></script>
   <script type="application/javascript"
           src="../events.js"></script>
 
   <script type="application/javascript">
 
-    function addOptGroup(aID)
-    {
+    function addOptGroup(aID) {
       this.selectNode = getNode(aID);
       this.select = getAccessible(this.selectNode);
       this.selectList = this.select.firstChild;
 
-      this.invoke = function addOptGroup_invoke()
-      {
+      this.invoke = function addOptGroup_invoke() {
         var optGroup = document.createElement("optgroup");
         for (i = 0; i < 2; i++) {
           var opt = document.createElement("option");
           opt.value = i;
           opt.text = "Option: Value " + i;
 
           optGroup.appendChild(opt);
         }
@@ -38,18 +36,17 @@
         var option = document.createElement("option");
         this.selectNode.add(option, null);
       }
 
       this.eventSeq = [
         new invokerChecker(EVENT_REORDER, this.selectList)
       ];
 
-      this.finalCheck = function addOptGroup_finalCheck()
-      {
+      this.finalCheck = function addOptGroup_finalCheck() {
         var tree =
           { COMBOBOX: [
             { COMBOBOX_LIST: [
               { GROUPING: [
                 { COMBOBOX_OPTION: [
                   { TEXT_LEAF: [] }
                 ] },
                 { COMBOBOX_OPTION: [
@@ -57,60 +54,54 @@
                 ] },
               ]},
               { COMBOBOX_OPTION: [] }
             ] }
           ] };
         testAccessibleTree(this.select, tree);
       }
 
-      this.getID = function addOptGroup_getID()
-      {
+      this.getID = function addOptGroup_getID() {
         return "test optgroup's insertion into a select";
       }
     }
 
-    function removeOptGroup(aID)
-    {
+    function removeOptGroup(aID) {
       this.selectNode = getNode(aID);
       this.select = getAccessible(this.selectNode);
       this.selectList = this.select.firstChild;
 
-      this.invoke = function removeOptGroup_invoke()
-      {
+      this.invoke = function removeOptGroup_invoke() {
         this.option1Node = this.selectNode.firstChild.firstChild;
         this.selectNode.firstChild.remove();
       }
 
       this.eventSeq = [
         new invokerChecker(EVENT_REORDER, this.selectList)
       ];
 
-      this.finalCheck = function removeOptGroup_finalCheck()
-      {
+      this.finalCheck = function removeOptGroup_finalCheck() {
         var tree =
           { COMBOBOX: [
             { COMBOBOX_LIST: [
               { COMBOBOX_OPTION: [] }
             ] }
           ] };
         testAccessibleTree(this.select, tree);
         is(isAccessible(this.option1Node), false, "removed option shouldn't be accessible anymore!");
       }
 
-      this.getID = function removeOptGroup_getID()
-      {
+      this.getID = function removeOptGroup_getID() {
         return "test optgroup's removal from a select";
       }
     }
 
     // gA11yEventDumpToConsole = true;
 
-    function doTest()
-    {
+    function doTest() {
       gQueue = new eventQueue();
 
       gQueue.push(new addOptGroup("select"));
       gQueue.push(new removeOptGroup("select"));
 
       gQueue.invoke(); // Will call SimpleTest.finish();
 
     }
--- a/accessible/tests/mochitest/treeupdate/test_recreation.html
+++ b/accessible/tests/mochitest/treeupdate/test_recreation.html
@@ -17,18 +17,17 @@
   <script type="application/javascript"
           src="../events.js"></script>
 
   <script type="application/javascript">
 
     // //////////////////////////////////////////////////////////////////////////
     // Invokers
 
-    function recreateAccessible(aID, aWontBeAccessible)
-    {
+    function recreateAccessible(aID, aWontBeAccessible) {
       this.node = getNode(aID);
       this.accessible =
         isAccessible(this.node) ? getAccessible(this.node) : null;
 
       this.eventSeq = [ ];
 
       if (this.accessible)
         this.eventSeq.push(new invokerChecker(EVENT_HIDE,
@@ -43,76 +42,65 @@
 
       if (this.accessible) {
         this.unexpectedEventSeq = [
           new invokerChecker(EVENT_SHOW, this.accessible)
         ];
       }
     }
 
-    function changeAttr(aID, aAttr, aValue)
-    {
+    function changeAttr(aID, aAttr, aValue) {
       this.__proto__ = new recreateAccessible(aID);
 
-      this.invoke = function changeAttr_invoke()
-      {
+      this.invoke = function changeAttr_invoke() {
         this.node.setAttribute(aAttr, aValue);
       }
 
-      this.getID = function changeAttr_getID()
-      {
+      this.getID = function changeAttr_getID() {
         return "change " + aAttr + "attribute for " + aID;
       }
     }
 
-    function removeAttr(aID, aAttr)
-    {
+    function removeAttr(aID, aAttr) {
       this.__proto__ = new recreateAccessible(aID, true);
 
-      this.invoke = function remvoeAttr_invoke()
-      {
+      this.invoke = function remvoeAttr_invoke() {
         this.node.removeAttribute(aAttr);
       }
 
-      this.getID = function remvoeAttr_getID()
-      {
+      this.getID = function remvoeAttr_getID() {
         return "remove " + aAttr + "attribute for " + aID;
       }
     }
 
-    function changeRole(aID, aHasAccessible)
-    {
+    function changeRole(aID, aHasAccessible) {
       this.__proto__ = new changeAttr(aID, "role", "button");
     }
 
-    function removeRole(aID)
-    {
+    function removeRole(aID) {
       this.__proto__ = new removeAttr(aID, "role");
     }
 
-    function changeHref(aID)
-    {
+    function changeHref(aID) {
       this.__proto__ = new changeAttr(aID, "href", "www");
     }
 
-    function changeMultiselectable(aID)
-    {
+    function changeMultiselectable(aID) {
       this.__proto__ = new changeAttr(aID, "aria-multiselectable", "true");
     }
 
     // //////////////////////////////////////////////////////////////////////////
     // Test
 
     // gA11yEventDumpID = "eventdump"; // debug stuff
     // gA11yEventDumpToConsole = true;
 
     var gQueue = null;
 
-    function doTest()
-    {
+    function doTest() {
       gQueue = new eventQueue();
 
       // make the accessible an inaccessible
       gQueue.push(new changeRole("span"));
 
       // make the inaccessible an accessible
       gQueue.push(new removeRole("span"));
 
--- a/accessible/tests/mochitest/treeupdate/test_select.html
+++ b/accessible/tests/mochitest/treeupdate/test_select.html
@@ -12,123 +12,111 @@
           src="../common.js"></script>
   <script type="application/javascript"
           src="../role.js"></script>
   <script type="application/javascript"
           src="../events.js"></script>
 
   <script type="application/javascript">
 
-    function addOptions(aID)
-    {
+    function addOptions(aID) {
       this.selectNode = getNode(aID);
       this.select = getAccessible(this.selectNode);
       this.selectList = this.select.firstChild;
 
-      this.invoke = function addOptions_invoke()
-      {
+      this.invoke = function addOptions_invoke() {
         for (i = 0; i < 2; i++) {
           var opt = document.createElement("option");
           opt.value = i;
           opt.text = "Option: Value " + i;
 
           this.selectNode.add(opt, null);
         }
       }
 
       this.eventSeq = [
         new invokerChecker(EVENT_REORDER, this.selectList)
       ];
 
-      this.finalCheck = function addOptions_finalCheck()
-      {
+      this.finalCheck = function addOptions_finalCheck() {
         var tree =
           { COMBOBOX: [
             { COMBOBOX_LIST: [
               { COMBOBOX_OPTION: [
                 { TEXT_LEAF: [] }
               ] },
               { COMBOBOX_OPTION: [
                 { TEXT_LEAF: [] }
               ] }
             ] }
           ] };
         testAccessibleTree(this.select, tree);
       }
 
-      this.getID = function addOptions_getID()
-      {
+      this.getID = function addOptions_getID() {
         return "test elements insertion into a select";
       }
     }
 
-    function removeOptions(aID)
-    {
+    function removeOptions(aID) {
       this.selectNode = getNode(aID);
       this.select = getAccessible(this.selectNode);
       this.selectList = this.select.firstChild;
 
-      this.invoke = function removeOptions_invoke()
-      {
+      this.invoke = function removeOptions_invoke() {
         while (this.selectNode.length)
           this.selectNode.remove(0);
       }
 
       this.eventSeq = [
         new invokerChecker(EVENT_REORDER, this.selectList)
       ];
 
-      this.finalCheck = function removeOptions_finalCheck()
-      {
+      this.finalCheck = function removeOptions_finalCheck() {
         var tree =
           { COMBOBOX: [
             { COMBOBOX_LIST: [] }
           ] };
         testAccessibleTree(this.select, tree);
       }
 
-      this.getID = function removeptions_getID()
-      {
+      this.getID = function removeptions_getID() {
         return "test elements removal from a select";
       }
     }
 
     /**
      * Setting @href on option makes the accessible to recreate.
      */
-    function setHrefOnOption()
-    {
+    function setHrefOnOption() {
       this.eventSeq = [
         new invokerChecker(EVENT_HIDE, "s2_o"),
         new invokerChecker(EVENT_SHOW, "s2_o"),
       ];
 
-      this.invoke = function setHrefOnOption_setHref()
-      {
+      this.invoke = function setHrefOnOption_setHref() {
         getNode("s2_o").setAttribute("href", "1");
       }
 
       this.finalCheck = function() {
         var tree =
           { COMBOBOX: [
             { COMBOBOX_LIST: [
               { COMBOBOX_OPTION: [ ] }
             ] }
           ] };
         testAccessibleTree("s2", tree);
       }
 
-      this.getID = function removeptions_getID()
-      {
+      this.getID = function removeptions_getID() {
         return "setting @href on select option";
       }
     }
 
-    function doTest()
-    {
+    function doTest() {
       gQueue = new eventQueue();
 
       gQueue.push(new addOptions("select"));
       gQueue.push(new removeOptions("select"));
       gQueue.push(new setHrefOnOption());
 
       gQueue.invoke(); // Will call SimpleTest.finish();
 
--- a/accessible/tests/mochitest/treeupdate/test_table.html
+++ b/accessible/tests/mochitest/treeupdate/test_table.html
@@ -12,54 +12,49 @@
           src="../common.js"></script>
   <script type="application/javascript"
           src="../role.js"></script>
   <script type="application/javascript"
           src="../events.js"></script>
 
   <script type="application/javascript">
 
-    function appendCaption(aTableID)
-    {
-      this.invoke = function appendCaption_invoke()
-      {
+    function appendCaption(aTableID) {
+      this.invoke = function appendCaption_invoke() {
         // append a caption, it should appear as a first element in the
         // accessible tree.
         var caption = document.createElement("caption");
         caption.textContent = "table caption";
         getNode(aTableID).appendChild(caption);
       }
 
       this.eventSeq = [
         new invokerChecker(EVENT_REORDER, aTableID)
       ];
 
-      this.finalCheck = function appendCaption_finalCheck()
-      {
+      this.finalCheck = function appendCaption_finalCheck() {
         var tree =
           { TABLE: [
             { CAPTION: [
               { TEXT_LEAF: [] }
             ] },
             { ROW: [
               { CELL: [ {TEXT_LEAF: [] }]},
               { CELL: [ {TEXT_LEAF: [] }]}
             ] }
           ] };
         testAccessibleTree(aTableID, tree);
       }
 
-      this.getID = function appendCaption_getID()
-      {
+      this.getID = function appendCaption_getID() {
         return "append caption";
       }
     }
 
-    function doTest()
-    {
+    function doTest() {
       gQueue = new eventQueue();
       gQueue.push(new appendCaption("table"));
       gQueue.invoke(); // Will call SimpleTest.finish();
 
     }
 
     SimpleTest.waitForExplicitFinish();
     addA11yLoadEvent(doTest);
--- a/accessible/tests/mochitest/treeupdate/test_textleaf.html
+++ b/accessible/tests/mochitest/treeupdate/test_textleaf.html
@@ -17,115 +17,103 @@
   <script type="application/javascript"
           src="../events.js"></script>
 
   <script type="application/javascript">
 
     // //////////////////////////////////////////////////////////////////////////
     // Invokers
 
-    function textLeafUpdate(aID, aIsTextLeafLinkable)
-    {
+    function textLeafUpdate(aID, aIsTextLeafLinkable) {
       this.node = getNode(aID);
 
       this.eventSeq = [
         new invokerChecker(EVENT_REORDER, this.node.parentNode)
       ];
 
-      this.finalCheck = function textLeafUpdate_finalCheck()
-      {
+      this.finalCheck = function textLeafUpdate_finalCheck() {
         var textLeaf = getAccessible(this.node).firstChild;
         is(textLeaf.actionCount, (aIsTextLeafLinkable ? 1 : 0),
            "Wrong action numbers!");
       }
     }
 
-    function setOnClickAttr(aID)
-    {
+    function setOnClickAttr(aID) {
       var node = getNode(aID);
       node.setAttribute("onclick", "alert(3);");
       var textLeaf = getAccessible(node).firstChild;
       is(textLeaf.actionCount, 1, "setOnClickAttr: wrong action numbers!");
     }
 
-    function removeOnClickAttr(aID)
-    {
+    function removeOnClickAttr(aID) {
       var node = getNode(aID);
       node.removeAttribute("onclick");
       var textLeaf = getAccessible(node).firstChild;
       is(textLeaf.actionCount, 0,
          "removeOnClickAttr: wrong action numbers!");
     }
 
-    function setOnClickNRoleAttrs(aID)
-    {
+    function setOnClickNRoleAttrs(aID) {
       this.__proto__ = new textLeafUpdate(aID, true);
 
-      this.invoke = function setOnClickAttr_invoke()
-      {
+      this.invoke = function setOnClickAttr_invoke() {
         this.node.setAttribute("role", "link");
         this.node.setAttribute("onclick", "alert(3);");
       }
 
-      this.getID = function setOnClickAttr_getID()
-      {
+      this.getID = function setOnClickAttr_getID() {
         return "make " + prettyName(aID) + " linkable";
       }
     }
 
-    function removeTextData(aID, aRole)
-    {
+    function removeTextData(aID, aRole) {
       this.containerNode = getNode(aID);
       this.textNode = this.containerNode.firstChild;
 
       this.eventSeq = [
         new invokerChecker(EVENT_REORDER, this.containerNode)
       ];
 
-      this.invoke = function removeTextData_invoke()
-      {
+      this.invoke = function removeTextData_invoke() {
         var tree = {
           role: aRole,
           children: [
             {
               role: ROLE_TEXT_LEAF,
               name: "text"
             }
           ]
         };
         testAccessibleTree(this.containerNode, tree);
 
         this.textNode.data = "";
       }
 
-      this.finalCheck = function removeTextData_finalCheck()
-      {
+      this.finalCheck = function removeTextData_finalCheck() {
         var tree = {
           role: aRole,
           children: []
         };
         testAccessibleTree(this.containerNode, tree);
       }
 
-      this.getID = function removeTextData_finalCheck()
-      {
+      this.getID = function removeTextData_finalCheck() {
         return "remove text data of text node inside '" + aID + "'.";
       }
     }
 
     // //////////////////////////////////////////////////////////////////////////
     // Test
 
     // gA11yEventDumpID = "eventdump"; // debug stuff
     // gA11yEventDumpToConsole = true;
 
     var gQueue = null;
 
-    function doTest()
-    {
+    function doTest() {
       // adds onclick on element, text leaf should inherit its action
       setOnClickAttr("div");
       // remove onclick attribute, text leaf shouldn't have any action
       removeOnClickAttr("div");
 
       // Call rest of event tests.
       gQueue = new eventQueue();
 
--- a/accessible/tests/mochitest/treeupdate/test_visibility.html
+++ b/accessible/tests/mochitest/treeupdate/test_visibility.html
@@ -20,70 +20,64 @@
   <script type="application/javascript">
 
     // //////////////////////////////////////////////////////////////////////////
     // Invokers
 
     /**
      * Hide parent while child stays visible.
      */
-    function test1(aContainerID, aParentID, aChildID)
-    {
+    function test1(aContainerID, aParentID, aChildID) {
       this.eventSeq = [
         new invokerChecker(EVENT_HIDE, getNode(aParentID)),
         new invokerChecker(EVENT_SHOW, getNode(aChildID)),
         new invokerChecker(EVENT_REORDER, getNode(aContainerID))
       ];
 
-      this.invoke = function invoke()
-      {
+      this.invoke = function invoke() {
         var tree =
           { SECTION: [
             { SECTION: [
               { SECTION: [
                 { TEXT_LEAF: [] }
               ] }
             ] }
           ] };
         testAccessibleTree(aContainerID, tree);
 
         getNode(aParentID).style.visibility = "hidden";
       }
 
-      this.finalCheck = function finalCheck()
-      {
+      this.finalCheck = function finalCheck() {
         var tree =
           { SECTION: [
             { SECTION: [
               { TEXT_LEAF: [] }
             ] }
           ] };
         testAccessibleTree(aContainerID, tree);
       }
 
-      this.getID = function getID()
-      {
+      this.getID = function getID() {
         return "hide parent while child stays visible";
       }
     }
 
     /**
      * Hide grand parent while its children stay visible.
      */
-    function test2(aContainerID, aGrandParentID, aChildID, aChild2ID)
-    {
+    function test2(aContainerID, aGrandParentID, aChildID, aChild2ID) {
       this.eventSeq = [
         new invokerChecker(EVENT_HIDE, getNode(aGrandParentID)),
         new invokerChecker(EVENT_SHOW, getNode(aChildID)),
         new invokerChecker(EVENT_SHOW, getNode(aChild2ID)),
         new invokerChecker(EVENT_REORDER, getNode(aContainerID))
       ];
 
-      this.invoke = function invoke()
-      {
+      this.invoke = function invoke() {
         var tree =
           { SECTION: [ // container
             { SECTION: [ // grand parent
               { SECTION: [
                 { SECTION: [ // child
                   { TEXT_LEAF: [] }
                 ] },
                 { SECTION: [ // child2
@@ -92,51 +86,47 @@
               ] }
             ] }
           ] };
         testAccessibleTree(aContainerID, tree);
 
         getNode(aGrandParentID).style.visibility = "hidden";
       }
 
-      this.finalCheck = function finalCheck()
-      {
+      this.finalCheck = function finalCheck() {
         var tree =
           { SECTION: [ // container
             { SECTION: [ // child
               { TEXT_LEAF: [] }
             ] },
             { SECTION: [ // child2
               { TEXT_LEAF: [] }
             ] }
           ] };
         testAccessibleTree(aContainerID, tree);
       }
 
-      this.getID = function getID()
-      {
+      this.getID = function getID() {
         return "hide grand parent while its children stay visible";
       }
     }
 
     /**
      * Change container style, hide parents while their children stay visible.
      */
-    function test3(aContainerID, aParentID, aParent2ID, aChildID, aChild2ID)
-    {
+    function test3(aContainerID, aParentID, aParent2ID, aChildID, aChild2ID) {
       this.eventSeq = [
         new invokerChecker(EVENT_HIDE, getNode(aParentID)),
         new invokerChecker(EVENT_HIDE, getNode(aParent2ID)),
         new invokerChecker(EVENT_SHOW, getNode(aChildID)),
         new invokerChecker(EVENT_SHOW, getNode(aChild2ID)),
         new invokerChecker(EVENT_REORDER, getNode(aContainerID))
       ];
 
-      this.invoke = function invoke()
-      {
+      this.invoke = function invoke() {
         var tree =
           { SECTION: [ // container
             { SECTION: [ // parent
               { SECTION: [ // child
                 { TEXT_LEAF: [] }
               ] }
             ] },
             { SECTION: [ // parent2
@@ -147,98 +137,90 @@
           ] };
         testAccessibleTree(aContainerID, tree);
 
         getNode(aContainerID).style.color = "red";
         getNode(aParentID).style.visibility = "hidden";
         getNode(aParent2ID).style.visibility = "hidden";
       }
 
-      this.finalCheck = function finalCheck()
-      {
+      this.finalCheck = function finalCheck() {
         var tree =
           { SECTION: [ // container
             { SECTION: [ // child
               { TEXT_LEAF: [] }
             ] },
             { SECTION: [ // child2
               { TEXT_LEAF: [] }
             ] }
           ] };
         testAccessibleTree(aContainerID, tree);
       }
 
-      this.getID = function getID()
-      {
+      this.getID = function getID() {
         return "change container style, hide parents while their children stay visible";
       }
     }
 
     /**
      * Change container style and make visible child inside the table.
      */
-    function test4(aContainerID, aChildID)
-    {
+    function test4(aContainerID, aChildID) {
       this.eventSeq = [
         new invokerChecker(EVENT_SHOW, getNode(aChildID)),
         new invokerChecker(EVENT_REORDER, getNode(aChildID).parentNode)
       ];
 
-      this.invoke = function invoke()
-      {
+      this.invoke = function invoke() {
         var tree =
           { SECTION: [
             { TABLE: [
               { ROW: [
                 { CELL: [ ] }
               ] }
             ] }
           ] };
         testAccessibleTree(aContainerID, tree);
 
         getNode(aContainerID).style.color = "red";
         getNode(aChildID).style.visibility = "visible";
       }
 
-      this.finalCheck = function finalCheck()
-      {
+      this.finalCheck = function finalCheck() {
         var tree =
           { SECTION: [
             { TABLE: [
               { ROW: [
                 { CELL: [
                   { SECTION: [
                     { TEXT_LEAF: [] }
                   ] }
               ] }
             ] }
           ] }
         ] };
         testAccessibleTree(aContainerID, tree);
       }
 
-      this.getID = function getID()
-      {
+      this.getID = function getID() {
         return "change container style, make visible child insdie the table";
       }
     }
 
     /**
      * Hide subcontainer while child inside the table stays visible.
      */
-    function test5(aContainerID, aSubContainerID, aChildID)
-    {
+    function test5(aContainerID, aSubContainerID, aChildID) {
       this.eventSeq = [
         new invokerChecker(EVENT_HIDE, getNode(aSubContainerID)),
         new invokerChecker(EVENT_SHOW, getNode(aChildID)),
         new invokerChecker(EVENT_REORDER, getNode(aContainerID))
       ];
 
-      this.invoke = function invoke()
-      {
+      this.invoke = function invoke() {
         var tree =
           { SECTION: [ // container
             { SECTION: [ // subcontainer
               { TABLE: [
                 { ROW: [
                   { CELL: [
                     { SECTION: [ // child
                       { TEXT_LEAF: [] }
@@ -248,47 +230,43 @@
               ] }
             ] }
           ] };
         testAccessibleTree(aContainerID, tree);
 
         getNode(aSubContainerID).style.visibility = "hidden";
       }
 
-      this.finalCheck = function finalCheck()
-      {
+      this.finalCheck = function finalCheck() {
         var tree =
           { SECTION: [ // container
             { SECTION: [ // child
               { TEXT_LEAF: [] }
             ] }
           ] };
         testAccessibleTree(aContainerID, tree);
       }
 
-      this.getID = function getID()
-      {
+      this.getID = function getID() {
         return "hide subcontainer while child inside the table stays visible";
       }
     }
 
     /**
      * Hide subcontainer while its child and child inside the nested table stays visible.
      */
-    function test6(aContainerID, aSubContainerID, aChildID, aChild2ID)
-    {
+    function test6(aContainerID, aSubContainerID, aChildID, aChild2ID) {
       this.eventSeq = [
         new invokerChecker(EVENT_HIDE, getNode(aSubContainerID)),
         new invokerChecker(EVENT_SHOW, getNode(aChildID)),
         new invokerChecker(EVENT_SHOW, getNode(aChild2ID)),
         new invokerChecker(EVENT_REORDER, getNode(aContainerID))
       ];
 
-      this.invoke = function invoke()
-      {
+      this.invoke = function invoke() {
         var tree =
           { SECTION: [ // container
             { SECTION: [ // subcontainer
               { TABLE: [
                 { ROW: [
                   { CELL: [
                     { TABLE: [ // nested table
                       { ROW: [
@@ -299,44 +277,41 @@
                 { TEXT_LEAF: [] } ]} ]} ]};
 
         testAccessibleTree(aContainerID, tree);
 
         // invoke
         getNode(aSubContainerID).style.visibility = "hidden";
       }
 
-      this.finalCheck = function finalCheck()
-      {
+      this.finalCheck = function finalCheck() {
         var tree =
           { SECTION: [ // container
             { SECTION: [ // child
               { TEXT_LEAF: [] } ]},
             { SECTION: [ // child2
               { TEXT_LEAF: [] } ]} ]};
 
         testAccessibleTree(aContainerID, tree);
       }
 
-      this.getID = function getID()
-      {
+      this.getID = function getID() {
         return "hide subcontainer while its child and child inside the nested table stays visible";
       }
     }
 
     // //////////////////////////////////////////////////////////////////////////
     // Test
 
     // gA11yEventDumpID = "eventdump"; // debug stuff
     // gA11yEventDumpToConsole = true;
 
     var gQueue = null;
 
-    function doTest()
-    {
+    function doTest() {
       gQueue = new eventQueue();
 
       gQueue.push(new test1("t1_container", "t1_parent", "t1_child"));
       gQueue.push(new test2("t2_container", "t2_grandparent", "t2_child", "t2_child2"));
       gQueue.push(new test3("t3_container", "t3_parent", "t3_parent2", "t3_child", "t3_child2"));
       gQueue.push(new test4("t4_container", "t4_child"));
       gQueue.push(new test5("t5_container", "t5_subcontainer", "t5_child"));
       gQueue.push(new test6("t6_container", "t6_subcontainer", "t6_child", "t6_child2"));
--- a/accessible/tests/mochitest/treeupdate/test_whitespace.html
+++ b/accessible/tests/mochitest/treeupdate/test_whitespace.html
@@ -27,59 +27,55 @@
      *
      * Before:
      *   DOM: whitespace img1 whitespace img2 whitespace img3 whitespace,
      *   a11y: img1 whitespace img2 whitespace img3
      * After:
      *   DOM: whitespace img1 whitespace whitespace img3 whitespace,
      *   a11y: img1 whitespace img3
      */
-    function removeImg()
-    {
+    function removeImg() {
       this.containerNode = getNode("container1");
       this.imgNode = getNode("img1");
       this.img = getAccessible(this.imgNode);
       this.text = this.img.nextSibling;
 
       this.eventSeq = [
         new invokerChecker(EVENT_HIDE, this.img),
         new invokerChecker(EVENT_HIDE, this.text),
         new invokerChecker(EVENT_REORDER, this.containerNode)
       ];
 
-      this.finalCheck = function textLeafUpdate_finalCheck()
-      {
+      this.finalCheck = function textLeafUpdate_finalCheck() {
         var tree =
           { SECTION: [
             { GRAPHIC: [] },
             { TEXT_LEAF: [] },
             { GRAPHIC: [] }
           ] };
 
         testAccessibleTree(this.containerNode, tree);
       }
 
-      this.invoke = function setOnClickAttr_invoke()
-      {
+      this.invoke = function setOnClickAttr_invoke() {
         var tree =
           { SECTION: [
             { GRAPHIC: [] },
             { TEXT_LEAF: [] },
             { GRAPHIC: [] },
             { TEXT_LEAF: [] },
             { GRAPHIC: [] }
           ] };
 
         testAccessibleTree(this.containerNode, tree);
 
         this.containerNode.removeChild(this.imgNode);
       }
 
-      this.getID = function setOnClickAttr_getID()
-      {
+      this.getID = function setOnClickAttr_getID() {
         return "remove middle img";
       }
     }
 
     /**
      * Append image making the whitespace visible and thus accessible.
      * Note: images and whitespaces are on different leves of accessible trees,
      * so that image container accessible update doesn't update the tree
@@ -87,78 +83,73 @@
      *
      * Before:
      *   DOM: whitespace emptylink whitespace linkwithimg whitespace
      *   a11y: emptylink linkwithimg
      * After:
      *   DOM: whitespace linkwithimg whitespace linkwithimg whitespace
      *   a11y: linkwithimg whitespace linkwithimg
      */
-    function insertImg()
-    {
+    function insertImg() {
       this.containerNode = getNode("container2");
       this.topNode = this.containerNode.parentNode;
       this.textNode = this.containerNode.nextSibling;
       this.imgNode = document.createElement("img");
       this.imgNode.setAttribute("src", "../moz.png");
 
       this.eventSeq = [
         new asyncInvokerChecker(EVENT_SHOW, getAccessible, this.textNode),
         new asyncInvokerChecker(EVENT_SHOW, getAccessible, this.imgNode),
         new orderChecker(),
         new invokerChecker(EVENT_REORDER, this.topNode)
       ];
 
-      this.invoke = function insertImg_invoke()
-      {
+      this.invoke = function insertImg_invoke() {
         var tree =
           { SECTION: [
             { LINK: [] },
             { LINK: [
               { GRAPHIC: [] }
             ] }
           ] };
 
         testAccessibleTree(this.topNode, tree);
 
         this.containerNode.appendChild(this.imgNode);
       }
 
-      this.finalCheck = function insertImg_finalCheck()
-      {
+      this.finalCheck = function insertImg_finalCheck() {
         var tree =
           { SECTION: [
             { LINK: [
               { GRAPHIC: [ ] }
             ] },
             { TEXT_LEAF: [ ] },
             { LINK: [
               { GRAPHIC: [ ] }
             ] }
           ] };
 
         testAccessibleTree(this.topNode, tree);
       }
 
-      this.getID = function appendImg_getID()
-      {
+      this.getID = function appendImg_getID() {
         return "insert img into internal container";
       }
     }
 
     // //////////////////////////////////////////////////////////////////////////
     // Test
 
     // gA11yEventDumpID = "eventdump"; // debug stuff
     // gA11yEventDumpToConsole = true;
 
     var gQueue = null;
 
-    function doTest()
-    {
+    function doTest() {
       gQueue = new eventQueue();
 
       gQueue.push(new removeImg());
       gQueue.push(new insertImg());
 
       gQueue.invoke(); // SimpleTest.finish() will be called in the end
     }
 
--- a/accessible/tests/mochitest/treeview.js
+++ b/accessible/tests/mochitest/treeview.js
@@ -1,239 +1,210 @@
 /**
  * Helper method to start a single XUL tree test.
  */
-function loadXULTreeAndDoTest(aDoTestFunc, aTreeID, aTreeView)
-{
+function loadXULTreeAndDoTest(aDoTestFunc, aTreeID, aTreeView) {
   var doTestFunc = aDoTestFunc ? aDoTestFunc : gXULTreeLoadContext.doTestFunc;
   var treeID = aTreeID ? aTreeID : gXULTreeLoadContext.treeID;
   var treeView = aTreeView ? aTreeView : gXULTreeLoadContext.treeView;
 
-  function loadXULTree(aTreeID, aTreeView)
-  {
+  function loadXULTree(aTreeID, aTreeView) {
     this.treeNode = getNode(aTreeID);
 
     this.eventSeq = [
       new invokerChecker(EVENT_REORDER, this.treeNode)
     ];
 
-    this.invoke = function loadXULTree_invoke()
-    {
+    this.invoke = function loadXULTree_invoke() {
       this.treeNode.view = aTreeView;
     }
 
-    this.getID = function loadXULTree_getID()
-    {
+    this.getID = function loadXULTree_getID() {
       return "Load XUL tree " + prettyName(aTreeID);
     }
   }
 
   gXULTreeLoadContext.queue = new eventQueue();
   gXULTreeLoadContext.queue.push(new loadXULTree(treeID, treeView));
-  gXULTreeLoadContext.queue.onFinish = function()
-  {
+  gXULTreeLoadContext.queue.onFinish = function() {
     SimpleTest.executeSoon(doTestFunc);
     return DO_NOT_FINISH_TEST;
   }
   gXULTreeLoadContext.queue.invoke();
 }
 
 /**
  * Analogy of addA11yLoadEvent, nice helper to load XUL tree and start the test.
  */
-function addA11yXULTreeLoadEvent(aDoTestFunc, aTreeID, aTreeView)
-{
+function addA11yXULTreeLoadEvent(aDoTestFunc, aTreeID, aTreeView) {
   gXULTreeLoadContext.doTestFunc = aDoTestFunc;
   gXULTreeLoadContext.treeID = aTreeID;
   gXULTreeLoadContext.treeView = aTreeView;
 
   addA11yLoadEvent(loadXULTreeAndDoTest);
 }
 
 
-function nsTableTreeView(aRowCount)
-{
+function nsTableTreeView(aRowCount) {
   this.__proto__ = new nsTreeView();
 
   for (var idx = 0; idx < aRowCount; idx++)
     this.mData.push(new treeItem("row" + String(idx) + "_"));
 }
 
-function nsTreeTreeView()
-{
+function nsTreeTreeView() {
   this.__proto__ = new nsTreeView();
 
   this.mData = [
     new treeItem("row1"),
     new treeItem("row2_", true, [new treeItem("row2.1_"), new treeItem("row2.2_")]),
     new treeItem("row3_", false, [new treeItem("row3.1_"), new treeItem("row3.2_")]),
     new treeItem("row4")
   ];
 }
 
-function nsTreeView()
-{
+function nsTreeView() {
   this.mTree = null;
   this.mData = [];
 }
 
 nsTreeView.prototype =
 {
   // ////////////////////////////////////////////////////////////////////////////
   // nsITreeView implementation
 
-  get rowCount()
-  {
+  get rowCount() {
     return this.getRowCountIntl(this.mData);
   },
-  setTree: function setTree(aTree)
-  {
+  setTree: function setTree(aTree) {
     this.mTree = aTree;
   },
-  getCellText: function getCellText(aRow, aCol)
-  {
+  getCellText: function getCellText(aRow, aCol) {
     var data = this.getDataForIndex(aRow);
     if (aCol.id in data.colsText)
       return data.colsText[aCol.id];
 
     return data.text + aCol.id;
   },
-  getCellValue: function getCellValue(aRow, aCol)
-  {
+  getCellValue: function getCellValue(aRow, aCol) {
     var data = this.getDataForIndex(aRow);
     return data.value;
   },
   getRowProperties: function getRowProperties(aIndex) { return ""; },
-  getCellProperties: function getCellProperties(aIndex, aCol)
-  {
+  getCellProperties: function getCellProperties(aIndex, aCol) {
     if (!aCol.cycler)
       return "";
 
     var data = this.getDataForIndex(aIndex);
     return this.mCyclerStates[data.cyclerState];
   },
   getColumnProperties: function getColumnProperties(aCol) { return ""; },
-  getParentIndex: function getParentIndex(aRowIndex)
-  {
+  getParentIndex: function getParentIndex(aRowIndex) {
     var info = this.getInfoByIndex(aRowIndex);
     return info.parentIndex;
   },
   hasNextSibling: function hasNextSibling(aRowIndex, aAfterIndex) { },
-  getLevel: function getLevel(aIndex)
-  {
+  getLevel: function getLevel(aIndex) {
     var info = this.getInfoByIndex(aIndex);
     return info.level;
   },
   getImageSrc: function getImageSrc(aRow, aCol) {},
   getProgressMode: function getProgressMode(aRow, aCol) {},
-  isContainer: function isContainer(aIndex)
-  {
+  isContainer: function isContainer(aIndex) {
     var data = this.getDataForIndex(aIndex);
     return data.open != undefined;
   },
-  isContainerOpen: function isContainerOpen(aIndex)
-  {
+  isContainerOpen: function isContainerOpen(aIndex) {
     var data = this.getDataForIndex(aIndex);
     return data.open;
   },
-  isContainerEmpty: function isContainerEmpty(aIndex)
-  {
+  isContainerEmpty: function isContainerEmpty(aIndex) {
     var data = this.getDataForIndex(aIndex);
     return data.open == undefined;
   },
   isSeparator: function isSeparator(aIndex) {},
   isSorted: function isSorted() {},
-  toggleOpenState: function toggleOpenState(aIndex)
-  {
+  toggleOpenState: function toggleOpenState(aIndex) {
     var data = this.getDataForIndex(aIndex);
 
     data.open = !data.open;
     var rowCount = this.getRowCountIntl(data.children);
 
     if (data.open)
       this.mTree.rowCountChanged(aIndex + 1, rowCount);
     else
       this.mTree.rowCountChanged(aIndex + 1, -rowCount);
   },
   selectionChanged: function selectionChanged() {},
   cycleHeader: function cycleHeader(aCol) {},
-  cycleCell: function cycleCell(aRow, aCol)
-  {
+  cycleCell: function cycleCell(aRow, aCol) {
     var data = this.getDataForIndex(aRow);
     data.cyclerState = (data.cyclerState + 1) % 3;
 
     this.mTree.invalidateCell(aRow, aCol);
   },
-  isEditable: function isEditable(aRow, aCol)
-  {
+  isEditable: function isEditable(aRow, aCol) {
     return true;
   },
   isSelectable: function isSelectable(aRow, aCol) {},
-  setCellText: function setCellText(aRow, aCol, aValue)
-  {
+  setCellText: function setCellText(aRow, aCol, aValue) {
     var data = this.getDataForIndex(aRow);
     data.colsText[aCol.id] = aValue;
   },
-  setCellValue: function setCellValue(aRow, aCol, aValue)
-  {
+  setCellValue: function setCellValue(aRow, aCol, aValue) {
     var data = this.getDataForIndex(aRow);
     data.value = aValue;
 
     this.mTree.invalidateCell(aRow, aCol);
   },
   performAction: function performAction(aAction) {},
   performActionOnRow: function performActionOnRow(aAction, aRow) {},
   performActionOnCell: function performActionOnCell(aAction, aRow, aCol) {},
 
   // ////////////////////////////////////////////////////////////////////////////
   // public implementation
 
-  appendItem: function appendItem(aText)
-  {
+  appendItem: function appendItem(aText) {
     this.mData.push(new treeItem(aText));
   },
 
   // ////////////////////////////////////////////////////////////////////////////
   // private implementation
 
-  getDataForIndex: function getDataForIndex(aRowIndex)
-  {
+  getDataForIndex: function getDataForIndex(aRowIndex) {
     return this.getInfoByIndex(aRowIndex).data;
   },
 
-  getInfoByIndex: function getInfoByIndex(aRowIndex)
-  {
+  getInfoByIndex: function getInfoByIndex(aRowIndex) {
     var info = {
       data: null,
       parentIndex: -1,
       level: 0,
       index: -1
     };
 
     this.getInfoByIndexIntl(aRowIndex, info, this.mData, 0);
     return info;
   },
 
-  getRowCountIntl: function getRowCountIntl(aChildren)
-  {
+  getRowCountIntl: function getRowCountIntl(aChildren) {
     var rowCount = 0;
     for (var childIdx = 0; childIdx < aChildren.length; childIdx++) {
       rowCount++;
 
       var data = aChildren[childIdx];
       if (data.open)
         rowCount += this.getRowCountIntl(data.children);
     }
 
     return rowCount;
   },
 
   getInfoByIndexIntl: function getInfoByIndexIntl(aRowIdx, aInfo,
-                                                  aChildren, aLevel)
-  {
+                                                  aChildren, aLevel) {
     var rowIdx = aRowIdx;
     for (var childIdx = 0; childIdx < aChildren.length; childIdx++) {
       var data = aChildren[childIdx];
 
       aInfo.index++;
 
       if (rowIdx == 0) {
         aInfo.data = data;
@@ -261,18 +232,17 @@ nsTreeView.prototype =
 
   mCyclerStates: [
     "cyclerState1",
     "cyclerState2",
     "cyclerState3"
   ]
 };
 
-function treeItem(aText, aOpen, aChildren)
-{
+function treeItem(aText, aOpen, aChildren) {
   this.text = aText;
   this.colsText = {};
   this.open = aOpen;
   this.value = "true";
   this.cyclerState = 0;
   if (aChildren)
     this.children = aChildren;
 }
--- a/accessible/tests/mochitest/value.js
+++ b/accessible/tests/mochitest/value.js
@@ -8,18 +8,17 @@
  * @param aValue         [in] accessible value (nsIAccessible::value)
  * @param aCurrValue     [in] current value (nsIAccessibleValue::currentValue)
  * @param aMinValue      [in] minimum value (nsIAccessibleValue::minimumValue)
  * @param aMaxValue      [in] maximumn value (nsIAccessibleValue::maximumValue)
  * @param aMinIncr       [in] minimum increment value
  *                        (nsIAccessibleValue::minimumIncrement)
  */
 function testValue(aAccOrElmOrId, aValue, aCurrValue,
-                   aMinValue, aMaxValue, aMinIncr)
-{
+                   aMinValue, aMaxValue, aMinIncr) {
   var acc = getAccessible(aAccOrElmOrId, [nsIAccessibleValue]);
   if (!acc)
     return;
 
   is(acc.value, aValue, "Wrong value of " + prettyName(aAccOrElmOrId));
 
   is(acc.currentValue, aCurrValue,
      "Wrong current value of " + prettyName(aAccOrElmOrId));
--- a/accessible/tests/mochitest/value/test_general.html
+++ b/accessible/tests/mochitest/value/test_general.html
@@ -21,20 +21,18 @@
 
   <script type="application/javascript"
           src="../common.js"></script>
 
   <script type="application/javascript"
 	  src="chrome://mochikit/content/chrome-harness.js"></script>
 
   <script type="application/javascript">
-    function doTest()
-    {
-      function testValue(aID, aValue)
-      {
+    function doTest() {
+      function testValue(aID, aValue) {
         var acc = getAccessible(aID);
         if (!acc)
           return;
         is(acc.value, aValue, "Wrong value for " + aID + "!");
       }
 
       var href = getRootDirectory(window.location.href) + "foo";
 
--- a/accessible/tests/mochitest/value/test_number.html
+++ b/accessible/tests/mochitest/value/test_number.html
@@ -13,18 +13,17 @@
           src="../common.js"></script>
   <script type="application/javascript"
           src="../value.js"></script>
 
   <script type="application/javascript"
           src="chrome://mochikit/content/chrome-harness.js"></script>
 
   <script type="application/javascript">
-    function doTest()
-    {
+    function doTest() {
       // HTML5 number element tests
       testValue("number", "", 0, 0, 0, 1);
       testValue("number_value", "1", 1, 0, 0, 1);
       testValue("number_step", "", 0, 0, 0, 1);
       testValue("number_min42", "", 0, 42, 0, 1);
       testValue("number_max42", "", 0, 0, 42, 1);
 
       SimpleTest.finish();
--- a/accessible/tests/mochitest/value/test_progress.html
+++ b/accessible/tests/mochitest/value/test_progress.html
@@ -13,18 +13,17 @@
           src="../common.js"></script>
   <script type="application/javascript"
           src="../value.js"></script>
 
   <script type="application/javascript"
           src="chrome://mochikit/content/chrome-harness.js"></script>
 
   <script type="application/javascript">
-    function doTest()
-    {
+    function doTest() {
       // HTML5 progress element tests
       testValue("pr_indeterminate", "", 0, 0, 1, 0);
       testValue("pr_zero", "0%", 0, 0, 1, 0);
       testValue("pr_zeropointfive", "50%", 0.5, 0, 1, 0);
       testValue("pr_one", "100%", 1, 0, 1, 0);
       testValue("pr_42", "100%", 42, 0, 1, 0);
       testValue("pr_21", "50%", 21, 0, 42, 0);
 
--- a/accessible/tests/mochitest/value/test_range.html
+++ b/accessible/tests/mochitest/value/test_range.html
@@ -13,18 +13,17 @@
           src="../common.js"></script>
   <script type="application/javascript"
           src="../value.js"></script>
 
   <script type="application/javascript"
           src="chrome://mochikit/content/chrome-harness.js"></script>
 
   <script type="application/javascript">
-    function doTest()
-    {
+    function doTest() {
       // HTML5 progress element tests
       testValue("range", "50", 50, 0, 100, 1);
       testValue("range_value", "1", 1, 0, 100, 1);
       testValue("range_step", "50", 50, 0, 100, 1);
       testValue("range_min42", "71", 71, 42, 100, 1);
       testValue("range_max42", "21", 21, 0, 42, 1);
 
       SimpleTest.finish();