bug 846185 - don't call into js when creating accessibles r=surkov, smaug
authorTrevor Saunders <trev.saunders@gmail.com>
Fri, 19 Jul 2013 00:13:35 -0400
changeset 145123 c7dcecd40428658706b3cd95a4bf61be3ff72078
parent 145122 ccec6887d0c4aca878ef6568788025ec6fc81a53
child 145124 c1b982500d3107013a693aeb0c7883de8cfe5ab4
push id1
push userroot
push dateMon, 20 Oct 2014 17:29:22 +0000
reviewerssurkov, smaug
bugs846185
milestone26.0a1
bug 846185 - don't call into js when creating accessibles r=surkov, smaug
accessible/public/moz.build
accessible/public/nsIAccessibleProvider.idl
accessible/src/base/Makefile.in
accessible/src/base/nsAccessibilityService.cpp
browser/base/content/pageinfo/pageInfo.xml
browser/metro/base/content/bindings/browser.xml
content/base/public/nsIContent.h
content/xbl/src/nsXBLBinding.h
content/xbl/src/nsXBLPrototypeBinding.cpp
content/xbl/src/nsXBLPrototypeBinding.h
content/xbl/src/nsXBLService.cpp
toolkit/content/widgets/autocomplete.xml
toolkit/content/widgets/browser.xml
toolkit/content/widgets/button.xml
toolkit/content/widgets/checkbox.xml
toolkit/content/widgets/colorpicker.xml
toolkit/content/widgets/editor.xml
toolkit/content/widgets/general.xml
toolkit/content/widgets/groupbox.xml
toolkit/content/widgets/listbox.xml
toolkit/content/widgets/menu.xml
toolkit/content/widgets/menulist.xml
toolkit/content/widgets/notification.xml
toolkit/content/widgets/popup.xml
toolkit/content/widgets/preferences.xml
toolkit/content/widgets/progressmeter.xml
toolkit/content/widgets/radio.xml
toolkit/content/widgets/remote-browser.xml
toolkit/content/widgets/scale.xml
toolkit/content/widgets/tabbox.xml
toolkit/content/widgets/text.xml
toolkit/content/widgets/textbox.xml
toolkit/content/widgets/toolbar.xml
toolkit/content/widgets/toolbarbutton.xml
toolkit/content/widgets/tree.xml
xpfe/components/autocomplete/resources/content/autocomplete.xml
--- a/accessible/public/moz.build
+++ b/accessible/public/moz.build
@@ -14,17 +14,16 @@ XPIDL_SOURCES += [
     'nsIAccessibleDocument.idl',
     'nsIAccessibleEditableText.idl',
     'nsIAccessibleEvent.idl',
     'nsIAccessibleHideEvent.idl',
     'nsIAccessibleHyperLink.idl',
     'nsIAccessibleHyperText.idl',
     'nsIAccessibleImage.idl',
     'nsIAccessiblePivot.idl',
-    'nsIAccessibleProvider.idl',
     'nsIAccessibleRelation.idl',
     'nsIAccessibleRetrieval.idl',
     'nsIAccessibleRole.idl',
     'nsIAccessibleSelectable.idl',
     'nsIAccessibleStateChangeEvent.idl',
     'nsIAccessibleStates.idl',
     'nsIAccessibleTable.idl',
     'nsIAccessibleTableChangeEvent.idl',
deleted file mode 100644
--- a/accessible/public/nsIAccessibleProvider.idl
+++ /dev/null
@@ -1,83 +0,0 @@
-/* -*- 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/. */
-
-#include "nsISupports.idl"
-
-/**
- * nsIAccessibleProvider interface is used to link element and accessible
-   object. For that XBL binding of element should implement the interface.
- */
-
-[scriptable, uuid(f7e531b6-bc29-4d3d-8c91-60fc2b71eb40)]
-interface nsIAccessibleProvider : nsISupports
-{
-  /**
-   * Constants set of common use.
-   */
-
-  /** Do not create an accessible for this object
-   * This is useful if an ancestor binding already implements nsIAccessibleProvider,
-   * but no accessible is desired for the inheriting binding
-   */
-  const long NoAccessible = 0;
-
-  /** For elements that spawn a new document. For example now it is used by
-    <xul:iframe>, <xul:browser> and <xul:editor>. */
-  const long OuterDoc = 0x00000001;
-
-  /**
-   * Constants set is used by XUL controls.
-   */
-
-  const long XULAlert = 0x00001001;
-  const long XULButton = 0x00001002;
-  const long XULCheckbox = 0x00001003;
-  const long XULColorPicker = 0x00001004;
-  const long XULColorPickerTile = 0x00001005;
-  const long XULCombobox = 0x00001006;
-  const long XULDropmarker = 0x00001007;
-  const long XULGroupbox = 0x00001008;
-  const long XULImage = 0x00001009;
-  const long XULLink = 0x0000100A;
-  const long XULListbox = 0x0000100B;
-  const long XULListCell = 0x00001026;
-  const long XULListHead = 0x00001024;
-  const long XULListHeader = 0x00001025;
-  const long XULListitem = 0x0000100C;
-  const long XULMenubar = 0x0000100D;
-  const long XULMenuitem = 0x0000100E;
-  const long XULMenupopup = 0x0000100F;
-  const long XULMenuSeparator = 0x00001010;
-  const long XULPane    = 0x00001011;
-  const long XULProgressMeter = 0x00001012;
-  const long XULScale = 0x00001013;
-  const long XULStatusBar = 0x00001014;
-  const long XULRadioButton = 0x00001015;
-  const long XULRadioGroup = 0x00001016;
-
-  /** Used for XUL tab element */
-  const long XULTab = 0x00001017;
-  /** Used for XUL tabs element, a container for tab elements */
-  const long XULTabs = 0x00001018;
-  /** Used for XUL tabpanels element */
-  const long XULTabpanels = 0x00001019;
-
-  const long XULText             = 0x0000101A;
-  const long XULTextBox          = 0x0000101B;
-  const long XULThumb            = 0x0000101C;
-  const long XULTree             = 0x0000101D;
-  const long XULTreeColumns      = 0x0000101E;
-  const long XULTreeColumnItem   = 0x0000101F;
-  const long XULToolbar          = 0x00001020;
-  const long XULToolbarSeparator = 0x00001021;
-  const long XULTooltip          = 0x00001022;
-  const long XULToolbarButton    = 0x00001023;
-
-  /**
-   * Return one of constants declared above.
-   */
-  readonly attribute long accessibleType;
-};
--- a/accessible/src/base/Makefile.in
+++ b/accessible/src/base/Makefile.in
@@ -12,16 +12,17 @@ include $(DEPTH)/config/autoconf.mk
 include $(topsrcdir)/config/rules.mk
 
 LOCAL_INCLUDES += \
   -I$(srcdir) \
   -I$(srcdir)/../generic \
   -I$(srcdir)/../html \
   -I$(srcdir)/../xpcom \
   -I$(srcdir)/../xul \
+  -I$(srcdir)/../../../content/xbl/src \
   -I$(srcdir)/../../../layout/generic \
   -I$(srcdir)/../../../layout/style \
   -I$(srcdir)/../../../layout/svg \
   -I$(srcdir)/../../../layout/xul/base/src \
   -I$(srcdir)/../../../layout/xul/tree/ \
   -I$(srcdir)/../../../ipc/chromium/src \
   $(NULL)
 
--- a/accessible/src/base/nsAccessibilityService.cpp
+++ b/accessible/src/base/nsAccessibilityService.cpp
@@ -18,17 +18,16 @@
 #include "HTMLLinkAccessible.h"
 #include "HTMLListAccessible.h"
 #include "HTMLSelectAccessible.h"
 #include "HTMLTableAccessibleWrap.h"
 #include "HyperTextAccessibleWrap.h"
 #include "nsAccessiblePivot.h"
 #include "nsAccUtils.h"
 #include "nsEventShell.h"
-#include "nsIAccessibleProvider.h"
 #include "OuterDocAccessible.h"
 #include "Platform.h"
 #include "Role.h"
 #include "RootAccessibleWrap.h"
 #include "States.h"
 #include "Statistics.h"
 #include "TextLeafAccessibleWrap.h"
 
@@ -56,16 +55,19 @@
 #include "nsIObserverService.h"
 #include "nsLayoutUtils.h"
 #include "nsNPAPIPluginInstance.h"
 #include "nsObjectFrame.h"
 #include "nsSVGPathGeometryFrame.h"
 #include "nsTreeBodyFrame.h"
 #include "nsTreeColumns.h"
 #include "nsTreeUtils.h"
+#include "nsBindingManager.h"
+#include "nsXBLPrototypeBinding.h"
+#include "nsXBLBinding.h"
 #include "mozilla/dom/Element.h"
 #include "mozilla/Preferences.h"
 #include "mozilla/Services.h"
 #include "mozilla/StaticPtr.h"
 #include "mozilla/Util.h"
 #include "nsDeckFrame.h"
 
 #ifdef MOZ_XUL
@@ -1132,215 +1134,198 @@ nsAccessibilityService::Shutdown()
   NS_RELEASE(gApplicationAccessible);
   gApplicationAccessible = nullptr;
 }
 
 already_AddRefed<Accessible>
 nsAccessibilityService::CreateAccessibleByType(nsIContent* aContent,
                                                DocAccessible* aDoc)
 {
-  nsCOMPtr<nsIAccessibleProvider> accessibleProvider(do_QueryInterface(aContent));
-  if (!accessibleProvider)
+  nsAutoString role;
+  for (const nsXBLBinding* binding = aContent->GetXBLBinding(); binding; binding = binding->GetBaseBinding()) {
+    nsIContent* bindingElm = binding->PrototypeBinding()->GetBindingElement();
+    bindingElm->GetAttr(kNameSpaceID_None, nsGkAtoms::role, role);
+    if (!role.IsEmpty())
+      break;
+  }
+
+  if (role.IsEmpty() || role.EqualsLiteral("none"))
     return nullptr;
 
-  int32_t type;
-  nsresult rv = accessibleProvider->GetAccessibleType(&type);
-  if (NS_FAILED(rv))
-    return nullptr;
-
-  if (type == nsIAccessibleProvider::OuterDoc) {
+  if (role.EqualsLiteral("outerdoc")) {
     nsRefPtr<Accessible> accessible = new OuterDocAccessible(aContent, aDoc);
     return accessible.forget();
   }
-
+ 
   nsRefPtr<Accessible> accessible;
-  switch (type)
-  {
 #ifdef MOZ_XUL
-    case nsIAccessibleProvider::NoAccessible:
-      return nullptr;
+  // XUL controls
+  if (role.EqualsLiteral("xul:alert")) {
+    accessible = new XULAlertAccessible(aContent, aDoc);
 
-    // XUL controls
-    case nsIAccessibleProvider::XULAlert:
-      accessible = new XULAlertAccessible(aContent, aDoc);
-      break;
+  } else if (role.EqualsLiteral("xul:button")) {
+    accessible = new XULButtonAccessible(aContent, aDoc);
 
-    case nsIAccessibleProvider::XULButton:
-      accessible = new XULButtonAccessible(aContent, aDoc);
-      break;
+  } else if (role.EqualsLiteral("xul:checkbox")) {
+    accessible = new XULCheckboxAccessible(aContent, aDoc);
 
-    case nsIAccessibleProvider::XULCheckbox:
-      accessible = new XULCheckboxAccessible(aContent, aDoc);
-      break;
+  } else if (role.EqualsLiteral("xul:colorpicker")) {
+    accessible = new XULColorPickerAccessible(aContent, aDoc);
 
-    case nsIAccessibleProvider::XULColorPicker:
-      accessible = new XULColorPickerAccessible(aContent, aDoc);
-      break;
+  } else if (role.EqualsLiteral("xul:colorpickertile")) {
+    accessible = new XULColorPickerTileAccessible(aContent, aDoc);
 
-    case nsIAccessibleProvider::XULColorPickerTile:
-      accessible = new XULColorPickerTileAccessible(aContent, aDoc);
-      break;
+  } else if (role.EqualsLiteral("xul:combobox")) {
+    accessible = new XULComboboxAccessible(aContent, aDoc);
 
-    case nsIAccessibleProvider::XULCombobox:
-      accessible = new XULComboboxAccessible(aContent, aDoc);
-      break;
+  } else if (role.EqualsLiteral("xul:tabpanels")) {
+      accessible = new XULTabpanelsAccessible(aContent, aDoc);
 
-    case nsIAccessibleProvider::XULTabpanels:
-      accessible = new XULTabpanelsAccessible(aContent, aDoc);
-      break;
-
-    case nsIAccessibleProvider::XULDropmarker:
+  } else if (role.EqualsLiteral("xul:dropmarker")) {
       accessible = new XULDropmarkerAccessible(aContent, aDoc);
-      break;
 
-    case nsIAccessibleProvider::XULGroupbox:
+  } else if (role.EqualsLiteral("xul:groupbox")) {
       accessible = new XULGroupboxAccessible(aContent, aDoc);
-      break;
 
-    case nsIAccessibleProvider::XULImage:
-    {
+  } else if (role.EqualsLiteral("xul:image")) {
+    if (aContent->HasAttr(kNameSpaceID_None, nsGkAtoms::onclick)) {
+      accessible = new XULToolbarButtonAccessible(aContent, aDoc);
+
+    } else {
       // Don't include nameless images in accessible tree.
       if (!aContent->HasAttr(kNameSpaceID_None,
                              nsGkAtoms::tooltiptext))
         return nullptr;
 
       accessible = new ImageAccessibleWrap(aContent, aDoc);
-      break;
+    }
 
-    }
-    case nsIAccessibleProvider::XULLink:
-      accessible = new XULLinkAccessible(aContent, aDoc);
-      break;
+  } else if (role.EqualsLiteral("xul:link")) {
+    accessible = new XULLinkAccessible(aContent, aDoc);
 
-    case nsIAccessibleProvider::XULListbox:
+  } else if (role.EqualsLiteral("xul:listbox")) {
       accessible = new XULListboxAccessibleWrap(aContent, aDoc);
-      break;
 
-    case nsIAccessibleProvider::XULListCell:
-      accessible = new XULListCellAccessibleWrap(aContent, aDoc);
-      break;
+  } else if (role.EqualsLiteral("xul:listcell")) {
+    // Only create cells if there's more than one per row.
+    nsIContent* listItem = aContent->GetParent();
+    if (!listItem)
+      return nullptr;
 
-    case nsIAccessibleProvider::XULListHead:
-      accessible = new XULColumAccessible(aContent, aDoc);
-      break;
-
-    case nsIAccessibleProvider::XULListHeader:
-      accessible = new XULColumnItemAccessible(aContent, aDoc);
-      break;
+    for (nsIContent* child = listItem->GetFirstChild(); child;
+         child = child->GetNextSibling()) {
+      if (child->IsXUL(nsGkAtoms::listcell) && child != aContent) {
+        accessible = new XULListCellAccessibleWrap(aContent, aDoc);
+        break;
+      }
+    }
 
-    case nsIAccessibleProvider::XULListitem:
-      accessible = new XULListitemAccessible(aContent, aDoc);
-      break;
+  } else if (role.EqualsLiteral("xul:listhead")) {
+    accessible = new XULColumAccessible(aContent, aDoc);
 
-    case nsIAccessibleProvider::XULMenubar:
-      accessible = new XULMenubarAccessible(aContent, aDoc);
-      break;
+  } else if (role.EqualsLiteral("xul:listheader")) {
+    accessible = new XULColumnItemAccessible(aContent, aDoc);
 
-    case nsIAccessibleProvider::XULMenuitem:
-      accessible = new XULMenuitemAccessibleWrap(aContent, aDoc);
-      break;
+  } else if (role.EqualsLiteral("xul:listitem")) {
+    accessible = new XULListitemAccessible(aContent, aDoc);
+
+  } else if (role.EqualsLiteral("xul:menubar")) {
+    accessible = new XULMenubarAccessible(aContent, aDoc);
 
-    case nsIAccessibleProvider::XULMenupopup:
-    {
+  } else if (role.EqualsLiteral("xul:menulist")) {
+      if (aContent->AttrValueIs(kNameSpaceID_None, nsGkAtoms::droppable,
+                                nsGkAtoms::_false, eCaseMatters))
+      accessible = new XULTextFieldAccessible(aContent, aDoc);
+      else
+      accessible = new XULComboboxAccessible(aContent, aDoc);
+
+  } else if (role.EqualsLiteral("xul:menuitem")) {
+    accessible = new XULMenuitemAccessibleWrap(aContent, aDoc);
+
+  } else if (role.EqualsLiteral("xul:menupopup")) {
 #ifdef MOZ_ACCESSIBILITY_ATK
-      // ATK considers this node to be redundant when within menubars, and it makes menu
-      // navigation with assistive technologies more difficult
-      // XXX In the future we will should this for consistency across the nsIAccessible
-      // implementations on each platform for a consistent scripting environment, but
-      // then strip out redundant accessibles in the AccessibleWrap class for each platform.
-      nsIContent *parent = aContent->GetParent();
-      if (parent && parent->NodeInfo()->Equals(nsGkAtoms::menu,
-                                               kNameSpaceID_XUL))
-        return nullptr;
+    // ATK considers this node to be redundant when within menubars, and it makes menu
+    // navigation with assistive technologies more difficult
+    // XXX In the future we will should this for consistency across the nsIAccessible
+    // implementations on each platform for a consistent scripting environment, but
+    // then strip out redundant accessibles in the AccessibleWrap class for each platform.
+    nsIContent *parent = aContent->GetParent();
+    if (parent && parent->IsXUL() && parent->Tag() == nsGkAtoms::menu)
+      return nullptr;
 #endif
-      accessible = new XULMenupopupAccessible(aContent, aDoc);
-      break;
 
-    }
-    case nsIAccessibleProvider::XULMenuSeparator:
-      accessible = new XULMenuSeparatorAccessible(aContent, aDoc);
-      break;
+    accessible = new XULMenupopupAccessible(aContent, aDoc);
 
-    case nsIAccessibleProvider::XULPane:
-      accessible = new EnumRoleAccessible(aContent, aDoc, roles::PANE);
-      break;
-
-    case nsIAccessibleProvider::XULProgressMeter:
-      accessible = new XULProgressMeterAccessible(aContent, aDoc);
-      break;
+  } else if(role.EqualsLiteral("xul:menuseparator")) {
+    accessible = new XULMenuSeparatorAccessible(aContent, aDoc);
 
-    case nsIAccessibleProvider::XULStatusBar:
-      accessible = new XULStatusBarAccessible(aContent, aDoc);
-      break;
-
-    case nsIAccessibleProvider::XULScale:
-      accessible = new XULSliderAccessible(aContent, aDoc);
-      break;
+  } else if(role.EqualsLiteral("xul:pane")) {
+    accessible = new EnumRoleAccessible(aContent, aDoc, roles::PANE);
 
-    case nsIAccessibleProvider::XULRadioButton:
-      accessible = new XULRadioButtonAccessible(aContent, aDoc);
-      break;
+  } else if (role.EqualsLiteral("xul:panel")) {
+    if (aContent->AttrValueIs(kNameSpaceID_None, nsGkAtoms::noautofocus,
+                              nsGkAtoms::_true, eCaseMatters))
+      accessible = new XULAlertAccessible(aContent, aDoc);
+    else
+      accessible = new EnumRoleAccessible(aContent, aDoc, roles::PANE);
 
-    case nsIAccessibleProvider::XULRadioGroup:
-      accessible = new XULRadioGroupAccessible(aContent, aDoc);
-      break;
+  } else if (role.EqualsLiteral("xul:progressmeter")) {
+    accessible = new XULProgressMeterAccessible(aContent, aDoc);
 
-    case nsIAccessibleProvider::XULTab:
-      accessible = new XULTabAccessible(aContent, aDoc);
-      break;
+  } else if (role.EqualsLiteral("xulstatusbar")) {
+    accessible = new XULStatusBarAccessible(aContent, aDoc);
 
-    case nsIAccessibleProvider::XULTabs:
-      accessible = new XULTabsAccessible(aContent, aDoc);
-      break;
+  } else if (role.EqualsLiteral("xul:scale")) {
+    accessible = new XULSliderAccessible(aContent, aDoc);
+
+  } else if (role.EqualsLiteral("xul:radiobutton")) {
+    accessible = new XULRadioButtonAccessible(aContent, aDoc);
 
-    case nsIAccessibleProvider::XULText:
-      accessible = new XULLabelAccessible(aContent, aDoc);
-      break;
+  } else if (role.EqualsLiteral("xul:radiogroup")) {
+    accessible = new XULRadioGroupAccessible(aContent, aDoc);
 
-    case nsIAccessibleProvider::XULTextBox:
-      accessible = new XULTextFieldAccessible(aContent, aDoc);
-      break;
+  } else if (role.EqualsLiteral("xul:tab")) {
+    accessible = new XULTabAccessible(aContent, aDoc);
+
+  } else if (role.EqualsLiteral("xul:tabs")) {
+    accessible = new XULTabsAccessible(aContent, aDoc);
 
-    case nsIAccessibleProvider::XULThumb:
-      accessible = new XULThumbAccessible(aContent, aDoc);
-      break;
+  } else if (role.EqualsLiteral("xul:text")) {
+    accessible = new XULLabelAccessible(aContent, aDoc);
 
-    case nsIAccessibleProvider::XULTree:
-      return CreateAccessibleForXULTree(aContent, aDoc);
+  } else if (role.EqualsLiteral("xul:textbox")) {
+    accessible = new XULTextFieldAccessible(aContent, aDoc);
 
-    case nsIAccessibleProvider::XULTreeColumns:
-      accessible = new XULTreeColumAccessible(aContent, aDoc);
-      break;
+  } else if (role.EqualsLiteral("xul:thumb")) {
+    accessible = new XULThumbAccessible(aContent, aDoc);
 
-    case nsIAccessibleProvider::XULTreeColumnItem:
-      accessible = new XULColumnItemAccessible(aContent, aDoc);
-      break;
+  } else if (role.EqualsLiteral("xul:tree")) {
+    accessible = CreateAccessibleForXULTree(aContent, aDoc);
+
+  } else if (role.EqualsLiteral("xul:treecolumns")) {
+    accessible = new XULTreeColumAccessible(aContent, aDoc);
 
-    case nsIAccessibleProvider::XULToolbar:
-      accessible = new XULToolbarAccessible(aContent, aDoc);
-      break;
+  } else if (role.EqualsLiteral("xul:treecolumnitem")) {
+    accessible = new XULColumnItemAccessible(aContent, aDoc);
 
-    case nsIAccessibleProvider::XULToolbarSeparator:
-      accessible = new XULToolbarSeparatorAccessible(aContent, aDoc);
-      break;
+  } else if (role.EqualsLiteral("xul:toolbar")) {
+    accessible = new XULToolbarAccessible(aContent, aDoc);
+
+  } else if (role.EqualsLiteral("xul:toolbarseparator")) {
+    accessible = new XULToolbarSeparatorAccessible(aContent, aDoc);
 
-    case nsIAccessibleProvider::XULTooltip:
-      accessible = new XULTooltipAccessible(aContent, aDoc);
-      break;
+  } else if (role.EqualsLiteral("xul:tooltip")) {
+    accessible = new XULTooltipAccessible(aContent, aDoc);
 
-    case nsIAccessibleProvider::XULToolbarButton:
-      accessible = new XULToolbarButtonAccessible(aContent, aDoc);
-      break;
+  } else if (role.EqualsLiteral("xul:toolbarbutton")) {
+    accessible = new XULToolbarButtonAccessible(aContent, aDoc);
 
+  }
 #endif // MOZ_XUL
 
-    default:
-      return nullptr;
-  }
-
   return accessible.forget();
 }
 
 already_AddRefed<Accessible>
 nsAccessibilityService::CreateHTMLAccessibleByMarkup(nsIFrame* aFrame,
                                                      nsIContent* aContent,
                                                      Accessible* aContext)
 {
--- a/browser/base/content/pageinfo/pageInfo.xml
+++ b/browser/base/content/pageinfo/pageInfo.xml
@@ -5,25 +5,16 @@
 
 
 <bindings id="pageInfoBindings"
           xmlns="http://www.mozilla.org/xbl"
           xmlns:xul="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
           xmlns:xbl="http://www.mozilla.org/xbl">
 
   <!-- based on preferences.xml paneButton -->
-  <binding id="viewbutton" extends="chrome://global/content/bindings/radio.xml#radio">
+  <binding id="viewbutton" extends="chrome://global/content/bindings/radio.xml#radio" role="xullistitem">
     <content>
       <xul:image class="viewButtonIcon" xbl:inherits="src"/>
       <xul:label class="viewButtonLabel" xbl:inherits="value=label"/>
     </content>
-    <implementation implements="nsIAccessibleProvider">
-      <property name="accessibleType" readonly="true">
-        <getter>
-          <![CDATA[
-            return Components.interfaces.nsIAccessibleProvider.XULListitem;
-          ]]>
-        </getter>
-      </property>
-    </implementation>
   </binding>
 
 </bindings>
--- a/browser/metro/base/content/bindings/browser.xml
+++ b/browser/metro/base/content/bindings/browser.xml
@@ -10,17 +10,17 @@
 ]>
 
 <bindings id="browser-bindings"
           xmlns="http://www.mozilla.org/xbl"
           xmlns:xul="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
 
   <binding id="local-browser" extends="chrome://global/content/bindings/browser.xml#browser">
     <implementation type="application/javascript"
-      implements="nsIAccessibleProvider, nsIObserver, nsIDOMEventListener, nsIMessageListener">
+      implements="nsIObserver, nsIDOMEventListener, nsIMessageListener">
 
       <constructor>
         <![CDATA[
           this._frameLoader =
             this.QueryInterface(Components.interfaces.nsIFrameLoaderOwner).frameLoader;
           this._contentViewManager =
             this._frameLoader.QueryInterface(Components.interfaces.nsIContentViewManager);
 
@@ -777,25 +777,17 @@
           return;
         ]]></body>
       </method>
 
     </implementation>
   </binding>
 
   <binding id="remote-browser" extends="#local-browser">
-    <implementation type="application/javascript" implements="nsIAccessibleProvider, nsIObserver, nsIDOMEventListener, nsIMessageListener">
-      <property name="accessibleType" readonly="true">
-        <getter>
-          <![CDATA[
-            throw "accessibleType: Supports Remote?";
-          ]]>
-        </getter>
-      </property>
-
+    <implementation type="application/javascript" implements="nsIObserver, nsIDOMEventListener, nsIMessageListener">
       <property name="autoscrollEnabled">
         <getter>
           <![CDATA[
             throw "autoscrollEnabled: Supports Remote?";
           ]]>
         </getter>
       </property>
 
--- a/content/base/public/nsIContent.h
+++ b/content/base/public/nsIContent.h
@@ -291,16 +291,21 @@ public:
     return mNodeInfo->Equals(aTag, kNameSpaceID_SVG);
   }
 
   inline bool IsXUL() const
   {
     return IsInNamespace(kNameSpaceID_XUL);
   }
 
