Bug 527003 - renamed nsIAccessibleRetrieval to nsIAccessibilityService. draft
authorYura Zenevich <yzenevich@mozilla.com>
Tue, 21 Jun 2016 16:45:43 -0400
changeset 380367 85f9c5693ddf93dc0e98dbf998a8ed28a32c7f43
parent 380366 ca39c48e709a72f8f7fc7a6dc6bfbcb95457b8f1
child 380368 290beeedc8ba0e8d8e9854d241835d6edda64b11
push id21208
push useryura.zenevich@gmail.com
push dateTue, 21 Jun 2016 20:51:29 +0000
bugs527003, 448064, 471493
milestone50.0a1
Bug 527003 - renamed nsIAccessibleRetrieval to nsIAccessibilityService. MozReview-Commit-ID: 2fkEIWZlAkv --- accessible/base/nsAccessibilityService.cpp | 8 +++---- accessible/base/nsAccessibilityService.h | 8 +++---- accessible/interfaces/moz.build | 2 +- ...leRetrieval.idl => nsIAccessibilityService.idl} | 2 +- accessible/jsat/AccessFu.jsm | 2 +- accessible/jsat/ContentControl.jsm | 6 ++--- accessible/jsat/EventManager.jsm | 4 ++-- accessible/jsat/OutputGenerator.jsm | 4 ++-- accessible/jsat/Traversal.jsm | 2 +- accessible/jsat/Utils.jsm | 24 +++++++++---------- accessible/jsat/content-script.js | 2 +- accessible/tests/crashtests/448064.xhtml | 4 ++-- accessible/tests/crashtests/471493.xul | 6 ++--- accessible/tests/mochitest/common.js | 28 +++++++++++----------- accessible/tests/mochitest/events/docload_wnd.html | 12 +++++----- .../tests/mochitest/events/test_docload.html | 4 ++-- accessible/tests/mochitest/pivot.js | 2 +- .../tests/mochitest/states/z_frames_update.html | 6 ++--- layout/build/nsLayoutModule.cpp | 1 - testing/marionette/accessibility.js | 10 ++++---- testing/talos/talos/tests/a11y/a11y.js | 18 +++++++------- 21 files changed, 77 insertions(+), 78 deletions(-) rename accessible/interfaces/{nsIAccessibleRetrieval.idl => nsIAccessibilityService.idl} (98%)
accessible/base/nsAccessibilityService.cpp
accessible/base/nsAccessibilityService.h
accessible/interfaces/moz.build
accessible/interfaces/nsIAccessibilityService.idl
accessible/interfaces/nsIAccessibleRetrieval.idl
accessible/jsat/AccessFu.jsm
accessible/jsat/ContentControl.jsm
accessible/jsat/EventManager.jsm
accessible/jsat/OutputGenerator.jsm
accessible/jsat/Traversal.jsm
accessible/jsat/Utils.jsm
accessible/jsat/content-script.js
accessible/tests/crashtests/448064.xhtml
accessible/tests/crashtests/471493.xul
accessible/tests/mochitest/common.js
accessible/tests/mochitest/events/docload_wnd.html
accessible/tests/mochitest/events/test_docload.html
accessible/tests/mochitest/pivot.js
accessible/tests/mochitest/states/z_frames_update.html
layout/build/nsLayoutModule.cpp
testing/marionette/accessibility.js
testing/talos/talos/tests/a11y/a11y.js
--- a/accessible/base/nsAccessibilityService.cpp
+++ b/accessible/base/nsAccessibilityService.cpp
@@ -335,17 +335,17 @@ nsAccessibilityService::ListenersChanged
   return NS_OK;
 }
 
 ////////////////////////////////////////////////////////////////////////////////
 // nsISupports
 
 NS_IMPL_ISUPPORTS_INHERITED(nsAccessibilityService,
                             DocManager,
-                            nsIAccessibleRetrieval,
+                            nsIAccessibilityService,
                             nsIObserver,
                             nsIListenerChangeListener,
                             nsISelectionListener) // from SelectionManager
 
 ////////////////////////////////////////////////////////////////////////////////
 // nsIObserver
 
 NS_IMETHODIMP
@@ -727,17 +727,17 @@ nsAccessibilityService::RecreateAccessib
                                            nsIContent* aContent)
 {
   DocAccessible* document = GetDocAccessible(aPresShell);
   if (document)
     document->RecreateAccessible(aContent);
 }
 
 ////////////////////////////////////////////////////////////////////////////////
