Backed out changeset 564cb9725e12 (bug 1442800) for failing on browser_test_docload.js on a CLOSED TREE
authorGurzau Raul <rgurzau@mozilla.com>
Fri, 09 Mar 2018 01:19:51 +0200
changeset 459766 ac61f51908f89d7c4fe347cc88f6c5748078dd90
parent 459765 f01d2ea74eb5438ec54035fd99e4c8239a540345
child 459792 2b44ea19f287a5f65acf41526d360d980c24f425
push id8824
push userarchaeopteryx@coole-files.de
push dateMon, 12 Mar 2018 14:54:48 +0000
treeherdermozilla-beta@8d9daab95d68 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1442800
milestone60.0a1
backs out564cb9725e123d59f6f12bd8af3625dcee32a292
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Backed out changeset 564cb9725e12 (bug 1442800) for failing on browser_test_docload.js on a CLOSED TREE
accessible/base/XULMap.h
accessible/base/nsAccessibilityService.cpp
accessible/base/nsAccessibilityService.h
--- a/accessible/base/XULMap.h
+++ b/accessible/base/XULMap.h
@@ -39,148 +39,158 @@ XULMAP_TYPE(treecol, XULColumnItemAccess
 XULMAP_TYPE(treecolpicker, XULButtonAccessible)
 XULMAP_TYPE(treecols, XULTreeColumAccessible)
 XULMAP_TYPE(toolbar, XULToolbarAccessible)
 XULMAP_TYPE(toolbarbutton, XULToolbarButtonAccessible)
 XULMAP_TYPE(tooltip, XULTooltipAccessible)
 
 XULMAP(
   colorpicker,
-  [](Element* aElement, Accessible* aContext) -> Accessible* {
-    if (aElement->AttrValueIs(kNameSpaceID_None, nsGkAtoms::type,
-                              nsGkAtoms::button, eIgnoreCase)) {
-      return new XULColorPickerAccessible(aElement, aContext->Document());
+  [](nsIContent* aContent, Accessible* aContext) -> Accessible* {
+    if (aContent->IsElement() &&
+        aContent->AsElement()->AttrValueIs(kNameSpaceID_None, nsGkAtoms::type,
+                                           nsGkAtoms::button, eIgnoreCase)) {
+      return new XULColorPickerAccessible(aContent, aContext->Document());
     }
     return nullptr;
   }
 )
 
 XULMAP(
   label,
-  [](Element* aElement, Accessible* aContext) -> Accessible* {
-    if (aElement->ClassList()->Contains(NS_LITERAL_STRING("text-link"))) {
-      return new XULLinkAccessible(aElement, aContext->Document());
+  [](nsIContent* aContent, Accessible* aContext) -> Accessible* {
+    if (aContent->IsElement() &&
+        aContent->AsElement()->ClassList()->Contains(NS_LITERAL_STRING("text-link"))) {
+      return new XULLinkAccessible(aContent, aContext->Document());
     }
-    return new XULLabelAccessible(aElement, aContext->Document());
+    return new XULLabelAccessible(aContent, aContext->Document());
   }
 )
 
 XULMAP(
   image,
-  [](Element* aElement, Accessible* aContext) -> Accessible* {
-    if (aElement->HasAttr(kNameSpaceID_None, nsGkAtoms::onclick)) {
-      return new XULToolbarButtonAccessible(aElement, aContext->Document());
+  [](nsIContent* aContent, Accessible* aContext) -> Accessible* {
+    if (!aContent->IsElement()) {
+      return nullptr;
     }
 
-    if (aElement->ClassList()->Contains(NS_LITERAL_STRING("colorpickertile"))) {
-      return new XULColorPickerTileAccessible(aElement, aContext->Document());
+    if (aContent->AsElement()->HasAttr(kNameSpaceID_None, nsGkAtoms::onclick)) {
+      return new XULToolbarButtonAccessible(aContent, aContext->Document());
+    }
+
+    if (aContent->AsElement()->ClassList()->Contains(NS_LITERAL_STRING("colorpickertile"))) {
+      return new XULColorPickerTileAccessible(aContent, aContext->Document());
     }
 
     // Don't include nameless images in accessible tree.
-    if (!aElement->HasAttr(kNameSpaceID_None, nsGkAtoms::tooltiptext)) {
+    if (!aContent->AsElement()->HasAttr(kNameSpaceID_None, nsGkAtoms::tooltiptext)) {
       return nullptr;
     }
 
-    return new ImageAccessibleWrap(aElement, aContext->Document());
+    return new ImageAccessibleWrap(aContent, aContext->Document());
   }
 )
 
 XULMAP(
   listcell,
-  [](Element* aElement, Accessible* aContext) -> Accessible* {
+  [](nsIContent* aContent, Accessible* aContext) -> Accessible* {
     // Only create cells if there's more than one per row.
-    nsIContent* listItem = aElement->GetParent();
+    nsIContent* listItem = aContent->GetParent();
     if (!listItem) {
       return nullptr;
     }
 
     for (nsIContent* child = listItem->GetFirstChild(); child;
          child = child->GetNextSibling()) {
-      if (child->IsXULElement(nsGkAtoms::listcell) && child != aElement) {
-        return new XULListCellAccessibleWrap(aElement, aContext->Document());
+      if (child->IsXULElement(nsGkAtoms::listcell) && child != aContent) {
+        return new XULListCellAccessibleWrap(aContent, aContext->Document());
       }
     }
 
     return nullptr;
   }
 )
 
 XULMAP(
   menupopup,
-  [](Element* aElement, Accessible* aContext) {
-    return CreateMenupopupAccessible(aElement, aContext);
+  [](nsIContent* aContent, Accessible* aContext) {
+    return CreateMenupopupAccessible(aContent, aContext);
   }
 )
 
 XULMAP(
   panel,
-  [](Element* aElement, Accessible* aContext) -> Accessible* {
+  [](nsIContent* aContent, Accessible* aContext) -> Accessible* {
     static const Element::AttrValuesArray sIgnoreTypeVals[] =
       { &nsGkAtoms::autocomplete_richlistbox, &nsGkAtoms::autocomplete, nullptr };
 
-    if (aElement->FindAttrValueIn(kNameSpaceID_None, nsGkAtoms::type,
-                                  sIgnoreTypeVals, eIgnoreCase) >= 0) {
+    if (!aContent->IsElement() ||
+        aContent->AsElement()->FindAttrValueIn(kNameSpaceID_None, nsGkAtoms::type,
+                                               sIgnoreTypeVals, eIgnoreCase) >= 0) {
       return nullptr;
     }
 
-    if (aElement->AttrValueIs(kNameSpaceID_None, nsGkAtoms::noautofocus,
-                              nsGkAtoms::_true, eCaseMatters)) {
-      return new XULAlertAccessible(aElement, aContext->Document());
+    if (aContent->AsElement()->AttrValueIs(kNameSpaceID_None,
+                                           nsGkAtoms::noautofocus,
+                                           nsGkAtoms::_true, eCaseMatters)) {
+      return new XULAlertAccessible(aContent, aContext->Document());
     }
 
-    return new EnumRoleAccessible<roles::PANE>(aElement, aContext->Document());
+    return new EnumRoleAccessible<roles::PANE>(aContent, aContext->Document());
   }
 )
 
 XULMAP(
   popup,
-  [](Element* aElement, Accessible* aContext) {
-    return CreateMenupopupAccessible(aElement, aContext);
+  [](nsIContent* aContent, Accessible* aContext) {
+    return CreateMenupopupAccessible(aContent, aContext);
   }
 )
 
 XULMAP(
   textbox,
-  [](Element* aElement, Accessible* aContext) -> Accessible* {
-    if (aElement->AttrValueIs(kNameSpaceID_None, nsGkAtoms::type,
-                              nsGkAtoms::autocomplete, eIgnoreCase)) {
-      return new XULComboboxAccessible(aElement, aContext->Document());
+  [](nsIContent* aContent, Accessible* aContext) -> Accessible* {
+    if (aContent->IsElement() &&
+        aContent->AsElement()->AttrValueIs(kNameSpaceID_None, nsGkAtoms::type,
+                                           nsGkAtoms::autocomplete, eIgnoreCase)) {
+      return new XULComboboxAccessible(aContent, aContext->Document());
     }
 
-    return new EnumRoleAccessible<roles::SECTION>(aElement, aContext->Document());
+    return new EnumRoleAccessible<roles::SECTION>(aContent, aContext->Document());
   }
 )
 
 XULMAP(
   thumb,
-  [](Element* aElement, Accessible* aContext) -> Accessible* {
-    if (aElement->ClassList()->Contains(NS_LITERAL_STRING("scale-thumb"))) {
-      return new XULThumbAccessible(aElement, aContext->Document());
+  [](nsIContent* aContent, Accessible* aContext) -> Accessible* {
+    if (aContent->IsElement() &&
+        aContent->AsElement()->ClassList()->Contains(NS_LITERAL_STRING("scale-thumb"))) {
+      return new XULThumbAccessible(aContent, aContext->Document());
     }
     return nullptr;
   }
 )
 
 XULMAP(
   tree,
-  [](Element* aElement, Accessible* aContext) -> Accessible* {
-    nsIContent* child = nsTreeUtils::GetDescendantChild(aElement,
+  [](nsIContent* aContent, Accessible* aContext) -> Accessible* {
+    nsIContent* child = nsTreeUtils::GetDescendantChild(aContent,
                                                         nsGkAtoms::treechildren);
     if (!child)
       return nullptr;
 
     nsTreeBodyFrame* treeFrame = do_QueryFrame(child->GetPrimaryFrame());
     if (!treeFrame)
       return nullptr;
 
     RefPtr<nsTreeColumns> treeCols = treeFrame->Columns();
     int32_t count = 0;
     treeCols->GetCount(&count);
 
     // Outline of list accessible.
     if (count == 1) {
-      return new XULTreeAccessible(aElement, aContext->Document(), treeFrame);
+      return new XULTreeAccessible(aContent, aContext->Document(), treeFrame);
     }
 
     // Table or tree table accessible.
-    return new XULTreeGridAccessibleWrap(aElement, aContext->Document(), treeFrame);
+    return new XULTreeGridAccessibleWrap(aContent, aContext->Document(), treeFrame);
   }
 )
--- a/accessible/base/nsAccessibilityService.cpp
+++ b/accessible/base/nsAccessibilityService.cpp
@@ -144,153 +144,159 @@ MustBeAccessible(nsIContent* aContent, D
   return false;
 }
 
 /**
  * Used by XULMap.h to map both menupopup and popup elements
  */
 #ifdef MOZ_XUL
 Accessible*
-CreateMenupopupAccessible(Element* aElement, Accessible* aContext)
+CreateMenupopupAccessible(nsIContent* aContent, Accessible* aContext)
 {
 #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 = aElement->GetParent();
+    nsIContent *parent = aContent->GetParent();
     if (parent && parent->IsXULElement(nsGkAtoms::menu))
       return nullptr;
 #endif
 
-    return new XULMenupopupAccessible(aElement, aContext->Document());
+    return new XULMenupopupAccessible(aContent, aContext->Document());
 }
 #endif
 
 ////////////////////////////////////////////////////////////////////////////////
 // Accessible constructors
 
 static Accessible*
-New_HTMLLink(Element* aElement, Accessible* aContext)
+New_HTMLLink(nsIContent* aContent, Accessible* aContext)
 {
   // Only some roles truly enjoy life as HTMLLinkAccessibles, for details
   // see closed bug 494807.
-  const nsRoleMapEntry* roleMapEntry = aria::GetRoleMap(aElement);
+  const nsRoleMapEntry* roleMapEntry = aria::GetRoleMap(aContent->AsElement());
   if (roleMapEntry && roleMapEntry->role != roles::NOTHING &&
       roleMapEntry->role != roles::LINK) {
-    return new HyperTextAccessibleWrap(aElement, aContext->Document());
+    return new HyperTextAccessibleWrap(aContent, aContext->Document());
   }
 
-  return new HTMLLinkAccessible(aElement, aContext->Document());
+  return new HTMLLinkAccessible(aContent, aContext->Document());
 }
 
-static Accessible* New_HyperText(Element* aElement, Accessible* aContext)
-  { return new HyperTextAccessibleWrap(aElement, aContext->Document()); }
+static Accessible* New_HyperText(nsIContent* aContent, Accessible* aContext)
+  { return new HyperTextAccessibleWrap(aContent, aContext->Document()); }
 
-static Accessible* New_HTMLFigcaption(Element* aElement, Accessible* aContext)
-  { return new HTMLFigcaptionAccessible(aElement, aContext->Document()); }
+static Accessible* New_HTMLFigcaption(nsIContent* aContent, Accessible* aContext)
+  { return new HTMLFigcaptionAccessible(aContent, aContext->Document()); }
 
-static Accessible* New_HTMLFigure(Element* aElement, Accessible* aContext)
-  { return new HTMLFigureAccessible(aElement, aContext->Document()); }
+static Accessible* New_HTMLFigure(nsIContent* aContent, Accessible* aContext)
+  { return new HTMLFigureAccessible(aContent, aContext->Document()); }
 
-static Accessible* New_HTMLHeaderOrFooter(Element* aElement, Accessible* aContext)
-  { return new HTMLHeaderOrFooterAccessible(aElement, aContext->Document()); }
+static Accessible* New_HTMLHeaderOrFooter(nsIContent* aContent, Accessible* aContext)
+  { return new HTMLHeaderOrFooterAccessible(aContent, aContext->Document()); }
 
-static Accessible* New_HTMLLegend(Element* aElement, Accessible* aContext)
-  { return new HTMLLegendAccessible(aElement, aContext->Document()); }
+static Accessible* New_HTMLLegend(nsIContent* aContent, Accessible* aContext)
+  { return new HTMLLegendAccessible(aContent, aContext->Document()); }
 
-static Accessible* New_HTMLOption(Element* aElement, Accessible* aContext)
-  { return new HTMLSelectOptionAccessible(aElement, aContext->Document()); }
+static Accessible* New_HTMLOption(nsIContent* aContent, Accessible* aContext)
+  { return new HTMLSelectOptionAccessible(aContent, aContext->Document()); }
 
-static Accessible* New_HTMLOptgroup(Element* aElement, Accessible* aContext)
-  { return new HTMLSelectOptGroupAccessible(aElement, aContext->Document()); }
+static Accessible* New_HTMLOptgroup(nsIContent* aContent, Accessible* aContext)
+  { return new HTMLSelectOptGroupAccessible(aContent, aContext->Document()); }
 
-static Accessible* New_HTMLList(Element* aElement, Accessible* aContext)
-  { return new HTMLListAccessible(aElement, aContext->Document()); }
+static Accessible* New_HTMLList(nsIContent* aContent, Accessible* aContext)
+  { return new HTMLListAccessible(aContent, aContext->Document()); }
 
 static Accessible*
-New_HTMLListitem(Element* aElement, Accessible* aContext)
+New_HTMLListitem(nsIContent* aContent, Accessible* aContext)
 {
   // If list item is a child of accessible list then create an accessible for
   // it unconditionally by tag name. nsBlockFrame creates the list item
   // accessible for other elements styled as list items.
-  if (aContext->IsList() && aContext->GetContent() == aElement->GetParent())
-    return new HTMLLIAccessible(aElement, aContext->Document());
+  if (aContext->IsList() && aContext->GetContent() == aContent->GetParent())
+    return new HTMLLIAccessible(aContent, aContext->Document());
 
   return nullptr;
 }
 
 static Accessible*
-New_HTMLDefinition(Element* aElement, Accessible* aContext)
+New_HTMLDefinition(nsIContent* aContent, Accessible* aContext)
 {
   if (aContext->IsList())
-    return new HyperTextAccessibleWrap(aElement, aContext->Document());
+    return new HyperTextAccessibleWrap(aContent, aContext->Document());
   return nullptr;
 }
 
-static Accessible* New_HTMLLabel(Element* aElement, Accessible* aContext)
-  { return new HTMLLabelAccessible(aElement, aContext->Document()); }
+static Accessible* New_HTMLLabel(nsIContent* aContent, Accessible* aContext)
+  { return new HTMLLabelAccessible(aContent, aContext->Document()); }
 
-static Accessible* New_HTMLInput(Element* aElement, Accessible* aContext)
+static Accessible* New_HTMLInput(nsIContent* aContent, Accessible* aContext)
 {
-  if (aElement->AttrValueIs(kNameSpaceID_None, nsGkAtoms::type,
-                           nsGkAtoms::checkbox, eIgnoreCase)) {
-    return new HTMLCheckboxAccessible(aElement, aContext->Document());
+  if (!aContent->IsElement()) {
+    return nullptr;
   }
-  if (aElement->AttrValueIs(kNameSpaceID_None, nsGkAtoms::type,
+
+  Element* element = aContent->AsElement();
+  if (element->AttrValueIs(kNameSpaceID_None, nsGkAtoms::type,
+                           nsGkAtoms::checkbox, eIgnoreCase)) {
+    return new HTMLCheckboxAccessible(aContent, aContext->Document());
+  }
+  if (element->AttrValueIs(kNameSpaceID_None, nsGkAtoms::type,
                            nsGkAtoms::radio, eIgnoreCase)) {
-    return new HTMLRadioButtonAccessible(aElement, aContext->Document());
+    return new HTMLRadioButtonAccessible(aContent, aContext->Document());
   }
-  if (aElement->AttrValueIs(kNameSpaceID_None, nsGkAtoms::type,
+  if (element->AttrValueIs(kNameSpaceID_None, nsGkAtoms::type,
                            nsGkAtoms::time, eIgnoreCase)) {
-    return new EnumRoleAccessible<roles::GROUPING>(aElement, aContext->Document());
+    return new EnumRoleAccessible<roles::GROUPING>(aContent, aContext->Document());
   }
-  if (aElement->AttrValueIs(kNameSpaceID_None, nsGkAtoms::type,
+  if (element->AttrValueIs(kNameSpaceID_None, nsGkAtoms::type,
                            nsGkAtoms::date, eIgnoreCase)) {
-    return new EnumRoleAccessible<roles::DATE_EDITOR>(aElement, aContext->Document());
+    return new EnumRoleAccessible<roles::DATE_EDITOR>(aContent, aContext->Document());
   }
   return nullptr;
 }
 
-static Accessible* New_HTMLOutput(Element* aElement, Accessible* aContext)
-  { return new HTMLOutputAccessible(aElement, aContext->Document()); }
+static Accessible* New_HTMLOutput(nsIContent* aContent, Accessible* aContext)
+  { return new HTMLOutputAccessible(aContent, aContext->Document()); }
 
-static Accessible* New_HTMLProgress(Element* aElement, Accessible* aContext)
-  { return new HTMLProgressMeterAccessible(aElement, aContext->Document()); }
+static Accessible* New_HTMLProgress(nsIContent* aContent, Accessible* aContext)
+  { return new HTMLProgressMeterAccessible(aContent, aContext->Document()); }
 
-static Accessible* New_HTMLSummary(Element* aElement, Accessible* aContext)
-  { return new HTMLSummaryAccessible(aElement, aContext->Document()); }
+static Accessible* New_HTMLSummary(nsIContent* aContent, Accessible* aContext)
+  { return new HTMLSummaryAccessible(aContent, aContext->Document()); }
 
 static Accessible*
-New_HTMLTableAccessible(Element* aElement, Accessible* aContext)
-  { return new HTMLTableAccessible(aElement, aContext->Document()); }
+New_HTMLTableAccessible(nsIContent* aContent, Accessible* aContext)
+  { return new HTMLTableAccessible(aContent, aContext->Document()); }
 
 static Accessible*
-New_HTMLTableRowAccessible(Element* aElement, Accessible* aContext)
-  { return new HTMLTableRowAccessible(aElement, aContext->Document()); }
+New_HTMLTableRowAccessible(nsIContent* aContent, Accessible* aContext)
+  { return new HTMLTableRowAccessible(aContent, aContext->Document()); }
 
 static Accessible*
-New_HTMLTableCellAccessible(Element* aElement, Accessible* aContext)
-  { return new HTMLTableCellAccessible(aElement, aContext->Document()); }
+New_HTMLTableCellAccessible(nsIContent* aContent, Accessible* aContext)
+  { return new HTMLTableCellAccessible(aContent, aContext->Document()); }
 
 static Accessible*
-New_HTMLTableHeaderCell(Element* aElement, Accessible* aContext)
+New_HTMLTableHeaderCell(nsIContent* aContent, Accessible* aContext)
 {
-  if (aContext->IsTableRow() && aContext->GetContent() == aElement->GetParent())
-    return new HTMLTableHeaderCellAccessibleWrap(aElement, aContext->Document());
+  if (aContext->IsTableRow() && aContext->GetContent() == aContent->GetParent())
+    return new HTMLTableHeaderCellAccessibleWrap(aContent, aContext->Document());
   return nullptr;
 }
 
 static Accessible*
-New_HTMLTableHeaderCellIfScope(Element* aElement, Accessible* aContext)
+New_HTMLTableHeaderCellIfScope(nsIContent* aContent, Accessible* aContext)
 {
-  if (aContext->IsTableRow() && aContext->GetContent() == aElement->GetParent() &&
-      aElement->HasAttr(kNameSpaceID_None, nsGkAtoms::scope))
-    return new HTMLTableHeaderCellAccessibleWrap(aElement, aContext->Document());
+  if (aContext->IsTableRow() && aContext->GetContent() == aContent->GetParent() &&
+      aContent->IsElement() &&
+      aContent->AsElement()->HasAttr(kNameSpaceID_None, nsGkAtoms::scope))
+    return new HTMLTableHeaderCellAccessibleWrap(aContent, aContext->Document());
   return nullptr;
 }
 
 /**
  * Cached value of the PREF_ACCESSIBILITY_FORCE_DISABLED preference.
  */
 static int32_t sPlatformDisabledState = 0;
 
@@ -317,18 +323,18 @@ static const HTMLMarkupMapInfo sHTMLMark
 
 #ifdef MOZ_XUL
 #define XULMAP(atom, ...) \
   { &nsGkAtoms::atom, __VA_ARGS__ },
 
 #define XULMAP_TYPE(atom, new_type) \
 XULMAP( \
   atom, \
-  [](Element* aElement, Accessible* aContext) -> Accessible* { \
-    return new new_type(aElement, aContext->Document()); \
+  [](nsIContent* aContent, Accessible* aContext) -> Accessible* { \
+    return new new_type(aContent, aContext->Document()); \
   } \
 )
 
 static const XULMarkupMapInfo sXULMarkupMapList[] = {
   #include "XULMap.h"
 };
 
 #undef XULMAP_TYPE
@@ -1167,17 +1173,17 @@ nsAccessibilityService::CreateAccessible
     if (!isARIATablePart ||
         frame->AccessibleType() == eHTMLTableCellType ||
         frame->AccessibleType() == eHTMLTableRowType ||
         frame->AccessibleType() == eHTMLTableType) {
       // Prefer to use markup to decide if and what kind of accessible to create,
       const HTMLMarkupMapInfo* markupMap =
         mHTMLMarkupMap.Get(content->NodeInfo()->NameAtom());
       if (markupMap && markupMap->new_func)
-        newAcc = markupMap->new_func(content->AsElement(), aContext);
+        newAcc = markupMap->new_func(content, aContext);
 
       if (!newAcc) // try by frame accessible type.
         newAcc = CreateAccessibleByFrameType(frame, content, aContext);
     }
 
     // In case of ARIA grid or table use table-specific classes if it's not
     // native table based.
     if (isARIATablePart && (!newAcc || newAcc->IsGenericHyperText())) {
@@ -1230,17 +1236,17 @@ nsAccessibilityService::CreateAccessible
       }
     }
 
 #ifdef MOZ_XUL
     // Prefer to use XUL to decide if and what kind of accessible to create.
     const XULMarkupMapInfo* xulMap =
       mXULMarkupMap.Get(content->NodeInfo()->NameAtom());
     if (xulMap && xulMap->new_func) {
-      newAcc = xulMap->new_func(content->AsElement(), aContext);
+      newAcc = xulMap->new_func(content, aContext);
     }
 #endif
 
     // Any XUL box can be used as tabpanel, make sure we create a proper
     // accessible for it.
     if (!newAcc && aContext->IsXULTabpanels() &&
         content->GetParent() == aContext->GetContent()) {
       LayoutFrameType frameType = frame->Type();
@@ -1262,17 +1268,17 @@ nsAccessibilityService::CreateAccessible
       } else if (content->IsSVGElement(nsGkAtoms::svg)) {
         newAcc = new EnumRoleAccessible<roles::DIAGRAM>(content, document);
       }
 
     } else if (content->IsMathMLElement()) {
       const HTMLMarkupMapInfo* markupMap =
         mHTMLMarkupMap.Get(content->NodeInfo()->NameAtom());
       if (markupMap && markupMap->new_func)
-        newAcc = markupMap->new_func(content->AsElement(), aContext);
+        newAcc = markupMap->new_func(content, aContext);
 
       // Fall back to text when encountering Content MathML.
       if (!newAcc && !content->IsAnyOfMathMLElements(nsGkAtoms::annotation_,
                                                      nsGkAtoms::annotation_xml_,
                                                      nsGkAtoms::mpadded_,
                                                      nsGkAtoms::mphantom_,
                                                      nsGkAtoms::maligngroup_,
                                                      nsGkAtoms::malignmark_,
--- a/accessible/base/nsAccessibilityService.h
+++ b/accessible/base/nsAccessibilityService.h
@@ -46,17 +46,17 @@ FocusManager* FocusMgr();
 SelectionManager* SelectionMgr();
 
 /**
  * Returns the application accessible.
  */
 ApplicationAccessible* ApplicationAcc();
 xpcAccessibleApplication* XPCApplicationAcc();
 
-typedef Accessible* (New_Accessible)(Element* aElement, Accessible* aContext);
+typedef Accessible* (New_Accessible)(nsIContent* aContent, Accessible* aContext);
 
 struct MarkupAttrInfo {
   nsStaticAtom** name;
   nsStaticAtom** value;
 
   nsStaticAtom** DOMAttrName;
   nsStaticAtom** DOMAttrValue;
 };