+  inline bool IsXUL(nsIAtom* aTag) const
+  {
+    return mNodeInfo->Equals(aTag, kNameSpaceID_XUL);
+  }
+
   inline bool IsMathML() const
   {
     return IsInNamespace(kNameSpaceID_MathML);
   }
 
   inline bool IsMathML(nsIAtom* aTag) const
   {
     return mNodeInfo->Equals(aTag, kNameSpaceID_MathML);
--- a/content/xbl/src/nsXBLBinding.h
+++ b/content/xbl/src/nsXBLBinding.h
@@ -52,21 +52,21 @@ public:
    * 3. The binding manager holds an additional reference to bindings
    *    which are queued to fire their constructors.
    */
 
   NS_INLINE_DECL_CYCLE_COLLECTING_NATIVE_REFCOUNTING(nsXBLBinding)
 
   NS_DECL_CYCLE_COLLECTION_NATIVE_CLASS(nsXBLBinding)
 
-  nsXBLPrototypeBinding* PrototypeBinding() { return mPrototypeBinding; }
+  nsXBLPrototypeBinding* PrototypeBinding() const { return mPrototypeBinding; }
   nsIContent* GetAnonymousContent() { return mContent.get(); }
   nsXBLBinding* GetBindingWithContent();
 
-  nsXBLBinding* GetBaseBinding() { return mNextBinding; }
+  nsXBLBinding* GetBaseBinding() const { return mNextBinding; }
   void SetBaseBinding(nsXBLBinding *aBinding);
 
   nsIContent* GetBoundElement() { return mBoundElement; }
   void SetBoundElement(nsIContent *aElement);
 
   void SetJSClass(nsXBLJSClass *aClass) {
     MOZ_ASSERT(!mJSClass && aClass);
     mJSClass = aClass;
--- a/content/xbl/src/nsXBLPrototypeBinding.cpp
+++ b/content/xbl/src/nsXBLPrototypeBinding.cpp
@@ -196,23 +196,16 @@ nsXBLPrototypeBinding::SetBasePrototype(
   if (mBaseBinding) {
     NS_ERROR("Base XBL prototype binding is already defined!");
     return;
   }
 
   mBaseBinding = aBinding;
 }
 
-already_AddRefed<nsIContent>
-nsXBLPrototypeBinding::GetBindingElement()
-{
-  nsCOMPtr<nsIContent> result = mBinding;
-  return result.forget();
-}
-
 void
 nsXBLPrototypeBinding::SetBindingElement(nsIContent* aElement)
 {
   mBinding = aElement;
   if (mBinding->AttrValueIs(kNameSpaceID_None, nsGkAtoms::inheritstyle,
                             nsGkAtoms::_false, eCaseMatters))
     mInheritStyle = false;
 
--- a/content/xbl/src/nsXBLPrototypeBinding.h
+++ b/content/xbl/src/nsXBLPrototypeBinding.h
@@ -31,17 +31,17 @@ class nsCSSStyleSheet;
 // The XBLPrototypeBinding class
 
 // Instances of this class are owned by the nsXBLDocumentInfo object returned
 // by XBLDocumentInfo().  Consumers who want to refcount things should refcount
 // that.
 class nsXBLPrototypeBinding
 {
 public:
-  already_AddRefed<nsIContent> GetBindingElement();
+  nsIContent* GetBindingElement() const { return mBinding; }
   void SetBindingElement(nsIContent* aElement);
 
   nsIURI* BindingURI() const { return mBindingURI; }
   nsIURI* AlternateBindingURI() const { return mAlternateBindingURI; }
   nsIURI* DocURI() const { return mXBLDocInfoWeak->DocumentURI(); }
   nsIURI* GetBaseBindingURI() const { return mBaseBindingURI; }
 
   // Checks if aURI refers to this binding by comparing to both possible
--- a/content/xbl/src/nsXBLService.cpp
+++ b/content/xbl/src/nsXBLService.cpp
@@ -771,17 +771,17 @@ nsXBLService::GetBinding(nsIContent* aBo
           return NS_ERROR_ILLEGAL_VALUE;
         }
       }
     }
   }
 
   nsRefPtr<nsXBLBinding> baseBinding;
   if (baseBindingURI) {
-    nsCOMPtr<nsIContent> child = protoBinding->GetBindingElement();
+    nsIContent* child = protoBinding->GetBindingElement();
     rv = GetBinding(aBoundElement, baseBindingURI, aPeekOnly,
                     child->NodePrincipal(), aIsReady,
                     getter_AddRefs(baseBinding), aDontExtendURIs);
     if (NS_FAILED(rv))
       return rv; // We aren't ready yet.
   }
 
   *aIsReady = true;
--- a/toolkit/content/widgets/autocomplete.xml
+++ b/toolkit/content/widgets/autocomplete.xml
@@ -11,17 +11,17 @@
 ]>
 
 <bindings id="autocompleteBindings"
           xmlns="http://www.mozilla.org/xbl"
           xmlns:html="http://www.w3.org/1999/xhtml"
           xmlns:xul="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
           xmlns:xbl="http://www.mozilla.org/xbl">
 