-// nsIAccessibleRetrieval
+// nsIAccessibilityService
 
 NS_IMETHODIMP
 nsAccessibilityService::GetApplicationAccessible(nsIAccessible** aAccessibleApplication)
 {
   NS_ENSURE_ARG_POINTER(aAccessibleApplication);
 
   NS_IF_ADDREF(*aAccessibleApplication = XPCApplicationAcc());
   return NS_OK;
@@ -891,34 +891,34 @@ nsAccessibilityService::GetStringStates(
   //unknown states
   if (!stringStates->Length())
     stringStates->Add(NS_LITERAL_STRING("unknown"));
 
   stringStates.forget(aStringStates);
   return NS_OK;
 }
 
-// nsIAccessibleRetrieval::getStringEventType()
+// nsIAccessibilityService::getStringEventType()
 NS_IMETHODIMP
 nsAccessibilityService::GetStringEventType(uint32_t aEventType,
                                            nsAString& aString)
 {
   NS_ASSERTION(nsIAccessibleEvent::EVENT_LAST_ENTRY == ArrayLength(kEventTypeNames),
                "nsIAccessibleEvent constants are out of sync to kEventTypeNames");
 
   if (aEventType >= ArrayLength(kEventTypeNames)) {
     aString.AssignLiteral("unknown");
     return NS_OK;
   }
 
   CopyUTF8toUTF16(kEventTypeNames[aEventType], aString);
   return NS_OK;
 }
 
-// nsIAccessibleRetrieval::getStringRelationType()
+// nsIAccessibilityService::getStringRelationType()
 NS_IMETHODIMP
 nsAccessibilityService::GetStringRelationType(uint32_t aRelationType,
                                               nsAString& aString)
 {
   NS_ENSURE_ARG(aRelationType <= static_cast<uint32_t>(RelationType::LAST));
 
 #define RELATIONTYPE(geckoType, geckoTypeName, atkType, msaaType, ia2Type) \
   case RelationType::geckoType: \
--- a/accessible/base/nsAccessibilityService.h
+++ b/accessible/base/nsAccessibilityService.h
@@ -1,17 +1,17 @@
 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #ifndef __nsAccessibilityService_h__
 #define __nsAccessibilityService_h__
 
-#include "nsIAccessibleRetrieval.h"
+#include "nsIAccessibilityService.h"
 
 #include "mozilla/a11y/DocManager.h"
 #include "mozilla/a11y/FocusManager.h"
 #include "mozilla/a11y/Role.h"
 #include "mozilla/a11y/SelectionManager.h"
 #include "mozilla/Preferences.h"
 
 #include "nsIObserver.h"
@@ -63,33 +63,33 @@ struct MarkupMapInfo {
 };
 
 } // namespace a11y
 } // namespace mozilla
 
 class nsAccessibilityService final : public mozilla::a11y::DocManager,
                                      public mozilla::a11y::FocusManager,
                                      public mozilla::a11y::SelectionManager,