-  <binding id="autocomplete"
+  <binding id="autocomplete" role="xul:combobox"
            extends="chrome://global/content/bindings/textbox.xml#textbox">
     <resources>
       <stylesheet src="chrome://global/skin/autocomplete.css"/>
     </resources>
 
     <content sizetopopup="pref">
       <xul:hbox class="autocomplete-textbox-container" flex="1" xbl:inherits="focused">
         <children includes="image|deck|stack|box">
@@ -41,17 +41,17 @@
                       allowevents="true"
                       xbl:inherits="open,enablehistory,parentfocused=focused"/>
 
       <xul:popupset anonid="popupset" class="autocomplete-result-popupset"/>
 
       <children includes="toolbarbutton"/>
     </content>
 
-    <implementation implements="nsIAccessibleProvider, nsIAutoCompleteInput, nsIDOMXULMenuListElement">
+    <implementation implements="nsIAutoCompleteInput, nsIDOMXULMenuListElement">
       <field name="mController">null</field>
       <field name="mSearchNames">null</field>
       <field name="mIgnoreInput">false</field>
       <field name="mEnterEvent">null</field>
 
       <field name="_searchBeginHandler">null</field>
       <field name="_searchCompleteHandler">null</field>
       <field name="_textEnteredHandler">null</field>
@@ -69,27 +69,16 @@
         // For security reasons delay searches on pasted values.
         this.inputField.controllers.insertControllerAt(0, this._pasteController);
       ]]></constructor>
 
       <destructor><![CDATA[
         this.inputField.controllers.removeController(this._pasteController);
       ]]></destructor>
 
-      <!-- =================== nsIAccessibleProvider =================== -->
-
-      <property name="accessibleType" readonly="true">
-        <getter>
-          <![CDATA[
-            // Will be exposed as nsIAccessible::ROLE_AUTOCOMPLETE
-            return Components.interfaces.nsIAccessibleProvider.XULCombobox;
-          ]]>
-        </getter>
-      </property>
-
       <!-- =================== nsIAutoCompleteInput =================== -->
 
       <field name="popup"><![CDATA[
         // Wrap in a block so that the let statements don't
         // create properties on 'this' (bug 635252).
         {
           let popup = null;
           let popupId = this.getAttribute("autocompletepopup");
@@ -811,22 +800,19 @@
           bx = bx.QueryInterface(Components.interfaces.nsITreeBoxObject);
           bx.view = val;
         ]]></setter>
       </property>
 
     </implementation>
   </binding>
 
-  <binding id="autocomplete-base-popup" extends="chrome://global/content/bindings/popup.xml#popup">
+  <binding id="autocomplete-base-popup" role="none"
+extends="chrome://global/content/bindings/popup.xml#popup">
     <implementation implements="nsIAutoCompletePopup">
-      <!-- nsIAccessible from #popup -->
-      <property name="accessibleType" readonly="true"
-                onget="return Components.interfaces.nsIAccessibleProvider.NoAccessible;"/>
-
       <field name="mInput">null</field>
       <field name="mPopupOpen">false</field>
 
       <!-- =================== nsIAutoCompletePopup =================== -->
 
       <property name="input" readonly="true"
                 onget="return this.mInput"/>
 
--- a/toolkit/content/widgets/browser.xml
+++ b/toolkit/content/widgets/browser.xml
@@ -8,29 +8,21 @@
   <!ENTITY % findBarDTD SYSTEM "chrome://global/locale/findbar.dtd" >
   %findBarDTD;
 ]>
 
 <bindings id="browserBindings"
           xmlns="http://www.mozilla.org/xbl"
           xmlns:xul="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
 
-  <binding id="browser" extends="xul:browser">
+  <binding id="browser" extends="xul:browser" role="outerdoc">
     <content clickthrough="never">
       <children/>
     </content>
-    <implementation type="application/javascript" implements="nsIAccessibleProvider, nsIObserver, nsIDOMEventListener, nsIFrameRequestCallback">
-      <property name="accessibleType" readonly="true">
-        <getter>
-          <![CDATA[
-            return Components.interfaces.nsIAccessibleProvider.OuterDoc;
-          ]]>
-        </getter>
-      </property>
-
+    <implementation type="application/javascript" implements="nsIObserver, nsIDOMEventListener, nsIFrameRequestCallback">
       <property name="autoscrollEnabled">
         <getter>
           <![CDATA[
             if (this.getAttribute("autoscroll") == "false")
               return false;
 
             var enabled = true;
             try {
--- a/toolkit/content/widgets/button.xml
+++ b/toolkit/content/widgets/button.xml
@@ -4,26 +4,18 @@
    - file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
 
 
 <bindings id="buttonBindings"
    xmlns="http://www.mozilla.org/xbl"
    xmlns:xul="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
    xmlns:xbl="http://www.mozilla.org/xbl">
 
-  <binding id="button-base" extends="chrome://global/content/bindings/general.xml#basetext">
-    <implementation implements="nsIDOMXULButtonElement, nsIAccessibleProvider">
-      <property name="accessibleType" readonly="true">
-        <getter>
-          <![CDATA[
-            return Components.interfaces.nsIAccessibleProvider.XULButton;
-          ]]>
-        </getter>
-      </property>
-
+  <binding id="button-base" extends="chrome://global/content/bindings/general.xml#basetext" role="xul:button">
+    <implementation implements="nsIDOMXULButtonElement">
       <property name="type"
                 onget="return this.getAttribute('type');"
                 onset="this.setAttribute('type', val); return val;"/>
 
       <property name="dlgType"
                 onget="return this.getAttribute('dlgtype');"
                 onset="this.setAttribute('dlgtype', val); return val;"/>
 
--- a/toolkit/content/widgets/checkbox.xml
+++ b/toolkit/content/widgets/checkbox.xml
@@ -10,34 +10,27 @@
    xmlns:xbl="http://www.mozilla.org/xbl">
 
   <binding id="checkbox" extends="chrome://global/content/bindings/checkbox.xml#checkbox-baseline">
     <resources>
       <stylesheet src="chrome://global/skin/checkbox.css"/>
     </resources>
   </binding>
 
-  <binding id="checkbox-baseline" extends="chrome://global/content/bindings/general.xml#basetext">
+  <binding id="checkbox-baseline" role="xul:checkbox"
+    extends="chrome://global/content/bindings/general.xml#basetext">
     <content>
       <xul:image class="checkbox-check" xbl:inherits="checked,disabled"/>
       <xul:hbox class="checkbox-label-box" flex="1">
         <xul:image class="checkbox-icon" xbl:inherits="src"/>
         <xul:label class="checkbox-label" xbl:inherits="xbl:text=label,accesskey,crop" flex="1"/>
       </xul:hbox>
     </content>
     
-    <implementation implements="nsIDOMXULCheckboxElement, nsIAccessibleProvider">
-      <property name="accessibleType" readonly="true">
-        <getter>
-          <![CDATA[
-            return Components.interfaces.nsIAccessibleProvider.XULCheckbox;
-          ]]>
-        </getter>
-      </property>
-
+    <implementation implements="nsIDOMXULCheckboxElement">
       <method name="setChecked">
         <parameter name="aValue"/>
         <body>
         <![CDATA[
           var change = (aValue != (this.getAttribute('checked') == 'true'));
           if (aValue)
             this.setAttribute('checked', 'true');
           else
--- a/toolkit/content/widgets/colorpicker.xml
+++ b/toolkit/content/widgets/colorpicker.xml
@@ -408,17 +408,17 @@
           this.removeAttribute('focused');
           this.resetHover();
         }
       ]]>
       </handler>
     </handlers>
   </binding>
 
-  <binding id="colorpicker-button" display="xul:menu"
+  <binding id="colorpicker-button" display="xul:menu" role="xul:colorpicker"
            extends="chrome://global/content/bindings/general.xml#basecontrol">
     <resources>
       <stylesheet src="chrome://global/skin/colorpicker.css"/>
     </resources>
     
     <content>
       <xul:hbox class="colorpicker-button-colorbox" anonid="colorbox" flex="1" xbl:inherits="disabled"/>
 
@@ -427,25 +427,17 @@
                  onmousedown="event.stopPropagation()"
                  onpopupshowing="this._colorPicker.onPopupShowing()"
                  onpopuphiding="this._colorPicker.onPopupHiding()"
                  onselect="this._colorPicker.pickerChange()">
         <xul:colorpicker xbl:inherits="palettename,disabled" allowevents="true" anonid="colorpicker"/>
       </xul:panel>
     </content>
     
-    <implementation implements="nsIAccessibleProvider">
-      <property name="accessibleType" readonly="true">
-        <getter>
-          <![CDATA[
-            return Components.interfaces.nsIAccessibleProvider.XULColorPicker;
-          ]]>
-        </getter>
-      </property>
-    
+    <implementation>
       <property name="open"
                 onget="return this.getAttribute('open') == 'true'"
                 onset="this.showPopup();"/>
       <property name="color">
         <getter><![CDATA[
           return this.getAttribute("color");
         ]]></getter>
         <setter><![CDATA[
@@ -544,22 +536,13 @@
         if ( (event.keyCode == 32 || (event.keyCode > 36 && event.keyCode < 41)) && !this.open)
           this.showPopup();
         else if ( (event.keyCode == 27) && this.open)
           this.hidePopup();
       ]]></handler>
     </handlers>
   </binding>
 
-  <binding id="colorpickertile">
-    <implementation implements="nsIAccessibleProvider">
-      <property name="accessibleType" readonly="true">
-        <getter>
-          <![CDATA[
-            return Components.interfaces.nsIAccessibleProvider.XULColorPickerTile;
-          ]]>
-        </getter>
-      </property>
-    </implementation>
+  <binding id="colorpickertile" role="xul:colorpickertile">
   </binding>
 
 </bindings>
 
--- a/toolkit/content/widgets/editor.xml
+++ b/toolkit/content/widgets/editor.xml
@@ -4,38 +4,30 @@
    - file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
 
 
 <bindings id="editorBindings"
    xmlns="http://www.mozilla.org/xbl"
    xmlns:xul="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
    xmlns:xbl="http://www.mozilla.org/xbl">
   
-  <binding id="editor">
-    <implementation type="application/javascript" implements="nsIAccessibleProvider">
+  <binding id="editor" role="outerdoc">
+    <implementation type="application/javascript">
       <constructor>
         <![CDATA[
           // Make window editable immediately only
           //   if the "editortype" attribute is supplied
           // This allows using same contentWindow for different editortypes,
           //   where the type is determined during the apps's window.onload handler.
           if (this.editortype)
             this.makeEditable(this.editortype, true);
         ]]>
       </constructor>
       <destructor/>
 
-      <property name="accessibleType" readonly="true">
-        <getter>
-          <![CDATA[
-            return Components.interfaces.nsIAccessibleProvider.OuterDoc;
-          ]]>
-        </getter>
-      </property>
-
       <field name="_editorContentListener">
         <![CDATA[
           ({
             QueryInterface: function(iid)
             {
               if (iid.equals(Components.interfaces.nsIURIContentListener) ||
                   iid.equals(Components.interfaces.nsISupportsWeakReference) ||
                   iid.equals(Components.interfaces.nsISupports))
--- a/toolkit/content/widgets/general.xml
+++ b/toolkit/content/widgets/general.xml
@@ -78,25 +78,18 @@
         if (this._lightweightTheme) {
           this._lightweightTheme.destroy();
           this._lightweightTheme = null;
         }
       ]]></destructor>
     </implementation>
   </binding>
 
-  <binding id="iframe">
-    <implementation implements="nsIAccessibleProvider">
-      <property name="accessibleType" readonly="true">
-        <getter>
-          <![CDATA[
-            return Components.interfaces.nsIAccessibleProvider.OuterDoc;
-          ]]>
-        </getter>
-      </property>
+  <binding id="iframe" role="outerdoc">
+    <implementation>
       <property name="docShell"
                 readonly="true"
                 onget="return this.boxObject.QueryInterface(Components.interfaces.nsIContainerBoxObject).docShell"/>
       <property name="contentWindow"
                 readonly="true"
                 onget="return this.docShell.QueryInterface(Components.interfaces.nsIInterfaceRequestor).getInterface(Components.interfaces.nsIDOMWindow);"/>
       <property name="webNavigation"
                 onget="return this.docShell.QueryInterface(Components.interfaces.nsIWebNavigation);"
@@ -129,33 +122,23 @@
   <binding id="statusbarpanel-menu-iconic" display="xul:menu"
            extends="chrome://global/content/bindings/general.xml#statusbarpanel">
     <content>
       <xul:image class="statusbarpanel-icon" xbl:inherits="src,src=image"/>
       <children/>
     </content>
   </binding>
 
-  <binding id="statusbar">
+  <binding id="statusbar" role="xul:statusbar">
     <content>
       <children/>
       <xul:statusbarpanel class="statusbar-resizerpanel">
         <xul:resizer dir="bottomend"/>
       </xul:statusbarpanel>
     </content>
-
-    <implementation implements="nsIAccessibleProvider">
-      <property name="accessibleType" readonly="true">
-        <getter>
-          <![CDATA[
-            return Components.interfaces.nsIAccessibleProvider.XULStatusBar;
-          ]]>
-        </getter>
-      </property>
-    </implementation>
   </binding>
   
   <binding id="statusbar-drag"
            extends="chrome://global/content/bindings/general.xml#statusbar">
     <implementation>
       <field name="_dragBindingAlive">true</field>
       <constructor>
         if (!this._draggableStarted) {
@@ -166,66 +149,36 @@
             let draghandle = new tmp.WindowDraggingElement(this);
             draghandle.mouseDownCheck = function () this._dragBindingAlive;
           } catch (e) {}
         }
       </constructor>
     </implementation>
   </binding>
 
-  <binding id="statusbarpanel-iconic" display="xul:button"
+  <binding id="statusbarpanel-iconic" display="xul:button" role="xul:button"
            extends="chrome://global/content/bindings/general.xml#statusbarpanel">
     <content>
       <xul:image class="statusbarpanel-icon" xbl:inherits="src,src=image"/>
     </content>
-
-    <implementation implements="nsIAccessibleProvider">
-      <property name="accessibleType" readonly="true">
-        <getter>
-          <![CDATA[
-            return Components.interfaces.nsIAccessibleProvider.XULButton;
-          ]]>
-        </getter>
-      </property>
-    </implementation>
   </binding>
 
-  <binding id="statusbarpanel-iconic-text" display="xul:button"
+  <binding id="statusbarpanel-iconic-text" display="xul:button" role="xul:button"
            extends="chrome://global/content/bindings/general.xml#statusbarpanel">
     <content>
       <xul:image class="statusbarpanel-icon" xbl:inherits="src,src=image"/>
       <xul:label class="statusbarpanel-text" xbl:inherits="value=label,crop"/>
     </content>
-
-    <implementation implements="nsIAccessibleProvider">
-      <property name="accessibleType" readonly="true">
-        <getter>
-          <![CDATA[
-            return Components.interfaces.nsIAccessibleProvider.XULButton;
-          ]]>
-        </getter>
-      </property>
-    </implementation>
   </binding>
 
-  <binding id="image">
-    <implementation implements="nsIDOMXULImageElement, nsIAccessibleProvider">
+  <binding id="image" role="xul:image">
+    <implementation implements="nsIDOMXULImageElement">
       <property name="src"
                 onget="return this.getAttribute('src');"
                 onset="this.setAttribute('src',val); return val;"/>
-      <property name="accessibleType" readonly="true">
-        <getter>
-          <![CDATA[
-            // Expose XUL images with an onclick as a toolbarbutton
-            return this.hasAttribute("onclick") ?
-              Components.interfaces.nsIAccessibleProvider.XULToolbarButton :
-              Components.interfaces.nsIAccessibleProvider.XULImage;
-          ]]>
-        </getter>
-      </property>
     </implementation>
   </binding>
 
   <binding id="deck">
     <implementation>
       <property name="selectedIndex"
                 onget="return this.getAttribute('selectedIndex') || '0'">
         <setter>
@@ -256,34 +209,24 @@
             this.selectedIndex = selectedIndex;
             return val;
           ]]>
         </setter>
       </property>
     </implementation>
   </binding>
 
-  <binding id="dropmarker" extends="xul:button">
+  <binding id="dropmarker" extends="xul:button" role="xul:dropmarker">
     <resources>
       <stylesheet src="chrome://global/skin/dropmarker.css"/>
     </resources>
 
     <content>
       <xul:image class="dropmarker-icon"/>
     </content>
-
-    <implementation implements="nsIAccessibleProvider">
-      <property name="accessibleType" readonly="true">
-        <getter>
-          <![CDATA[
-            return Components.interfaces.nsIAccessibleProvider.XULDropmarker;
-          ]]>
-        </getter>
-      </property>
-    </implementation>
   </binding>
 
   <binding id="windowdragbox">
     <implementation>
       <field name="_dragBindingAlive">true</field>
       <constructor>
         if (!this._draggableStarted) {
           this._draggableStarted = true;
--- a/toolkit/content/widgets/groupbox.xml
+++ b/toolkit/content/widgets/groupbox.xml
@@ -10,35 +10,26 @@
    xmlns:xbl="http://www.mozilla.org/xbl">
 
   <binding id="groupbox-base">
     <resources>
       <stylesheet src="chrome://global/skin/groupbox.css"/>
     </resources>
   </binding>
 
-  <binding id="groupbox" extends="chrome://global/content/bindings/groupbox.xml#groupbox-base">
+  <binding id="groupbox" role="xul:groupbox"
+    extends="chrome://global/content/bindings/groupbox.xml#groupbox-base">
     <content>
       <xul:hbox class="groupbox-title" align="center" pack="start">
         <children includes="caption"/>
       </xul:hbox>
       <xul:box flex="1" class="groupbox-body" xbl:inherits="orient,align,pack">
         <children/>
       </xul:box>
     </content>
-
-    <implementation implements="nsIAccessibleProvider">
-      <property name="accessibleType" readonly="true">
-        <getter>
-          <![CDATA[
-            return Components.interfaces.nsIAccessibleProvider.XULGroupbox;
-          ]]>
-        </getter>
-      </property>
-    </implementation>
   </binding>
 
   <binding id="caption" extends="chrome://global/content/bindings/general.xml#basetext">
     <resources>
       <stylesheet src="chrome://global/skin/groupbox.css"/>
     </resources>
     
     <content>
--- a/toolkit/content/widgets/listbox.xml
+++ b/toolkit/content/widgets/listbox.xml
@@ -67,30 +67,23 @@
      * @param aDirection - specifies scrolling direction, should be either -1 or 1
      * @return the number of elements the selection scrolled
      */
     scrollOnePage(aDirection)
 
     /** Fire "select" event */
     _fireOnSelect()
    -->
-   <binding id="listbox-base"
+   <binding id="listbox-base" role="xul:listbox"
             extends="chrome://global/content/bindings/general.xml#basecontrol">
 
-    <implementation implements="nsIDOMXULMultiSelectControlElement, nsIAccessibleProvider">
+    <implementation implements="nsIDOMXULMultiSelectControlElement">
       <field name="_lastKeyTime">0</field>
       <field name="_incrementalString">""</field>
 
-    <!-- nsIAccessibleProvider -->
-      <property name="accessibleType" readonly="true">
-        <getter>
-          return Components.interfaces.nsIAccessibleProvider.XULListbox;
-        </getter>
-      </property>
-
     <!-- nsIDOMXULSelectControlElement -->
       <property name="selectedItem"
                 onset="this.selectItem(val);">
         <getter>
         <![CDATA[
           return this.selectedItems.length > 0 ? this.selectedItems[0] : null;
         ]]>
         </getter>
@@ -895,52 +888,42 @@
         // shouldn't be scrolled by pixel scrolling events before a line/page
         // scrolling event.
         event.preventDefault();
       ]]>
       </handler>
     </handlers>
   </binding>
   
-  <binding id="listitem"
+  <binding id="listitem" role="xul:listitem"
            extends="chrome://global/content/bindings/general.xml#basetext">
     <resources>
       <stylesheet src="chrome://global/skin/listbox.css"/>
     </resources>
 
     <content>
       <children>
         <xul:listcell xbl:inherits="label,crop,disabled,flexlabel"/>
       </children>
     </content>
 
-    <implementation implements="nsIDOMXULSelectControlItemElement, nsIAccessibleProvider">
+    <implementation implements="nsIDOMXULSelectControlItemElement">
       <property name="current" onget="return this.getAttribute('current') == 'true';">
         <setter><![CDATA[
           if (val)
             this.setAttribute("current", "true");
           else
             this.removeAttribute("current");
 
           this._fireEvent(val ? "DOMMenuItemActive" : "DOMMenuItemInactive");
 
           return val;
         ]]></setter>
       </property>
 
-      <!-- ///////////////// nsIAccessibleProvider ///////////////// -->
-
-      <property name="accessibleType" readonly="true">
-        <getter>
-          <![CDATA[
-            return Components.interfaces.nsIAccessibleProvider.XULListitem;
-          ]]>
-        </getter>
-      </property>
-
       <!-- ///////////////// nsIDOMXULSelectControlItemElement ///////////////// -->
                 
       <property name="value" onget="return this.getAttribute('value');"
                              onset="this.setAttribute('value', val); return val;"/>
       <property name="label" onget="return this.getAttribute('label');"
                              onset="this.setAttribute('label', val); return val;"/>
       
       <property name="selected" onget="return this.getAttribute('selected') == 'true';">
@@ -1082,60 +1065,28 @@
            extends="chrome://global/content/bindings/listbox.xml#listitem-checkbox">
     <content>
       <children>
         <xul:listcell type="checkbox" class="listcell-iconic" xbl:inherits="label,image,crop,checked,disabled,flexlabel"/>
       </children>
     </content>
   </binding>
   
-  <binding id="listcell"
+  <binding id="listcell" role="xul:listcell"
            extends="chrome://global/content/bindings/general.xml#basecontrol">
 
     <resources>
       <stylesheet src="chrome://global/skin/listbox.css"/>
     </resources>
 
     <content>
       <children>
         <xul:label class="listcell-label" xbl:inherits="value=label,flex=flexlabel,crop,disabled" flex="1" crop="right"/>
       </children>
     </content>
-
-    <implementation implements="nsIAccessibleProvider">
-      <property name="accessibleType" readonly="true">
-        <getter>
-        <![CDATA[
-          // Don't expose xul:listcell as cell accessible until listbox is
-          // multicolumn.
-          const Ci = Components.interfaces;
-          const kNoAccessible = Ci.nsIAccessibleProvider.NoAccessible;
-          const kListCellAccessible = Ci.nsIAccessibleProvider.XULListCell;
-
-          var listitem = this.parentNode;
-          if (!(listitem instanceof Ci.nsIDOMXULSelectControlItemElement))
-            return kNoAccessible;
-
-          var list = listitem.control;
-          if (!list)
-            return kNoAccessible;
-
-          var listcolsElm = list.getElementsByTagName("listcols")[0];
-          if (!listcolsElm)
-            return kNoAccessible;
-
-          var listcolElms = listcolsElm.getElementsByTagName("listcol");
-          if (listcolElms.length <= 1)
-            return kNoAccessible;
-
-          return kListCellAccessible;
-        ]]>
-        </getter>
-      </property>
-    </implementation>
   </binding>
 
   <binding id="listcell-iconic"
            extends="chrome://global/content/bindings/listbox.xml#listcell">
     <content>
       <children>
         <xul:image class="listcell-icon" xbl:inherits="src=image"/>
         <xul:label class="listcell-label" xbl:inherits="value=label,flex=flexlabel,crop,disabled" flex="1" crop="right"/>
@@ -1159,52 +1110,36 @@
       <children>
         <xul:image class="listcell-check" xbl:inherits="checked,disabled"/>
         <xul:image class="listcell-icon" xbl:inherits="src=image"/>
         <xul:label class="listcell-label" xbl:inherits="value=label,flex=flexlabel,crop,disabled" flex="1" crop="right"/>
       </children>
     </content>
   </binding>
 
-  <binding id="listhead">
+  <binding id="listhead" role="xul:listhead">
 
     <resources>
       <stylesheet src="chrome://global/skin/listbox.css"/>
     </resources>
 
     <content>
       <xul:listheaditem>
         <children includes="listheader"/>
       </xul:listheaditem>
     </content>
-
-    <implementation implements="nsIAccessibleProvider">
-      <property name="accessibleType" readonly="true">
-        <getter>
-          return Components.interfaces.nsIAccessibleProvider.XULListHead;
-        </getter>
-      </property>
-    </implementation>
   </binding>
 
-  <binding id="listheader" display="xul:button">
+  <binding id="listheader" display="xul:button" role="xul:listheader">
 
     <resources>
       <stylesheet src="chrome://global/skin/listbox.css"/>
     </resources>
 
     <content>
       <xul:image class="listheader-icon"/>
       <xul:label class="listheader-label" xbl:inherits="value=label,crop" flex="1" crop="right"/>
       <xul:image class="listheader-sortdirection" xbl:inherits="sortDirection"/>
     </content>
-
-    <implementation implements="nsIAccessibleProvider">
-      <property name="accessibleType" readonly="true">
-        <getter>
-          return Components.interfaces.nsIAccessibleProvider.XULListHeader;
-        </getter>
-      </property>
-    </implementation>
   </binding>
 
 </bindings>
 
--- a/toolkit/content/widgets/menu.xml
+++ b/toolkit/content/widgets/menu.xml
@@ -4,31 +4,22 @@
    - file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
 
 
 <bindings id="menuitemBindings"
    xmlns="http://www.mozilla.org/xbl"
    xmlns:xul="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
    xmlns:xbl="http://www.mozilla.org/xbl">
 
-  <binding id="menuitem-base"
+  <binding id="menuitem-base" role="xul:menuitem"
            extends="chrome://global/content/bindings/general.xml#control-item">
     <resources>
       <stylesheet src="chrome://global/skin/menu.css"/>
     </resources>
-    <implementation implements="nsIDOMXULSelectControlItemElement, nsIDOMXULContainerItemElement, nsIAccessibleProvider">
-      <!-- nsIAccessibleProvider -->
-      <property name="accessibleType" readonly="true">
-        <getter>
-          <![CDATA[
-            return Components.interfaces.nsIAccessibleProvider.XULMenuitem;
-          ]]>
-        </getter>
-      </property>
-
+    <implementation implements="nsIDOMXULSelectControlItemElement, nsIDOMXULContainerItemElement">
       <!-- nsIDOMXULSelectControlItemElement -->
       <property name="selected" readonly="true"
                 onget="return this.getAttribute('selected') == 'true';"/>
       <property name="control" readonly="true">
         <getter>
           <![CDATA[
             var parent = this.parentNode;
             if (parent &&
@@ -268,23 +259,13 @@
   
   <binding id="menubutton-item" extends="chrome://global/content/bindings/menu.xml#menuitem-base">
     <content>
       <xul:label class="menubutton-text" flex="1" xbl:inherits="value=label,accesskey,crop" crop="right"/>
       <children includes="menupopup"/>
     </content>
   </binding>  
   
-  <binding id="menuseparator"
+  <binding id="menuseparator" role="xul:menuseparator"
            extends="chrome://global/content/bindings/menu.xml#menuitem-base">
-    <implementation>
-      <!-- nsIAccessibleProvider -->
-      <property name="accessibleType" readonly="true">
-        <getter>
-          <![CDATA[
-            return Components.interfaces.nsIAccessibleProvider.XULMenuSeparator;
-          ]]>
-        </getter>
-      </property>
-    </implementation>
   </binding>
 
 </bindings>
--- a/toolkit/content/widgets/menulist.xml
+++ b/toolkit/content/widgets/menulist.xml
@@ -12,17 +12,17 @@
 
   <binding id="menulist-base" extends="chrome://global/content/bindings/general.xml#basecontrol">
     <resources>
       <stylesheet src="chrome://global/content/menulist.css"/>
       <stylesheet src="chrome://global/skin/menulist.css"/>
     </resources>
   </binding>
 
-  <binding id="menulist" display="xul:menu"
+  <binding id="menulist" display="xul:menu" role="xul:menulist"
            extends="chrome://global/content/bindings/menulist.xml#menulist-base">
     <content sizetopopup="pref">
       <xul:hbox class="menulist-label-box" flex="1">
         <xul:image class="menulist-icon" xbl:inherits="src=image,src"/>
         <xul:label class="menulist-label" xbl:inherits="value=label,crop,accesskey" crop="right" flex="1"/>
       </xul:hbox>
       <xul:dropmarker class="menulist-dropmarker" type="menu" xbl:inherits="disabled,open"/>
       <children includes="menupopup"/>
@@ -61,17 +61,17 @@
               this.menuBoxObject.activeChild.doCommand();
               event.preventDefault();
             }
           }
         ]]>
       </handler>
     </handlers>
 