-                                     public nsIAccessibleRetrieval,
+                                     public nsIAccessibilityService,
                                      public nsIListenerChangeListener,
                                      public nsIObserver
 {
 public:
   typedef mozilla::a11y::Accessible Accessible;
   typedef mozilla::a11y::DocAccessible DocAccessible;
 
   // nsIListenerChangeListener
   NS_IMETHOD ListenersChanged(nsIArray* aEventChanges) override;
 
 protected:
   virtual ~nsAccessibilityService();
 
 public:
   NS_DECL_ISUPPORTS_INHERITED
-  NS_DECL_NSIACCESSIBLERETRIEVAL
+  NS_DECL_NSIACCESSIBILITYSERVICE
   NS_DECL_NSIOBSERVER
 
   virtual Accessible* GetRootDocumentAccessible(nsIPresShell* aPresShell,
                                                 bool aCanCreate);
   already_AddRefed<Accessible>
     CreatePluginAccessible(nsPluginFrame* aFrame, nsIContent* aContent,
                            Accessible* aContext);
 
@@ -288,17 +288,17 @@ IPCAccessibilityActive()
 #else
   return XRE_IsContentProcess() &&
     mozilla::Preferences::GetBool("accessibility.ipc_architecture.enabled", true);
 #endif
 }
 
 /**
  * Map nsIAccessibleEvents constants to strings. Used by
- * nsIAccessibleRetrieval::getStringEventType() method.
+ * nsIAccessibilityService::getStringEventType() method.
  */
 static const char kEventTypeNames[][40] = {
   "unknown",                                 //
   "show",                                    // EVENT_SHOW
   "hide",                                    // EVENT_HIDE
   "reorder",                                 // EVENT_REORDER
   "active decendent change",                 // EVENT_ACTIVE_DECENDENT_CHANGED
   "focus",                                   // EVENT_FOCUS
--- a/accessible/interfaces/moz.build
+++ b/accessible/interfaces/moz.build
@@ -3,30 +3,30 @@
 # This Source Code Form is subject to the terms of the Mozilla Public
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
 if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'windows' and CONFIG['COMPILE_ENVIRONMENT']:
     DIRS += ['msaa', 'ia2']
 
 XPIDL_SOURCES += [
+    'nsIAccessibilityService.idl',
     'nsIAccessible.idl',
     'nsIAccessibleApplication.idl',
     'nsIAccessibleCaretMoveEvent.idl',
     'nsIAccessibleDocument.idl',
     'nsIAccessibleEditableText.idl',
     'nsIAccessibleEvent.idl',
     'nsIAccessibleHideEvent.idl',
     'nsIAccessibleHyperLink.idl',
     'nsIAccessibleHyperText.idl',
     'nsIAccessibleImage.idl',
     'nsIAccessibleObjectAttributeChangedEvent.idl',
     'nsIAccessiblePivot.idl',
     'nsIAccessibleRelation.idl',
-    'nsIAccessibleRetrieval.idl',
     'nsIAccessibleRole.idl',
     'nsIAccessibleSelectable.idl',
     'nsIAccessibleStateChangeEvent.idl',
     'nsIAccessibleStates.idl',
     'nsIAccessibleTable.idl',
     'nsIAccessibleTableChangeEvent.idl',
     'nsIAccessibleText.idl',
     'nsIAccessibleTextChangeEvent.idl',
rename from accessible/interfaces/nsIAccessibleRetrieval.idl
rename to accessible/interfaces/nsIAccessibilityService.idl
--- a/accessible/interfaces/nsIAccessibleRetrieval.idl
+++ b/accessible/interfaces/nsIAccessibilityService.idl
@@ -12,17 +12,17 @@ interface nsIPresShell;
 interface nsIAccessiblePivot;
 
 /**
  * An interface for in-process accessibility clients wishing to get an
  * nsIAccessible for a given DOM node.  More documentation at:
  *   http://www.mozilla.org/projects/ui/accessibility
  */
 [scriptable, uuid(17f86615-1a3d-4021-b227-3a2ef5cbffd8)]
-interface nsIAccessibleRetrieval : nsISupports
+interface nsIAccessibilityService : nsISupports
 {
   /**
    * Return application accessible.
    */
   nsIAccessible getApplicationAccessible();
 
   /**
    * Return an nsIAccessible for a DOM node in pres shell 0.
--- a/accessible/jsat/AccessFu.jsm
+++ b/accessible/jsat/AccessFu.jsm
@@ -242,17 +242,17 @@ this.AccessFu = { // jshint ignore:line
       case 'AccessFu:DoScroll':
         this.Input.doScroll(aMessage.json);
         break;
     }
   },
 
   _output: function _output(aPresentationData, aBrowser) {
     if (!Utils.isAliveAndVisible(
-      Utils.AccRetrieval.getAccessibleFor(aBrowser))) {
+      Utils.AccService.getAccessibleFor(aBrowser))) {
       return;
     }
     for (let presenter of aPresentationData) {
       if (!presenter) {
         continue;
       }
 
       try {
--- a/accessible/jsat/ContentControl.jsm
+++ b/accessible/jsat/ContentControl.jsm
@@ -217,17 +217,17 @@ this.ContentControl.prototype = {
         if (control && control.actionCount > 0) {
           control.doAction(0);
         }
 
         // XXX Some mobile widget sets do not expose actions properly
         // (via ARIA roles, etc.), so we need to generate a click.
         // Could possibly be made simpler in the future. Maybe core
         // engine could expose nsCoreUtiles::DispatchMouseEvent()?
-        let docAcc = Utils.AccRetrieval.getAccessibleFor(this.document);
+        let docAcc = Utils.AccService.getAccessibleFor(this.document);
         let docX = {}, docY = {}, docW = {}, docH = {};
         docAcc.getBounds(docX, docY, docW, docH);
 
         let objX = {}, objY = {}, objW = {}, objH = {};
         aAccessible.getBounds(objX, objY, objW, objH);
 
         let x = Math.round((objX.value - docX.value) + objW.value / 2);
         let y = Math.round((objY.value - docY.value) + objH.value / 2);
@@ -244,17 +244,17 @@ this.ContentControl.prototype = {
 
       if (!Utils.isActivatableOnFingerUp(aAccessible)) {
         // Keys will typically have a sound of their own.
         this._contentScope.get().sendAsyncMessage('AccessFu:Present',
           Presentation.actionInvoked(aAccessible, 'click'));
       }
     };
 
-    let focusedAcc = Utils.AccRetrieval.getAccessibleFor(
+    let focusedAcc = Utils.AccService.getAccessibleFor(
       this.document.activeElement);
     if (focusedAcc && this.vc.position === focusedAcc
         && focusedAcc.role === Roles.ENTRY) {
       let accText = focusedAcc.QueryInterface(Ci.nsIAccessibleText);
       let oldOffset = accText.caretOffset;
       let newOffset = aMessage.json.offset;
       let text = accText.getText(0, accText.characterCount);
 
@@ -473,17 +473,17 @@ this.ContentControl.prototype = {
 
       if (aOptions.noOpIfOnScreen &&
         Utils.isAliveAndVisible(vc.position, true)) {
         forcePresentFunc();
         return;
       }
 
       if (aOptions.moveToFocused) {
-        acc = Utils.AccRetrieval.getAccessibleFor(
+        acc = Utils.AccService.getAccessibleFor(
           this.document.activeElement) || acc;
       }
 
       let moved = false;
       let moveMethod = aOptions.moveMethod || 'moveNext'; // default is moveNext
       let moveFirstOrLast = moveMethod in ['moveFirst', 'moveLast'];
       if (!moveFirstOrLast || acc) {
         // We either need next/previous or there is an anchor we need to use.
--- a/accessible/jsat/EventManager.jsm
+++ b/accessible/jsat/EventManager.jsm
@@ -554,25 +554,25 @@ this.EventManager.prototype = {
     if ((aStateFlags & loadingState) == loadingState) {
       tabstate = 'loading';
     } else if ((aStateFlags & loadedState) == loadedState &&
                !aWebProgress.isLoadingDocument) {
       tabstate = 'loaded';
     }
 
     if (tabstate) {
-      let docAcc = Utils.AccRetrieval.getAccessibleFor(aWebProgress.DOMWindow.document);
+      let docAcc = Utils.AccService.getAccessibleFor(aWebProgress.DOMWindow.document);
       this.present(Presentation.tabStateChanged(docAcc, tabstate));
     }
   },
 
   onProgressChange: function onProgressChange() {},
 
   onLocationChange: function onLocationChange(aWebProgress, aRequest, aLocation, aFlags) {
-    let docAcc = Utils.AccRetrieval.getAccessibleFor(aWebProgress.DOMWindow.document);
+    let docAcc = Utils.AccService.getAccessibleFor(aWebProgress.DOMWindow.document);
     this.present(Presentation.tabStateChanged(docAcc, 'newdoc'));
   },
 
   onStatusChange: function onStatusChange() {},
 
   onSecurityChange: function onSecurityChange() {},
 
   QueryInterface: XPCOMUtils.generateQI([Ci.nsIWebProgressListener,
--- a/accessible/jsat/OutputGenerator.jsm
+++ b/accessible/jsat/OutputGenerator.jsm
@@ -47,17 +47,17 @@ var OutputGenerator = {
    */
   genForContext: function genForContext(aContext) {
     let output = [];
     let self = this;
     let addOutput = function addOutput(aAccessible) {
       output.push.apply(output, self.genForObject(aAccessible, aContext));
     };
     let ignoreSubtree = function ignoreSubtree(aAccessible) {
-      let roleString = Utils.AccRetrieval.getStringRole(aAccessible.role);
+      let roleString = Utils.AccService.getStringRole(aAccessible.role);
       let nameRule = self.roleRuleMap[roleString] || 0;
       // Ignore subtree if the name is explicit and the role's name rule is the
       // NAME_FROM_SUBTREE_RULE.
       return (((nameRule & INCLUDE_VALUE) && aAccessible.value) ||
               ((nameRule & NAME_FROM_SUBTREE_RULE) &&
                (Utils.getAttributes(aAccessible)['explicit-name'] === 'true' &&
                !(nameRule & IGNORE_EXPLICIT_NAME))));
     };
@@ -103,17 +103,17 @@ var OutputGenerator = {
    *    context information for a given accessible and its relationship with
    *    another accessible.
    * @return {Array} A 2 element array of speech data. The first element
    *    describes the object and its state. The second element is the object's
    *    name. Whether the object's description or it's role is included is
    *    determined by {@link roleRuleMap}.
    */
   genForObject: function genForObject(aAccessible, aContext) {
-    let roleString = Utils.AccRetrieval.getStringRole(aAccessible.role);
+    let roleString = Utils.AccService.getStringRole(aAccessible.role);
     let func = this.objectOutputFunctions[
       OutputGenerator._getOutputName(roleString)] ||
       this.objectOutputFunctions.defaultFunc;
 
     let flags = this.roleRuleMap[roleString] || 0;
 
     if (aAccessible.childCount === 0) {
       flags |= INCLUDE_NAME;
--- a/accessible/jsat/Traversal.jsm
+++ b/accessible/jsat/Traversal.jsm
@@ -377,17 +377,17 @@ this.TraversalHelper = {
     delete this.helperPivotCache;
     this.helperPivotCache = new WeakMap();
     return this.helperPivotCache;
   },
 
   getHelperPivot: function TraversalHelper_getHelperPivot(aRoot) {
     let pivot = this.helperPivotCache.get(aRoot.DOMNode);
     if (!pivot) {
-      pivot = Utils.AccRetrieval.createAccessiblePivot(aRoot);
+      pivot = Utils.AccService.createAccessiblePivot(aRoot);
       this.helperPivotCache.set(aRoot.DOMNode, pivot);
     }
 
     return pivot;
   },
 
   move: function TraversalHelper_move(aVirtualCursor, aMethod, aRule) {
     let rule = TraversalRules[aRule];
--- a/accessible/jsat/Utils.jsm
+++ b/accessible/jsat/Utils.jsm
@@ -64,23 +64,23 @@ this.Utils = { // jshint ignore:line
     let win = this.win;
     if (!win) {
       return null;
     }
     return win.QueryInterface(Ci.nsIInterfaceRequestor).getInterface(
       Ci.nsIDOMWindowUtils);
   },
 
-  get AccRetrieval() {
-    if (!this._AccRetrieval) {
-      this._AccRetrieval = Cc['@mozilla.org/accessibleRetrieval;1'].
-        getService(Ci.nsIAccessibleRetrieval);
+  get AccService() {
+    if (!this._AccService) {
+      this._AccService = Cc['@mozilla.org/accessibilityService;1'].
+        getService(Ci.nsIAccessibilityService);
     }
 
-    return this._AccRetrieval;
+    return this._AccService;
   },
 
   set MozBuildApp(value) {
     this._buildApp = value;
   },
 
   get MozBuildApp() {
     if (!this._buildApp) {
@@ -290,17 +290,17 @@ this.Utils = { // jshint ignore:line
       }
     }
 
     return attributes;
   },
 
   getVirtualCursor: function getVirtualCursor(aDocument) {
     let doc = (aDocument instanceof Ci.nsIAccessible) ? aDocument :
-      this.AccRetrieval.getAccessibleFor(aDocument);
+      this.AccService.getAccessibleFor(aDocument);
 
     return doc.QueryInterface(Ci.nsIAccessibleDocument).virtualCursor;
   },
 
   getContentResolution: function _getContentResolution(aAccessible) {
     let res = { value: 1 };
     aAccessible.document.window.QueryInterface(
       Ci.nsIInterfaceRequestor).getInterface(
@@ -534,17 +534,17 @@ function State(aBase, aExtended) {
   this.extended = aExtended;
 }
 
 State.prototype = {
   contains: function State_contains(other) {
     return !!(this.base & other.base || this.extended & other.extended);
   },
   toString: function State_toString() {
-    let stateStrings = Utils.AccRetrieval.
+    let stateStrings = Utils.AccService.
       getStringStates(this.base, this.extended);
     let statesArray = new Array(stateStrings.length);
     for (let i = 0; i < statesArray.length; i++) {
       statesArray[i] = stateStrings.item(i);
     }
     return '[' + statesArray.join(', ') + ']';
   }
 };
@@ -635,30 +635,30 @@ this.Logger = { // jshint ignore:line
   },
 
   accessibleToString: function accessibleToString(aAccessible) {
     if (!aAccessible) {
       return '[ null ]';
     }
 
     try {
-      return'[ ' + Utils.AccRetrieval.getStringRole(aAccessible.role) +
+      return'[ ' + Utils.AccService.getStringRole(aAccessible.role) +
         ' | ' + aAccessible.name + ' ]';
     } catch (x) {
       return '[ defunct ]';
     }
   },
 
   eventToString: function eventToString(aEvent) {
-    let str = Utils.AccRetrieval.getStringEventType(aEvent.eventType);
+    let str = Utils.AccService.getStringEventType(aEvent.eventType);
     if (aEvent.eventType == Events.STATE_CHANGE) {
       let event = aEvent.QueryInterface(Ci.nsIAccessibleStateChangeEvent);
       let stateStrings = event.isExtraState ?
-        Utils.AccRetrieval.getStringStates(0, event.state) :
-        Utils.AccRetrieval.getStringStates(event.state, 0);
+        Utils.AccService.getStringStates(0, event.state) :
+        Utils.AccService.getStringStates(event.state, 0);
       str += ' (' + stateStrings.item(0) + ')';
     }
 
     if (aEvent.eventType == Events.VIRTUALCURSOR_CHANGED) {
       let event = aEvent.QueryInterface(
         Ci.nsIAccessibleVirtualCursorChangeEvent);
       let pivot = aEvent.accessible.QueryInterface(
         Ci.nsIAccessibleDocument).virtualCursor;
@@ -882,17 +882,17 @@ PivotContext.prototype = {
   get interactionHints() {
     let hints = [];
     this.newAncestry.concat(this.accessible).reverse().forEach(aAccessible => {
       let hint = Utils.getAttributes(aAccessible)['moz-hint'];
       if (hint) {
         hints.push(hint);
       } else if (aAccessible.actionCount > 0) {
         hints.push({
-          string: Utils.AccRetrieval.getStringRole(
+          string: Utils.AccService.getStringRole(
             aAccessible.role).replace(/\s/g, '') + '-hint'
         });
       }
     });
     return hints;
   },
 
   /*
--- a/accessible/jsat/content-script.js
+++ b/accessible/jsat/content-script.js
@@ -116,17 +116,17 @@ addMessageListener(
 
     if (!eventManager) {
       eventManager = new EventManager(this, contentControl);
     }
     eventManager.inTest = m.json.inTest;
     eventManager.start();
 
     function contentStarted() {
-      let accDoc = Utils.AccRetrieval.getAccessibleFor(content.document);
+      let accDoc = Utils.AccService.getAccessibleFor(content.document);
       if (accDoc && !Utils.getState(accDoc).contains(States.BUSY)) {
         sendAsyncMessage('AccessFu:ContentStarted');
       } else {
         content.setTimeout(contentStarted, 0);
       }
     }
 
     if (m.json.inTest) {
--- a/accessible/tests/crashtests/448064.xhtml
+++ b/accessible/tests/crashtests/448064.xhtml
@@ -44,18 +44,18 @@ netscape.security.PrivilegeManager.enabl
 		}
 	} catch (e) {
 		dump("Error visiting child nodes: " + e + '\n');
 	}
 }
 
 function A(o) { 
   netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
-  var acc = Components.classes['@mozilla.org/accessibleRetrieval;1']
-                         .getService(Components.interfaces.nsIAccessibleRetrieval);
+  var acc = Components.classes['@mozilla.org/accessibilityService;1']
+                         .getService(Components.interfaces.nsIAccessibilityService);
   return acc.getAccessibleFor(o);
 }
 
 function beginAccessible() {
   netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
   dumpAccessibleTree(A(document),0);
 }
 setTimeout(beginAccessible, 100);
--- a/accessible/tests/crashtests/471493.xul
+++ b/accessible/tests/crashtests/471493.xul
@@ -4,25 +4,25 @@
 <window xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
         title="bug 471493 'crash [@ nsPropertyTable::GetPropertyInternal]'"
         onload="doTest();">
 
   <script type="application/javascript">
   <![CDATA[
     function doTest()
     {
-      var accRetrieval = SpecialPowers.Cc["@mozilla.org/accessibleRetrieval;1"].
-        getService(SpecialPowers.Ci.nsIAccessibleRetrieval);
+      var accService = SpecialPowers.Cc["@mozilla.org/accessibilityService;1"].
+        getService(SpecialPowers.Ci.nsIAccessibilityService);
 
       var treecol = document.getElementById("col");
       var x = treecol.boxObject.screenX;
       var y = treecol.boxObject.screenY;
 
       var tree = document.getElementById("tree");
-      var treeAcc = accRetrieval.getAccessibleFor(tree);
+      var treeAcc = accService.getAccessibleFor(tree);
       treeAcc.getChildAtPoint(x + 1, y + 1);
     }
   ]]>
   </script>
 
   <tree id="tree" flex="1">
     <treecols>
       <treecol id="col" flex="1" primary="true" label="column"/>
--- a/accessible/tests/mochitest/common.js
+++ b/accessible/tests/mochitest/common.js
@@ -1,12 +1,12 @@
 ////////////////////////////////////////////////////////////////////////////////
 // Interfaces
 
-const nsIAccessibleRetrieval = Components.interfaces.nsIAccessibleRetrieval;
+const nsIAccessibilityService = Components.interfaces.nsIAccessibilityService;
 
 const nsIAccessibleEvent = Components.interfaces.nsIAccessibleEvent;
 const nsIAccessibleStateChangeEvent =
   Components.interfaces.nsIAccessibleStateChangeEvent;
 const nsIAccessibleCaretMoveEvent =
   Components.interfaces.nsIAccessibleCaretMoveEvent;
 const nsIAccessibleTextChangeEvent =
   Components.interfaces.nsIAccessibleTextChangeEvent;
@@ -89,35 +89,35 @@ const kSquareBulletText = String.fromCha
 const MAX_TRIM_LENGTH = 100;
 
 /**
  * Services to determine if e10s is enabled.
  */
 Components.utils.import('resource://gre/modules/Services.jsm');
 
 /**
- * nsIAccessibleRetrieval service.
+ * nsIAccessibilityService service.
  */
-var gAccRetrieval = Components.classes["@mozilla.org/accessibleRetrieval;1"].
-  getService(nsIAccessibleRetrieval);
+var gAccService = Components.classes["@mozilla.org/accessibilityService;1"].
+  getService(nsIAccessibilityService);
 
 /**
  * Enable/disable logging.
  */
 function enableLogging(aModules)
 {
-  gAccRetrieval.setLogging(aModules);
+  gAccService.setLogging(aModules);
 }
 function disableLogging()
 {
-  gAccRetrieval.setLogging("");
+  gAccService.setLogging("");
 }
 function isLogged(aModule)
 {
-  return gAccRetrieval.isLogged(aModule);
+  return gAccService.isLogged(aModule);
 }
 
 /**
  * Dumps the accessible tree into console.
  */
 function dumpTree(aId, aMsg)
 {
   function dumpTreeIntl(acc, indent)
@@ -267,17 +267,17 @@ function getAccessible(aAccOrElmOrID, aI
   }
 
   if (aElmObj && (typeof aElmObj == "object"))
     aElmObj.value = elm;
 
   var acc = (aAccOrElmOrID instanceof nsIAccessible) ? aAccOrElmOrID : null;
   if (!acc) {
     try {
-      acc = gAccRetrieval.getAccessibleFor(elm);
+      acc = gAccService.getAccessibleFor(elm);
     } catch (e) {
     }
 
     if (!acc) {
       if (!(aDoNotFailIf & DONOTFAIL_IF_NO_ACC))
         ok(false, "Can't get accessible for " + prettyName(aAccOrElmOrID));
 
       return null;
@@ -358,17 +358,17 @@ function getTabDocAccessible(aAccOrElmOr
   return containerDocAcc.QueryInterface(nsIAccessible);
 }
 
 /**
  * Return application accessible.
  */
 function getApplicationAccessible()
 {
-  return gAccRetrieval.getApplicationAccessible().
+  return gAccService.getApplicationAccessible().
     QueryInterface(nsIAccessibleApplication);
 }
 
 /**
  * A version of accessible tree testing, doesn't fail if tree is not complete.
  */
 function testElm(aID, aTreeObj)
 {
@@ -579,17 +579,17 @@ function testAccessibleTree(aAccOrElmOrI
 }
 
 /**
  * Return true if accessible for the given node is in cache.
  */
 function isAccessibleInCache(aNodeOrId)
 {
   var node = getNode(aNodeOrId);
-  return gAccRetrieval.getAccessibleFromCache(node) ? true : false;
+  return gAccService.getAccessibleFromCache(node) ? true : false;
 }
 
 /**
  * Test accessible tree for defunct accessible.
  *
  * @param  aAcc       [in] the defunct accessible
  * @param  aNodeOrId  [in] the DOM node identifier for the defunct accessible
  */
@@ -666,50 +666,50 @@ function testDefunctAccessible(aAcc, aNo
   ok(success, "parent" + msg);
 }
 
 /**
  * Convert role to human readable string.
  */
 function roleToString(aRole)
 {
-  return gAccRetrieval.getStringRole(aRole);
+  return gAccService.getStringRole(aRole);
 }
 
 /**
  * Convert states to human readable string.
  */
 function statesToString(aStates, aExtraStates)
 {
-  var list = gAccRetrieval.getStringStates(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)
 {
-  return gAccRetrieval.getStringEventType(aEventType);
+  return gAccService.getStringEventType(aEventType);
 }
 
 /**
  * Convert relation type to human readable string.
  */
 function relationTypeToString(aRelationType)
 {
-  return gAccRetrieval.getStringRelationType(aRelationType);
+  return gAccService.getStringRelationType(aRelationType);
 }
 
 function getLoadContext() {
   const Ci = Components.interfaces;
   return window.QueryInterface(Ci.nsIInterfaceRequestor)
                .getInterface(Ci.nsIWebNavigation)
                .QueryInterface(Ci.nsILoadContext);
 }
--- a/accessible/tests/mochitest/events/docload_wnd.html
+++ b/accessible/tests/mochitest/events/docload_wnd.html
@@ -1,38 +1,38 @@
 <html>
 <head>
   <title>Accessible events testing for document</title>
   <script>
     const STATE_BUSY = Components.interfaces.nsIAccessibleStates.STATE_BUSY;
 
-    var gRetrieval = null;
+    var gService = null;
     function waitForDocLoad()
     {
-      if (!gRetrieval) {
-        gRetrieval = Components.classes["@mozilla.org/accessibleRetrieval;1"].
-         getService(Components.interfaces.nsIAccessibleRetrieval);
+      if (!gService) {
+        gService = Components.classes["@mozilla.org/accessibilityService;1"].
+         getService(Components.interfaces.nsIAccessibilityService);
       }
 
-      var accDoc = gRetrieval.getAccessibleFor(document);
+      var accDoc = gService.getAccessibleFor(document);
 
       var state = {};
       accDoc.getState(state, {});
       if (state.value & STATE_BUSY) {
         window.setTimeout(waitForDocLoad, 0);
         return;
       }
 
       hideIFrame();
     }
 
     function hideIFrame()
     {
       var iframe = document.getElementById("iframe");
-      gRetrieval.getAccessibleFor(iframe.contentDocument);
+      gService.getAccessibleFor(iframe.contentDocument);
       iframe.style.display = 'none';
     }
   </script>
 </head>
 
 <body onload="waitForDocLoad();">
   <iframe id="iframe"></iframe>
 </body>
--- a/accessible/tests/mochitest/events/test_docload.html
+++ b/accessible/tests/mochitest/events/test_docload.html
@@ -18,25 +18,25 @@
 
   <script type="application/javascript">
     // Front end stuff sometimes likes to stuff things in the hidden window(s)
     // in which case there's accessibles for that content.
     Components.utils.import("resource://gre/modules/Services.jsm");
 
     // Force the creation of an accessible for the hidden window's document.
     var doc = Services.appShell.hiddenDOMWindow.document;
-    gAccRetrieval.getAccessibleFor(doc);
+    gAccService.getAccessibleFor(doc);
 
     // The private hidden window will be lazily created that's why we need to do
     // it here *before* loading '../events.js' or else we'll have a duplicate
     // reorder event.
     var privateDoc = Services.appShell.hiddenPrivateDOMWindow.document;
 
     // Force the creation of an accessible for the private hidden window's doc.
-    gAccRetrieval.getAccessibleFor(privateDoc);
+    gAccService.getAccessibleFor(privateDoc);
   </script>
 
   <script type="application/javascript"
           src="../events.js"></script>
 
   <script type="application/javascript">
     ////////////////////////////////////////////////////////////////////////////
     // Invokers
--- a/accessible/tests/mochitest/pivot.js
+++ b/accessible/tests/mochitest/pivot.js
@@ -514,17 +514,17 @@ 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)
 {
-  this.pivot = gAccRetrieval.createAccessiblePivot(getAccessible(aRootNode));
+  this.pivot = gAccService.createAccessiblePivot(getAccessible(aRootNode));
   this.invoke = function removeVCRootInvoker_invoke()
   {
     this.pivot.position = this.pivot.root.firstChild;
     aRootNode.parentNode.removeChild(aRootNode);
   };
 
   this.getID = function removeVCRootInvoker_getID()
   {
--- a/accessible/tests/mochitest/states/z_frames_update.html
+++ b/accessible/tests/mochitest/states/z_frames_update.html
@@ -1,16 +1,16 @@
 <html>
 <head>
 <script>
 function replaceBody()
 {
-  var accRetrieval = Components.classes["@mozilla.org/accessibleRetrieval;1"].
-    getService(Components.interfaces.nsIAccessibleRetrieval);
-  accRetrieval.getAccessibleFor(document);
+  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);
   getComputedStyle(newBody, "").color;
 }
 </script>
--- a/layout/build/nsLayoutModule.cpp
+++ b/layout/build/nsLayoutModule.cpp
@@ -1325,17 +1325,16 @@ static const mozilla::Module::ContractID
   { GONK_GPS_GEOLOCATION_PROVIDER_CONTRACTID, &kGONK_GPS_GEOLOCATION_PROVIDER_CID },
 #endif
 #ifdef MOZ_GAMEPAD
   { NS_GAMEPAD_TEST_CONTRACTID, &kNS_GAMEPAD_TEST_CID },
 #endif
   { MEDIAMANAGERSERVICE_CONTRACTID, &kNS_MEDIAMANAGERSERVICE_CID },
 #ifdef ACCESSIBILITY
   { "@mozilla.org/accessibilityService;1", &kNS_ACCESSIBILITY_SERVICE_CID },
-  { "@mozilla.org/accessibleRetrieval;1", &kNS_ACCESSIBILITY_SERVICE_CID },
 #endif
   { TELEPHONY_SERVICE_CONTRACTID, &kTELEPHONY_SERVICE_CID },
   { TV_TUNER_DATA_CONTRACTID, &kTV_TUNER_DATA_CID },
   { TV_CHANNEL_DATA_CONTRACTID, &kTV_CHANNEL_DATA_CID },
   { TV_PROGRAM_DATA_CONTRACTID, &kTV_PROGRAM_DATA_CID },
   { "@mozilla.org/gecko-media-plugin-service;1",  &kGECKO_MEDIA_PLUGIN_SERVICE_CID },
   { NS_MOBILE_CONNECTION_SERVICE_CONTRACTID, &kNS_MOBILE_CONNECTION_SERVICE_CID },
   { NS_VOICEMAIL_SERVICE_CONTRACTID, &kNS_VOICEMAIL_SERVICE_CID },
--- a/testing/marionette/accessibility.js
+++ b/testing/marionette/accessibility.js
@@ -11,18 +11,18 @@ Cu.import("resource://gre/modules/Log.js
 
 Cu.import("chrome://marionette/content/error.js");
 
 XPCOMUtils.defineLazyModuleGetter(
     this, "setInterval", "resource://gre/modules/Timer.jsm");
 XPCOMUtils.defineLazyModuleGetter(
     this, "clearInterval", "resource://gre/modules/Timer.jsm");
 
-XPCOMUtils.defineLazyGetter(this, "retrieval",
-    () => Cc["@mozilla.org/accessibleRetrieval;1"].getService(Ci.nsIAccessibleRetrieval));
+XPCOMUtils.defineLazyGetter(this, "service",
+    () => Cc["@mozilla.org/accessibilityService;1"].getService(Ci.nsIAccessibilityService));
 
 this.EXPORTED_SYMBOLS = ["accessibility"];
 
 const logger = Log.repository.getLogger("Marionette");
 
 /**
  * Number of attempts to get an accessible object for an element.
  * We attempt more than once because accessible tree can be out of sync
@@ -112,17 +112,17 @@ accessibility.Checks = class {
    *     Flag indicating that the element must have an accessible object.
    *     Defaults to not require this.
    *
    * @return {nsIAccessible}
    *     Accessibility object for the given element.
    */
   getAccessible(element, mustHaveAccessible = false) {
     return new Promise((resolve, reject) => {
-      let acc = retrieval.getAccessibleFor(element);
+      let acc = service.getAccessibleFor(element);
 
       // if accessible object is found, return it;
       // if it is not required, also resolve
       if (acc || !mustHaveAccessible) {
         resolve(acc);
 
       // if we must have an accessible but are strict,
       // reject now and avoid polling for an accessible object
@@ -130,17 +130,17 @@ accessibility.Checks = class {
         reject();
 
       // if we require an accessible object, we need to poll for it
       // because accessible tree might be
       // out of sync with DOM tree for a short time
       } else {
         let attempts = GET_ACCESSIBLE_ATTEMPTS;
         let intervalId = setInterval(() => {
-          let acc = retrieval.getAccessibleFor(element);
+          let acc = service.getAccessibleFor(element);
           if (acc || --attempts <= 0) {
             clearInterval(intervalId);
             if (acc) {
               resolve(acc);
             } else {
               reject();
             }
           }
@@ -158,17 +158,17 @@ accessibility.Checks = class {
    *     Accessible object.
    *
    * @return {boolean}
    *     True if an actionable role is found on the accessible, false
    *     otherwise.
    */
   isActionableRole(accessible) {
     return accessibility.ActionableRoles.has(
-        retrieval.getStringRole(accessible.role));
+        service.getStringRole(accessible.role));
   }
 
   /**
    * Test if an accessible has at least one action that it supports.
    *
    * @param {nsIAccessible} accessible
    *     Accessible object.
    *
--- a/testing/talos/talos/tests/a11y/a11y.js
+++ b/testing/talos/talos/tests/a11y/a11y.js
@@ -1,28 +1,28 @@
-gAccRetrieval = 0;
+gAccService = 0;
 
 // Make sure not to touch Components before potentially invoking enablePrivilege,
 // because otherwise it won't be there.
 netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
 nsIAccessible = Components.interfaces.nsIAccessible;
 nsIDOMNode = Components.interfaces.nsIDOMNode;
 
 function initAccessibility()
 {
   netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
-  if (!gAccRetrieval) {
-    var retrieval = Components.classes["@mozilla.org/accessibleRetrieval;1"];
-    if (retrieval) { // fails if build lacks accessibility module
-      gAccRetrieval =
-      Components.classes["@mozilla.org/accessibleRetrieval;1"]
-                .getService(Components.interfaces.nsIAccessibleRetrieval);
+  if (!gAccService) {
+    var service = Components.classes["@mozilla.org/accessibilityService;1"];
+    if (service) { // fails if build lacks accessibility module
+      gAccService =
+      Components.classes["@mozilla.org/accessibilityService;1"]
+                .getService(Components.interfaces.nsIAccessibilityService);
     }
   }
-  return gAccRetrieval;
+  return gAccService;
 }
 
 function getAccessible(aAccOrElmOrID, aInterfaces)
 {
   if (!aAccOrElmOrID) {
     return null;
   }
 
@@ -36,17 +36,17 @@ function getAccessible(aAccOrElmOrID, aI
 
   } else {
     elm = document.getElementById(aAccOrElmOrID);
   }
 
   var acc = (aAccOrElmOrID instanceof nsIAccessible) ? aAccOrElmOrID : null;
   if (!acc) {
     try {
-      acc = gAccRetrieval.getAccessibleFor(elm);
+      acc = gAccService.getAccessibleFor(elm);
     } catch (e) {
     }
   }
 
   if (!aInterfaces) {
     return acc;
   }