-    <implementation implements="nsIDOMXULMenuListElement, nsIAccessibleProvider, nsIDOMEventListener">
+    <implementation implements="nsIDOMXULMenuListElement, nsIDOMEventListener">
       <constructor>
         this.setInitialSelection()
       </constructor>
 
       <method name="setInitialSelection">
         <body>
           <![CDATA[
             var popup = this.menupopup;
@@ -382,27 +382,16 @@
           this.selectedItem = null;
           var popup = this.menupopup;
           if (popup)
             this.removeChild(popup);
         ]]>
         </body>
       </method>
 
-      <property name="accessibleType" readonly="true">
-        <getter>
-          <![CDATA[
-            // Droppable is currently used for the Firefox bookmarks dialog only
-            return (this.getAttribute("droppable") == "false") ?
-                   Components.interfaces.nsIAccessibleProvider.XULTextBox :
-                   Components.interfaces.nsIAccessibleProvider.XULCombobox;
-          ]]>
-        </getter>
-      </property>
-
       <destructor>
         <![CDATA[
           if (this.mSelectedInternal) {
             if (document instanceof Components.interfaces.nsIDOMXULDocument) {
               document.removeBroadcastListenerFor(this.mSelectedInternal, this, "value");
               document.removeBroadcastListenerFor(this.mSelectedInternal, this, "label");
               document.removeBroadcastListenerFor(this.mSelectedInternal, this, "image");
               document.removeBroadcastListenerFor(this.mSelectedInternal, this, "description");
--- a/toolkit/content/widgets/notification.xml
+++ b/toolkit/content/widgets/notification.xml
@@ -354,17 +354,17 @@
         if (event.target.localName == "notification" &&
             event.propertyName == "margin-top")
           this._finishAnimation();
       ]]></handler>
     </handlers>
 
   </binding>
 
-  <binding id="notification">
+  <binding id="notification" role="xul:alert">
     <content>
       <xul:hbox class="notification-inner outset" flex="1" xbl:inherits="type">
         <xul:hbox anonid="details" align="center" flex="1"
                   oncommand="this.parentNode.parentNode._doButtonCommand(event);">
           <xul:image anonid="messageImage" class="messageImage" xbl:inherits="src=image,type,value"/>
           <xul:description anonid="messageText" class="messageText" flex="1" xbl:inherits="xbl:text=label"/>
           <xul:spacer flex="1"/>
           <children/>
@@ -374,25 +374,17 @@
                            xbl:inherits="hidden=hideclose"
                            tooltiptext="&closeNotification.tooltip;"
                            oncommand="document.getBindingParent(this).close();"/>
       </xul:hbox>
     </content>
     <resources>
       <stylesheet src="chrome://global/skin/notification.css"/>
     </resources>
-    <implementation implements="nsIAccessibleProvider">
-      <property name="accessibleType" readonly="true">
-        <getter>
-          <![CDATA[
-            return Components.interfaces.nsIAccessibleProvider.XULAlert;
-          ]]>
-        </getter>
-      </property>
-
+    <implementation>
       <property name="label" onset="this.setAttribute('label', val); return val;"
                              onget="return this.getAttribute('label');"/>
       <property name="value" onset="this.setAttribute('value', val); return val;"
                              onget="return this.getAttribute('value');"/>
       <property name="image" onset="this.setAttribute('image', val); return val;"
                              onget="return this.getAttribute('image');"/>
       <property name="type" onset="this.setAttribute('type', val); return val;"
                             onget="return this.getAttribute('type');"/>
--- a/toolkit/content/widgets/popup.xml
+++ b/toolkit/content/widgets/popup.xml
@@ -200,36 +200,26 @@
           return this.popupBoxObject.getOuterScreenRect();
         ]]>
         </body>
       </method>
     </implementation>     
 
   </binding>
 
-  <binding id="popup"
+  <binding id="popup" role="xul:menupopup"
            extends="chrome://global/content/bindings/popup.xml#popup-base">
     
     <content>
       <xul:arrowscrollbox class="popup-internal-box" flex="1" orient="vertical"
                           smoothscroll="false">
         <children/>
       </xul:arrowscrollbox>
     </content>
 
-    <implementation implements="nsIAccessibleProvider">
-      <property name="accessibleType" readonly="true">
-        <getter>
-          <![CDATA[
-              return Components.interfaces.nsIAccessibleProvider.XULMenupopup;
-            ]]>
-        </getter>
-      </property>
-    </implementation>
-
     <handlers>
       <handler event="popupshowing" phase="target">
         <![CDATA[
           var array = [];
           var width = 0;
           for (var menuitem = this.firstChild; menuitem; menuitem = menuitem.nextSibling) {
             if (menuitem.localName == "menuitem" && menuitem.hasAttribute("acceltext")) {
               var accel = document.getAnonymousElementByAttribute(menuitem, "anonid", "accel");
@@ -242,30 +232,19 @@
           }
           for (var i = 0; i < array.length; i++)
             array[i].width = width;
         ]]>
       </handler>
     </handlers>
   </binding>
 
-  <binding id="panel"
+  <binding id="panel" role="xul:panel"
            extends="chrome://global/content/bindings/popup.xml#popup-base">
-    <!-- This separate binding for dialog-like panels - not menu, list or autocomplete popups
-         exposes the popup as an alert or a pane, depending on whether it is always intended
-         to get keyboard navigation when it opens -->
-    <implementation implements="nsIDOMXULPopupElement, nsIAccessibleProvider">
-      <property name="accessibleType" readonly="true">
-        <getter>
-          <![CDATA[
-          return (this.getAttribute("noautofocus") == "true") ?
-                       Components.interfaces.nsIAccessibleProvider.XULAlert :
-                       Components.interfaces.nsIAccessibleProvider.XULPane;
-        ]]></getter>
-      </property>
+    <implementation implements="nsIDOMXULPopupElement">
       <field name="_prevFocus">0</field>
       <field name="_dragBindingAlive">true</field>
       <constructor>
       <![CDATA[
         if (this.getAttribute("backdrag") == "true" && !this._draggableStarted) {
           this._draggableStarted = true;
           try {
             let tmp = {};
@@ -482,30 +461,25 @@
         this.setAttribute("panelopen", "true");
       </handler>
       <handler event="popuphidden" phase="target">
         this.removeAttribute("panelopen");
       </handler>
     </handlers>
   </binding>
 
-  <binding id="tooltip" extends="chrome://global/content/bindings/popup.xml#popup-base">
+  <binding id="tooltip" role="xul:tooltip"
+           extends="chrome://global/content/bindings/popup.xml#popup-base">
     <content>
       <children>
         <xul:label class="tooltip-label" xbl:inherits="xbl:text=label" flex="1"/>
       </children>
     </content>
     
-    <implementation implements="nsIAccessibleProvider">
-      <property name="accessibleType" readonly="true">
-        <getter>
-          return Components.interfaces.nsIAccessibleProvider.XULTooltip;
-        </getter>
-      </property>
-
+    <implementation>
       <field name="_mouseOutCount">0</field>
       <field name="_isMouseOver">false</field>
       
       <property name="label"
                 onget="return this.getAttribute('label');"
                 onset="this.setAttribute('label', val); return val;"/>
 
       <property name="page" onset="if (val) this.setAttribute('page', 'true');
--- a/toolkit/content/widgets/preferences.xml
+++ b/toolkit/content/widgets/preferences.xml
@@ -1287,33 +1287,25 @@
             dump("*** No preference found for " + elements[i].getAttribute("preference") + "\n");
           }
         }
       ]]>      
       </handler>
     </handlers>
   </binding>
           
-  <binding id="panebutton" extends="chrome://global/content/bindings/radio.xml#radio">
+  <binding id="panebutton" role="xul:listitem"
+           extends="chrome://global/content/bindings/radio.xml#radio">
     <resources>
       <stylesheet src="chrome://global/skin/preferences.css"/>
     </resources>
     <content>
       <xul:image class="paneButtonIcon" xbl:inherits="src"/>
       <xul:label class="paneButtonLabel" xbl:inherits="value=label"/>
     </content>
-    <implementation implements="nsIAccessible">
-      <property name="accessibleType" readonly="true">
-        <getter>
-          <![CDATA[
-            return Components.interfaces.nsIAccessibleProvider.XULListitem;
-          ]]>
-        </getter>
-      </property>
-    </implementation>
   </binding>
 
 </bindings>
 
 # -*- Mode: Java; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
 # 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/.
--- a/toolkit/content/widgets/progressmeter.xml
+++ b/toolkit/content/widgets/progressmeter.xml
@@ -4,27 +4,27 @@
    - file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
 
 
 <bindings id="progressmeterBindings"
    xmlns="http://www.mozilla.org/xbl"
    xmlns:xul="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
    xmlns:xbl="http://www.mozilla.org/xbl">
 
-  <binding id="progressmeter">
+  <binding id="progressmeter" role="xul:progressmeter">
     <resources>
       <stylesheet src="chrome://global/skin/progressmeter.css"/>
     </resources>
 
     <content>
       <xul:spacer class="progress-bar" xbl:inherits="mode"/>
       <xul:spacer class="progress-remainder" xbl:inherits="mode"/>
     </content>
     
-    <implementation implements="nsIAccessibleProvider">
+    <implementation>
       <property name="mode" onset="if (this.mode != val) this.setAttribute('mode', val); return val;"
                             onget="return this.getAttribute('mode');"/>
 
       <property name="value" onget="return this.getAttribute('value') || '0';">
         <setter><![CDATA[
           var p = Math.round(val);
           var max = Math.round(this.max);
           if (p < 0)
@@ -48,24 +48,16 @@
           return val;
         ]]></setter>
       </property>
       <property name="max"
                 onget="return this.getAttribute('max') || '100';"
                 onset="this.setAttribute('max', isNaN(val) ? 100 : Math.max(val, 1));
                        this.value = this.value;
                        return val;" />
-
-      <property name="accessibleType" readonly="true">
-        <getter>
-          <![CDATA[
-            return Components.interfaces.nsIAccessibleProvider.XULProgressMeter;
-          ]]>
-        </getter>
-      </property>
     </implementation>
   </binding>
 
   <binding id="progressmeter-undetermined"
            extends="chrome://global/content/bindings/progressmeter.xml#progressmeter">
     <content>
       <xul:stack class="progress-remainder" flex="1" anonid="stack" style="overflow: -moz-hidden-unscrollable;">
         <xul:spacer class="progress-bar" anonid="spacer" top="0" style="margin-right: -1000px;"/>
--- a/toolkit/content/widgets/radio.xml
+++ b/toolkit/content/widgets/radio.xml
@@ -4,22 +4,23 @@
    - file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
 
 
 <bindings id="radioBindings"
    xmlns="http://www.mozilla.org/xbl"
    xmlns:xul="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
    xmlns:xbl="http://www.mozilla.org/xbl">
 
-  <binding id="radiogroup" extends="chrome://global/content/bindings/general.xml#basecontrol">
+  <binding id="radiogroup" role="xul:radiogroup"
+           extends="chrome://global/content/bindings/general.xml#basecontrol">
     <resources>
       <stylesheet src="chrome://global/skin/radio.css"/>
     </resources>
 
-    <implementation implements="nsIDOMXULSelectControlElement, nsIAccessibleProvider">
+    <implementation implements="nsIDOMXULSelectControlElement">
       <constructor>
         <![CDATA[
           if (this.getAttribute("disabled") == "true")
             this.disabled = true;
 
           var children = this._getRadioChildren();
           var length = children.length;
           for (var i = 0; i < length; i++) {
@@ -32,24 +33,16 @@
           var value = this.value;
           if (value)
             this.value = value;
           else
             this.selectedIndex = 0;
         ]]>
       </constructor>
 
-      <property name="accessibleType" readonly="true">
-        <getter>
-          <![CDATA[
-            return Components.interfaces.nsIAccessibleProvider.XULRadioGroup;
-          ]]>
-        </getter>
-      </property>
-
       <property name="value" onget="return this.getAttribute('value');">
         <setter>
           <![CDATA[
             this.setAttribute("value", val);
             var children = this._getRadioChildren();
             for (var i = 0; i < children.length; i++) {
               if (String(children[i].value) == String(val)) {
                 this.selectedItem = children[i];
@@ -426,30 +419,31 @@
       </handler>
       <handler event="blur" phase="target">
         this.removeAttribute("focused");
         this.focusedItem = null;
       </handler>
     </handlers>
   </binding>
 
-  <binding id="radio" extends="chrome://global/content/bindings/general.xml#control-item">
+  <binding id="radio" role="xul:radiobutton"
+    extends="chrome://global/content/bindings/general.xml#control-item">
     <resources>
       <stylesheet src="chrome://global/skin/radio.css"/>
     </resources>
 
     <content>
       <xul:image class="radio-check" xbl:inherits="disabled,selected"/>
       <xul:hbox class="radio-label-box" align="center" flex="1">
         <xul:image class="radio-icon" xbl:inherits="src"/>
         <xul:label class="radio-label" xbl:inherits="xbl:text=label,accesskey,crop" flex="1"/>
       </xul:hbox>
     </content>
 
-    <implementation implements="nsIDOMXULSelectControlItemElement, nsIAccessibleProvider">
+    <implementation implements="nsIDOMXULSelectControlItemElement">
       <constructor>
         <![CDATA[
           // Just clear out the parent's cached list of radio children
           var control = this.control;
           if (control)
             control._radioChildren = null;
         ]]>
       </constructor>
@@ -464,23 +458,16 @@
           for (var i = 0; i < radioList.length; ++i) {
             if (radioList[i] == this) {
               radioList.splice(i, 1);
               return;
             }
           }
         ]]>
       </destructor>
-      <property name="accessibleType" readonly="true">
-        <getter>
-          <![CDATA[
-            return Components.interfaces.nsIAccessibleProvider.XULRadioButton;
-          ]]>
-        </getter>
-      </property>
       <property name="selected" readonly="true">
         <getter>
           <![CDATA[
             return this.hasAttribute('selected');
           ]]>
         </getter>
       </property>
       <property name="radioGroup" readonly="true" onget="return this.control"/>
--- a/toolkit/content/widgets/remote-browser.xml
+++ b/toolkit/content/widgets/remote-browser.xml
@@ -5,17 +5,17 @@
    - file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
 
 <bindings id="firefoxBrowserBindings"
           xmlns="http://www.mozilla.org/xbl"
           xmlns:xul="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
 
   <binding id="remote-browser" extends="chrome://global/content/bindings/browser.xml#browser">
 
-    <implementation type="application/javascript" implements="nsIAccessibleProvider, nsIObserver, nsIDOMEventListener, nsIMessageListener, nsIMessageListener">
+    <implementation type="application/javascript" implements="nsIObserver, nsIDOMEventListener, nsIMessageListener, nsIMessageListener">
 
       <field name="_securityUI">null</field>
 
       <property name="securityUI"
                 readonly="true">
         <getter><![CDATA[
           if (!this._securityUI) {
             let jsm = "resource://gre/modules/RemoteSecurityUI.jsm";
--- a/toolkit/content/widgets/scale.xml
+++ b/toolkit/content/widgets/scale.xml
@@ -4,57 +4,43 @@
    - file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
 
 
 <bindings id="scaleBindings"
    xmlns="http://www.mozilla.org/xbl"
    xmlns:xul="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
    xmlns:xbl="http://www.mozilla.org/xbl">
   
-  <binding id="scalethumb" extends="xul:button">
+  <binding id="scalethumb" extends="xul:button" role="xul:thumb">
     <resources>
       <stylesheet src="chrome://global/skin/scale.css"/>
     </resources>
-
-    <implementation implements="nsIAccessibleProvider">
-      <property name="accessibleType" readonly="true">
-        <getter>
-          return Components.interfaces.nsIAccessibleProvider.XULThumb;
-        </getter>
-      </property>
-    </implementation>
   </binding>
 
   <binding id="scaleslider" display="xul:slider"
            extends="chrome://global/content/bindings/general.xml#basecontrol">
     <resources>
       <stylesheet src="chrome://global/skin/scale.css"/>
     </resources>
   </binding>
 
-  <binding id="scale"
+  <binding id="scale" role="xul:scale"
            extends="chrome://global/content/bindings/general.xml#basecontrol">
     <resources>
       <stylesheet src="chrome://global/skin/scale.css"/>
     </resources>
 
     <content align="center" pack="center">
       <xul:slider anonid="slider" class="scale-slider" snap="true" flex="1"
                   xbl:inherits="disabled,orient,dir,curpos=value,minpos=min,maxpos=max,increment,pageincrement,movetoclick">
         <xul:thumb class="scale-thumb" xbl:inherits="disabled,orient"/>
       </xul:slider>
     </content>
     
-    <implementation implements="nsIAccessibleProvider, nsISliderListener">
-      <property name="accessibleType" readonly="true">
-        <getter>
-          return Components.interfaces.nsIAccessibleProvider.XULScale;
-        </getter>
-      </property>
-
+    <implementation implements="nsISliderListener">
       <property name="value" onget="return this._getIntegerAttribute('curpos', 0);"
                              onset="return this._setIntegerAttribute('curpos', val);"/>
       <property name="min" onget="return this._getIntegerAttribute('minpos', 0);"
                            onset="return this._setIntegerAttribute('minpos', val);"/>
       <property name="max" onget="return this._getIntegerAttribute('maxpos', 100);"
                            onset="return this._setIntegerAttribute('maxpos', val);"/>
       <property name="increment" onget="return this._getIntegerAttribute('increment', 1);"
                                  onset="return this._setIntegerAttribute('increment', val);"/>
--- a/toolkit/content/widgets/tabbox.xml
+++ b/toolkit/content/widgets/tabbox.xml
@@ -222,29 +222,29 @@
       </constructor>
 
       <destructor>
         this._eventNode.removeEventListener("keypress", this, false);
       </destructor>
     </implementation>
   </binding>
 
-  <binding id="tabs"
+  <binding id="tabs" role="xul:tabs"
            extends="chrome://global/content/bindings/general.xml#basecontrol">
     <resources>
       <stylesheet src="chrome://global/skin/tabbox.css"/>
     </resources>
 
     <content>
       <xul:spacer class="tabs-left"/>
       <children/>
       <xul:spacer class="tabs-right" flex="1"/>
     </content>
     
-    <implementation implements="nsIDOMXULSelectControlElement, nsIDOMXULRelatedElement, nsIAccessibleProvider">
+    <implementation implements="nsIDOMXULSelectControlElement, nsIDOMXULRelatedElement">
       <constructor>
       <![CDATA[
         // first and last tabs need to be able to have unique styles
         // and also need to select first tab on startup.
         if (this.firstChild)
           this.firstChild.setAttribute("first-tab", "true");
         if (this.lastChild)
           this.lastChild.setAttribute("last-tab", "true");
@@ -270,25 +270,16 @@
         var value = this.value;
         if (value)
           this.value = value;
         else
           this.selectedIndex = 0;
       ]]>
       </constructor>
 
-      <!-- nsIAccessibleProvider -->
-      <property name="accessibleType" readonly="true">
-        <getter>
-          <![CDATA[
-            return Components.interfaces.nsIAccessibleProvider.XULTabs;
-          ]]>
-        </getter>
-      </property>
-
       <!-- nsIDOMXULRelatedElement -->
       <method name="getRelatedElement">
         <parameter name="aTabElm"/>
         <body>
         <![CDATA[
           if (!aTabElm)
             return null;
 
@@ -588,29 +579,19 @@
 
         event.stopPropagation();
       ]]>
       </handler>
     </handlers>
 #endif
   </binding>
 
-  <binding id="tabpanels"
+  <binding id="tabpanels" role="xul:tabpanels"
            extends="chrome://global/content/bindings/tabbox.xml#tab-base">
-    <implementation implements="nsIAccessibleProvider, nsIDOMXULRelatedElement">
-
-      <!-- nsIAccessibleProvider -->
-      <property name="accessibleType" readonly="true">
-        <getter>
-          <![CDATA[
-            return Components.interfaces.nsIAccessibleProvider.XULTabpanels;
-          ]]>
-        </getter>
-      </property>
-
+    <implementation implements="nsIDOMXULRelatedElement">
       <!-- nsIDOMXULRelatedElement -->
       <method name="getRelatedElement">
         <parameter name="aTabPanelElm"/>
         <body>
         <![CDATA[
           if (!aTabPanelElm)
             return null;
 
@@ -698,17 +679,17 @@
             this.selectedIndex = selectedIndex;
             return val;
           ]]>
         </setter>
       </property>
     </implementation>
   </binding>
 
-  <binding id="tab" display="xul:button"
+  <binding id="tab" display="xul:button" role="xul:tab"
            extends="chrome://global/content/bindings/general.xml#control-item">
     <resources>
       <stylesheet src="chrome://global/skin/tabbox.css"/>
     </resources>
 
     <content>
       <xul:hbox class="tab-middle box-inherit" xbl:inherits="align,dir,pack,orient,selected" flex="1">
         <xul:image class="tab-icon"
@@ -716,25 +697,17 @@
                    role="presentation"/>
         <xul:label class="tab-text"
                    xbl:inherits="value=label,accesskey,crop,disabled"
                    flex="1"
                    role="presentation"/>
       </xul:hbox>
     </content>
 
-    <implementation implements="nsIDOMXULSelectControlItemElement, nsIAccessibleProvider">
-      <property name="accessibleType" readonly="true">
-        <getter>
-          <![CDATA[
-            return Components.interfaces.nsIAccessibleProvider.XULTab;
-          ]]>
-        </getter>
-      </property>
-
+    <implementation implements="nsIDOMXULSelectControlItemElement">
       <property name="control" readonly="true">
         <getter>
           <![CDATA[
             var parent = this.parentNode;
             if (parent instanceof Components.interfaces.nsIDOMXULSelectControlElement)
               return parent;
             return null;
           ]]>
--- a/toolkit/content/widgets/text.xml
+++ b/toolkit/content/widgets/text.xml
@@ -5,25 +5,18 @@
 
 
 <bindings id="textBindings"
    xmlns="http://www.mozilla.org/xbl"
    xmlns:xul="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
    xmlns:html="http://www.w3.org/1999/xhtml">
 
   <!-- bound to <description>s -->
-  <binding id="text-base">
-    <implementation implements="nsIDOMXULDescriptionElement, nsIAccessibleProvider">
-      <property name="accessibleType" readonly="true">
-        <getter>
-          <![CDATA[
-            return Components.interfaces.nsIAccessibleProvider.XULText;
-          ]]>
-        </getter>
-      </property>
+  <binding id="text-base" role="xul:text">
+    <implementation implements="nsIDOMXULDescriptionElement">
       <property name="disabled" onset="if (val) this.setAttribute('disabled', 'true');
                                        else this.removeAttribute('disabled');
                                        return val;"
                                 onget="return this.getAttribute('disabled') == 'true';"/>
       <property name="value" onget="return this.getAttribute('value');"
                              onset="this.setAttribute('value', val); return val;"/>
       <property name="crop" onget="return this.getAttribute('crop');"
                             onset="this.setAttribute('crop', val); return val;"/>
@@ -281,25 +274,18 @@
       <handler event="click" action="if (this.disabled) return;
                                      var controlElement = this.labeledControlElement;
                                      if(controlElement)
                                        controlElement.focus();
                                     "/>
     </handlers>
   </binding>
 
-  <binding id="text-link" extends="chrome://global/content/bindings/text.xml#text-label">
-    <implementation implements="nsIAccessibleProvider">
-      <property name="accessibleType" readonly="true">
-        <getter>
-          <![CDATA[
-            return Components.interfaces.nsIAccessibleProvider.XULLink;
-          ]]>
-        </getter>
-      </property>
+  <binding id="text-link" extends="chrome://global/content/bindings/text.xml#text-label" role="xul:link">
+    <implementation>
       <property name="href" onget="return this.getAttribute('href');"
                             onset="this.setAttribute('href', val); return val;" />
       <method name="open">
         <parameter name="aEvent"/>
         <body>
         <![CDATA[
           var href = this.href;
           if (!href || this.disabled || aEvent.defaultPrevented)
--- a/toolkit/content/widgets/textbox.xml
+++ b/toolkit/content/widgets/textbox.xml
@@ -10,39 +10,31 @@
 ]>
 
 <bindings id="textboxBindings"
    xmlns="http://www.mozilla.org/xbl"
    xmlns:html="http://www.w3.org/1999/xhtml"
    xmlns:xul="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
    xmlns:xbl="http://www.mozilla.org/xbl">
 
-  <binding id="textbox" extends="xul:box">
+  <binding id="textbox" extends="xul:box" role="xul:textbox">
     <resources>
       <stylesheet src="chrome://global/content/textbox.css"/>
       <stylesheet src="chrome://global/skin/textbox.css"/>
     </resources>
 
     <content>
       <children/>
       <xul:hbox class="textbox-input-box" flex="1" xbl:inherits="context,spellcheck">
         <html:input class="textbox-input" anonid="input"
                     xbl:inherits="value,type,maxlength,disabled,size,readonly,placeholder,tabindex,accesskey,noinitialfocus,mozactionhint,spellcheck"/>
       </xul:hbox>
     </content>
 
-    <implementation implements="nsIAccessibleProvider, nsIDOMXULTextBoxElement, nsIDOMXULLabeledControlElement">
-      <property name="accessibleType" readonly="true">
-        <getter>
-          <![CDATA[
-            return Components.interfaces.nsIAccessibleProvider.XULTextBox;
-          ]]>
-        </getter>
-      </property>
-
+    <implementation implements="nsIDOMXULTextBoxElement, nsIDOMXULLabeledControlElement">
       <!-- nsIDOMXULLabeledControlElement -->
       <field name="crop">""</field>
       <field name="image">""</field>
       <field name="command">""</field>
       <field name="accessKey">""</field>
 
       <field name="mInputField">null</field>
       <field name="mIgnoreClick">false</field>
--- a/toolkit/content/widgets/toolbar.xml
+++ b/toolkit/content/widgets/toolbar.xml
@@ -88,24 +88,19 @@
             this.insertBefore(toolbar, this.toolbarset);
             return toolbar;
           ]]>
         </body>
       </method>
     </implementation>
   </binding>
   
-  <binding id="toolbar" extends="chrome://global/content/bindings/toolbar.xml#toolbar-base">
-    <implementation implements="nsIAccessibleProvider">
-      <property name="accessibleType" readonly="true">
-        <getter>
-          return Components.interfaces.nsIAccessibleProvider.XULToolbar;
-        </getter>
-      </property>
-      
+  <binding id="toolbar" role="xul:toolbar"
+           extends="chrome://global/content/bindings/toolbar.xml#toolbar-base">
+    <implementation>
       <property name="toolbarName"
                 onget="return this.getAttribute('toolbarname');"
                 onset="this.setAttribute('toolbarname', val); return val;"/>
 
       <field name="_toolbox">null</field>
       <property name="toolbox" readonly="true">
         <getter><![CDATA[
           if (this._toolbox)
@@ -511,25 +506,19 @@
                      this.getAttribute("customizing") != "true";
             };
           } catch (e) {}
         }
       ]]></constructor>
     </implementation>
   </binding>
 
-  <binding id="menubar" extends="chrome://global/content/bindings/toolbar.xml#toolbar-base" display="xul:menubar">
-    <implementation implements="nsIAccessibleProvider">
-      <property name="accessibleType" readonly="true">
-        <getter>
-          <![CDATA[
-            return Components.interfaces.nsIAccessibleProvider.XULMenubar;
-          ]]>
-        </getter>
-       </property>
+  <binding id="menubar" role="xul:menubar" 
+           extends="chrome://global/content/bindings/toolbar.xml#toolbar-base" display="xul:menubar">
+    <implementation>
        <field name="_active">false</field>
        <field name="_statusbar">null</field>
        <field name="_originalStatusText">null</field>
        <property name="statusbar" onget="return this.getAttribute('statusbar');"
                                   onset="this.setAttribute('statusbar', val); return val;"/>
        <method name="_updateStatusText">
           <parameter name="itemText"/>
           <body>
@@ -562,24 +551,17 @@
             this._statusbar.label = this._originalStatusText;
           ]]>
         </handler>
         <handler event="DOMMenuItemActive">this._updateStatusText(event.target.statusText);</handler>
         <handler event="DOMMenuItemInactive">this._updateStatusText("");</handler>
     </handlers>
   </binding>
 
-  <binding id="toolbardecoration" extends="chrome://global/content/bindings/toolbar.xml#toolbar-base">
-    <implementation implements="nsIAccessibleProvider">
-      <property name="accessibleType" readonly="true">
-        <getter>
-          return Components.interfaces.nsIAccessibleProvider.XULToolbarSeparator;
-        </getter>
-      </property>
-    </implementation>
+  <binding id="toolbardecoration" role="xul:toolbarseparator" extends="chrome://global/content/bindings/toolbar.xml#toolbar-base">
   </binding>
 
   <binding id="toolbarpaletteitem" extends="chrome://global/content/bindings/toolbar.xml#toolbar-base" display="xul:button">
     <content>
       <xul:hbox class="toolbarpaletteitem-box" flex="1" xbl:inherits="type,place">
         <children/>
       </xul:hbox>
     </content>
--- a/toolkit/content/widgets/toolbarbutton.xml
+++ b/toolkit/content/widgets/toolbarbutton.xml
@@ -4,36 +4,28 @@
    - file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
 
 
 <bindings id="toolbarbuttonBindings"
    xmlns="http://www.mozilla.org/xbl"
    xmlns:xul="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
    xmlns:xbl="http://www.mozilla.org/xbl">
 
-  <binding id="toolbarbutton" display="xul:button"
+  <binding id="toolbarbutton" display="xul:button" role="xul:toolbarbutton"
            extends="chrome://global/content/bindings/button.xml#button-base">
     <resources>
       <stylesheet src="chrome://global/skin/toolbarbutton.css"/>
     </resources>
     
     <content>
       <children includes="observes|template|menupopup|panel|tooltip"/>
       <xul:image class="toolbarbutton-icon" xbl:inherits="validate,src=image,label"/>
       <xul:label class="toolbarbutton-text" crop="right" flex="1"
                  xbl:inherits="value=label,accesskey,crop"/>
     </content>
-    
-    <implementation implements="nsIAccessibleProvider">
-      <property name="accessibleType" readonly="true">
-        <getter>
-          return Components.interfaces.nsIAccessibleProvider.XULToolbarButton;
-        </getter>
-      </property>
-    </implementation>
   </binding>
 
   <binding id="menu" display="xul:menu" 
            extends="chrome://global/content/bindings/toolbarbutton.xml#toolbarbutton">
     <content>
       <children includes="observes|template|menupopup|panel|tooltip"/>
       <xul:image class="toolbarbutton-icon" xbl:inherits="validate,src=image,label,type"/>
       <xul:label class="toolbarbutton-text" crop="right" flex="1"
--- a/toolkit/content/widgets/tree.xml
+++ b/toolkit/content/widgets/tree.xml
@@ -28,32 +28,32 @@
 #else
           return aEvent.ctrlKey;
 #endif
         ]]></body>
       </method>
     </implementation>
   </binding>
 
-  <binding id="tree" extends="chrome://global/content/bindings/tree.xml#tree-base">
+  <binding id="tree" extends="chrome://global/content/bindings/tree.xml#tree-base" role="xul:tree">
     <content hidevscroll="true" hidehscroll="true" clickthrough="never">
       <children includes="treecols"/>
       <xul:stack class="tree-stack" flex="1">
         <xul:treerows class="tree-rows" flex="1" xbl:inherits="hidevscroll">
           <children/>
         </xul:treerows>
         <xul:textbox anonid="input" class="tree-input" left="0" top="0" hidden="true"/>
       </xul:stack>
       <xul:hbox xbl:inherits="collapsed=hidehscroll">
         <xul:scrollbar orient="horizontal" flex="1" increment="16" style="position:relative; z-index:2147483647;"/>
         <xul:scrollcorner xbl:inherits="collapsed=hidevscroll"/>
       </xul:hbox>
     </content>
     
-    <implementation implements="nsIDOMXULTreeElement, nsIDOMXULMultiSelectControlElement, nsIAccessibleProvider">
+    <implementation implements="nsIDOMXULTreeElement, nsIDOMXULMultiSelectControlElement">
 
       <!-- ///////////////// nsIDOMXULTreeElement ///////////////// -->
 
       <property name="columns"
                 onget="return this.treeBoxObject.columns;"/>
 
       <property name="view"
                 onget="return this.treeBoxObject.view;"
@@ -74,26 +74,16 @@
       <property name="selType"
                 onget="return this.getAttribute('seltype')"
                 onset="this.setAttribute('seltype', val); return val;"/>
 
       <property name="currentIndex"
                 onget="return this.view ? this.view.selection.currentIndex: - 1;"
                 onset="if (this.view) return this.view.selection.currentIndex = val; return val;"/>
 
-      <!-- ///////////////// nsIAccessibleProvider ///////////////// -->
-
-      <property name="accessibleType" readonly="true">
-        <getter>
-          <![CDATA[
-            return Components.interfaces.nsIAccessibleProvider.XULTree;
-          ]]>
-        </getter>
-      </property>
-
       <property name="treeBoxObject"
                 onget="return this.boxObject.QueryInterface(Components.interfaces.nsITreeBoxObject);"
                 readonly="true"/>
 # contentView is obsolete (see bug 202391)
       <property name="contentView"
                 onget="return this.view; /*.QueryInterface(Components.interfaces.nsITreeContentView)*/"
                 readonly="true"/>
 # builderView is obsolete (see bug 202393)
@@ -926,34 +916,27 @@
            }
            event.preventDefault();
          }
          ]]>
       </handler>
     </handlers>    
   </binding>
 
-  <binding id="treecols">
+  <binding id="treecols" role="xul:treecolumns">
     <resources>
       <stylesheet src="chrome://global/skin/tree.css"/>
     </resources>
     <content orient="horizontal">
       <xul:hbox class="tree-scrollable-columns" flex="1">
         <children includes="treecol|splitter"/>
       </xul:hbox>
       <xul:treecolpicker class="treecol-image" fixed="true" xbl:inherits="tooltiptext=pickertooltiptext"/>
     </content>
-    <implementation implements="nsIAccessibleProvider">
-      <property name="accessibleType" readonly="true">
-        <getter>
-          <![CDATA[
-            return Components.interfaces.nsIAccessibleProvider.XULTreeColumns;
-          ]]>
-        </getter>
-      </property>
+    <implementation>
       <constructor><![CDATA[
         // Set resizeafter="farthest" on the splitters if nothing else has been
         // specified.
         Array.forEach(this.getElementsByTagName("splitter"), function (splitter) {
           if (!splitter.hasAttribute("resizeafter"))
             splitter.setAttribute("resizeafter", "farthest");
         });
       ]]></constructor>
@@ -1179,30 +1162,23 @@
         if (col.value != -1 && !col.value.cycler && obj.value != "twisty")
           this.parentNode.changeOpenState(row);
       ]]>
       </handler>
       
     </handlers>
   </binding>
 
-  <binding id="treecol-base" extends="chrome://global/content/bindings/tree.xml#tree-base">
-    <implementation implements="nsIAccessibleProvider">
+  <binding id="treecol-base" role="xul:treecolumnitem"
+           extends="chrome://global/content/bindings/tree.xml#tree-base">
+    <implementation>
       <constructor>
         this.parentNode.parentNode._columnsDirty = true;
       </constructor>
 
-      <property name="accessibleType" readonly="true">
-        <getter>
-          <![CDATA[
-            return Components.interfaces.nsIAccessibleProvider.XULTreeColumnItem;
-          ]]>
-        </getter>
-      </property>
-
       <property name="ordinal">
         <getter><![CDATA[
           var val = this.getAttribute("ordinal");
           return "" + (val == "" ? 1 : (val == "0" ? 0 : parseInt(val)));
         ]]></getter>
         <setter><![CDATA[
           this.setAttribute("ordinal", val);
           return val;
@@ -1404,33 +1380,27 @@
   </binding>
 
   <binding id="treecol-image" extends="chrome://global/content/bindings/tree.xml#treecol-base">
     <content>
       <xul:image class="treecol-icon" xbl:inherits="src"/>
     </content>
   </binding>
 
-  <binding id="columnpicker" display="xul:button"
+  <binding id="columnpicker" display="xul:button" role="xul:button"
            extends="chrome://global/content/bindings/tree.xml#tree-base">
     <content>
       <xul:image class="tree-columnpicker-icon"/>
       <xul:menupopup anonid="popup">
         <xul:menuseparator anonid="menuseparator"/>
         <xul:menuitem anonid="menuitem" label="&restoreColumnOrder.label;"/>
       </xul:menupopup>
     </content>
     
-    <implementation implements="nsIAccessibleProvider">
-      <property name="accessibleType" readonly="true">
-        <getter>
-          return Components.interfaces.nsIAccessibleProvider.XULButton;
-        </getter>
-      </property>
-
+    <implementation>
       <method name="buildPopup">
         <parameter name="aPopup"/>
         <body>
           <![CDATA[
             // We no longer cache the picker content, remove the old content.
             while (aPopup.childNodes.length > 2)
               aPopup.removeChild(aPopup.firstChild);
 
--- a/xpfe/components/autocomplete/resources/content/autocomplete.xml
+++ b/xpfe/components/autocomplete/resources/content/autocomplete.xml
@@ -5,17 +5,17 @@
 
 
 <bindings id="autocompleteBindings"
           xmlns="http://www.mozilla.org/xbl"
           xmlns:html="http://www.w3.org/1999/xhtml"
           xmlns:xul="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
           xmlns:xbl="http://www.mozilla.org/xbl">
 
-  <binding id="autocomplete"
+  <binding id="autocomplete" role="xulcombobox"
            extends="chrome://global/content/bindings/textbox.xml#textbox">
     <resources>
       <stylesheet src="chrome://global/content/autocomplete.css"/>
       <stylesheet src="chrome://global/skin/autocomplete.css"/>
     </resources>
 
     <content sizetopopup="pref">
       <children includes="menupopup"/>
@@ -39,17 +39,17 @@
 
       <xul:popupset>
         <xul:panel type="autocomplete" anonid="popup"
                    ignorekeys="true" noautofocus="true" level="top"
                    xbl:inherits="for=id,nomatch"/>
       </xul:popupset>
     </content>
 
-    <implementation implements="nsIDOMXULMenuListElement, nsIAccessibleProvider">
+    <implementation implements="nsIDOMXULMenuListElement">
 
       <constructor><![CDATA[
         // XXX bug 90337 band-aid until we figure out what's going on here
         if (this.value != this.mInputElt.value)
           this.mInputElt.value = this.value;
         delete this.value;
 
         // listen for pastes
@@ -75,27 +75,16 @@
       ]]></constructor>
 
       <destructor><![CDATA[
         this.clearResults(false);
         window.top.removeEventListener("DOMMenuBarActive", this.mMenuBarListener, true);
         this.mInputElt.controllers.removeController(this.mPasteController);
       ]]></destructor>
 
-      <!-- =================== nsIAccessibleProvider =================== -->
-
-      <property name="accessibleType" readonly="true">
-        <getter>
-          <![CDATA[
-            // Will be exposed as nsIAccessible::ROLE_AUTOCOMPLETE
-            return Components.interfaces.nsIAccessibleProvider.XULCombobox;
-          ]]>
-        </getter>
-      </property>
-
       <!-- =================== nsIAutoCompleteInput =================== -->
       <!-- XXX: This implementation is currently incomplete. -->
 
       <!-- reference to the results popup element -->
       <field name="popup"><![CDATA[
         document.getAnonymousElementByAttribute(this, "anonid", "popup");
       ]]></field>