Bug 1438193 - part7: NativeRole r=surkov
authorTokio Kajitsuka <kajitsuka-tokio@g.ecc.u-tokyo.ac.jp>
Tue, 08 May 2018 04:05:50 +0900
changeset 794969 6d057f79731365555281285f6a5441febc168e62
parent 794968 77c70362d3c7b3e4b5f812dc94a6c01162cc0bb7
child 794970 bd1542eb559c021caac8a36787a6c891440fac4b
push id109827
push usermozilla@noorenberghe.ca
push dateMon, 14 May 2018 20:13:54 +0000
reviewerssurkov
bugs1438193
milestone62.0a1
Bug 1438193 - part7: NativeRole r=surkov turn NativeRole into const functions
accessible/generic/ARIAGridAccessible.cpp
accessible/generic/ARIAGridAccessible.h
accessible/generic/Accessible.cpp
accessible/generic/Accessible.h
accessible/generic/ApplicationAccessible.cpp
accessible/generic/ApplicationAccessible.h
accessible/generic/BaseAccessibles.h
accessible/generic/DocAccessible.cpp
accessible/generic/DocAccessible.h
accessible/generic/FormControlAccessible.cpp
accessible/generic/FormControlAccessible.h
accessible/generic/HyperTextAccessible.cpp
accessible/generic/HyperTextAccessible.h
accessible/generic/ImageAccessible.cpp
accessible/generic/ImageAccessible.h
accessible/generic/OuterDocAccessible.cpp
accessible/generic/OuterDocAccessible.h
accessible/generic/RootAccessible.cpp
accessible/generic/RootAccessible.h
accessible/generic/TextLeafAccessible.cpp
accessible/generic/TextLeafAccessible.h
accessible/html/HTMLCanvasAccessible.cpp
accessible/html/HTMLCanvasAccessible.h
accessible/html/HTMLElementAccessibles.cpp
accessible/html/HTMLElementAccessibles.h
accessible/html/HTMLFormControlAccessible.cpp
accessible/html/HTMLFormControlAccessible.h
accessible/html/HTMLImageMapAccessible.cpp
accessible/html/HTMLImageMapAccessible.h
accessible/html/HTMLLinkAccessible.cpp
accessible/html/HTMLLinkAccessible.h
accessible/html/HTMLListAccessible.cpp
accessible/html/HTMLListAccessible.h
accessible/html/HTMLSelectAccessible.cpp
accessible/html/HTMLSelectAccessible.h
accessible/html/HTMLTableAccessible.cpp
accessible/html/HTMLTableAccessible.h
accessible/windows/msaa/HTMLWin32ObjectAccessible.cpp
accessible/windows/msaa/HTMLWin32ObjectAccessible.h
accessible/xul/XULAlertAccessible.cpp
accessible/xul/XULAlertAccessible.h
accessible/xul/XULColorPickerAccessible.cpp
accessible/xul/XULColorPickerAccessible.h
accessible/xul/XULComboboxAccessible.cpp
accessible/xul/XULComboboxAccessible.h
accessible/xul/XULElementAccessibles.cpp
accessible/xul/XULElementAccessibles.h
accessible/xul/XULFormControlAccessible.cpp
accessible/xul/XULFormControlAccessible.h
accessible/xul/XULListboxAccessible.cpp
accessible/xul/XULListboxAccessible.h
accessible/xul/XULMenuAccessible.cpp
accessible/xul/XULMenuAccessible.h
accessible/xul/XULSliderAccessible.cpp
accessible/xul/XULSliderAccessible.h
accessible/xul/XULTabAccessible.cpp
accessible/xul/XULTabAccessible.h
accessible/xul/XULTreeAccessible.cpp
accessible/xul/XULTreeAccessible.h
accessible/xul/XULTreeGridAccessible.cpp
accessible/xul/XULTreeGridAccessible.h
--- a/accessible/generic/ARIAGridAccessible.cpp
+++ b/accessible/generic/ARIAGridAccessible.cpp
@@ -29,17 +29,17 @@ using namespace mozilla::a11y;
 ARIAGridAccessible::
   ARIAGridAccessible(nsIContent* aContent, DocAccessible* aDoc) :
   AccessibleWrap(aContent, aDoc)
 {
   mGenericTypes |= eTable;
 }
 
 role
-ARIAGridAccessible::NativeRole()
+ARIAGridAccessible::NativeRole() const
 {
   a11y::role r = GetAccService()->MarkupRole(mContent);
   return r != roles::NOTHING ? r : roles::TABLE;
 }
 
 ////////////////////////////////////////////////////////////////////////////////
 // Table
 
@@ -545,17 +545,17 @@ ARIAGridAccessible::SetARIASelected(Acce
 ARIARowAccessible::
   ARIARowAccessible(nsIContent* aContent, DocAccessible* aDoc) :
   AccessibleWrap(aContent, aDoc)
 {
   mGenericTypes |= eTableRow;
 }
 
 role
-ARIARowAccessible::NativeRole()
+ARIARowAccessible::NativeRole() const
 {
   a11y::role r = GetAccService()->MarkupRole(mContent);
   return r != roles::NOTHING ? r : roles::ROW;
 }
 
 GroupPos
 ARIARowAccessible::GroupPosition()
 {
@@ -582,17 +582,17 @@ ARIARowAccessible::GroupPosition()
 ARIAGridCellAccessible::
   ARIAGridCellAccessible(nsIContent* aContent, DocAccessible* aDoc) :
   HyperTextAccessibleWrap(aContent, aDoc)
 {
   mGenericTypes |= eTableCell;
 }
 
 role
-ARIAGridCellAccessible::NativeRole()
+ARIAGridCellAccessible::NativeRole() const
 {
   a11y::role r = GetAccService()->MarkupRole(mContent);
   return r != roles::NOTHING ? r : roles::CELL;
 }
 
 ////////////////////////////////////////////////////////////////////////////////
 // TableCell
 
--- a/accessible/generic/ARIAGridAccessible.h
+++ b/accessible/generic/ARIAGridAccessible.h
@@ -20,17 +20,17 @@ class ARIAGridAccessible : public Access
                            public TableAccessible
 {
 public:
   ARIAGridAccessible(nsIContent* aContent, DocAccessible* aDoc);
 
   NS_INLINE_DECL_REFCOUNTING_INHERITED(ARIAGridAccessible, AccessibleWrap)
 
   // Accessible
-  virtual a11y::role NativeRole() override;
+  virtual a11y::role NativeRole() const override;
   virtual TableAccessible* AsTable() override { return this; }
 
   // TableAccessible
   virtual uint32_t ColCount() const override;
   virtual uint32_t RowCount() override;
   virtual Accessible* CellAt(uint32_t aRowIndex, uint32_t aColumnIndex) override;
   virtual bool IsColSelected(uint32_t aColIdx) override;
   virtual bool IsRowSelected(uint32_t aRowIdx) override;
@@ -80,17 +80,17 @@ protected:
 class ARIARowAccessible : public AccessibleWrap
 {
 public:
   ARIARowAccessible(nsIContent* aContent, DocAccessible* aDoc);
 
   NS_INLINE_DECL_REFCOUNTING_INHERITED(ARIARowAccessible, AccessibleWrap)
 
   // Accessible
-  virtual a11y::role NativeRole() override;
+  virtual a11y::role NativeRole() const override;
   virtual mozilla::a11y::GroupPos GroupPosition() override;
 
 protected:
   virtual ~ARIARowAccessible() {}
 };
 
 
 /**
@@ -101,17 +101,17 @@ class ARIAGridCellAccessible : public Hy
 {
 public:
   ARIAGridCellAccessible(nsIContent* aContent, DocAccessible* aDoc);
 
   NS_INLINE_DECL_REFCOUNTING_INHERITED(ARIAGridCellAccessible,
                                        HyperTextAccessibleWrap)
 
   // Accessible
-  virtual a11y::role NativeRole() override;
+  virtual a11y::role NativeRole() const override;
   virtual TableCellAccessible* AsTableCell() override { return this; }
   virtual void ApplyARIAState(uint64_t* aState) const override;
   virtual already_AddRefed<nsIPersistentProperties> NativeAttributes() override;
   virtual mozilla::a11y::GroupPos GroupPosition() override;
 
 protected:
   virtual ~ARIAGridCellAccessible() {}
 
--- a/accessible/generic/Accessible.cpp
+++ b/accessible/generic/Accessible.cpp
@@ -316,17 +316,17 @@ Accessible::TranslateString(const nsStri
   nsAutoString xsValue;
   nsresult rv =
     stringBundle->GetStringFromName(NS_ConvertUTF16toUTF8(aKey).get(), xsValue);
   if (NS_SUCCEEDED(rv))
     aStringOut.Assign(xsValue);
 }
 
 uint64_t
-Accessible::VisibilityState()
+Accessible::VisibilityState() const
 {
   nsIFrame* frame = GetFrame();
   if (!frame)
     return states::INVISIBLE;
 
   // Walk the parent frame chain to see if there's invisible parent or the frame
   // is in background tab.
   if (!frame->StyleVisibility()->IsVisible())
@@ -1509,17 +1509,17 @@ nsAtom*
 Accessible::LandmarkRole() const
 {
   const nsRoleMapEntry* roleMapEntry = ARIARoleMap();
   return roleMapEntry && roleMapEntry->IsOfType(eLandmark) ?
     *(roleMapEntry->roleAtom) : nullptr;
 }
 
 role
-Accessible::NativeRole()
+Accessible::NativeRole() const
 {
   return roles::NOTHING;
 }
 
 uint8_t
 Accessible::ActionCount()
 {
   return GetActionRule() == eNoAction ? 0 : 1;
--- a/accessible/generic/Accessible.h
+++ b/accessible/generic/Accessible.h
@@ -246,17 +246,17 @@ public:
    * Return a landmark role if applied.
    */
   virtual nsAtom* LandmarkRole() const;
 
   /**
    * Returns enumerated accessible role from native markup (see constants in
    * Role.h). Doesn't take into account ARIA roles.
    */
-  virtual mozilla::a11y::role NativeRole();
+  virtual mozilla::a11y::role NativeRole() const;
 
   /**
    * Return all states of accessible (including ARIA states).
    */
   virtual uint64_t State();
 
   /**
    * Return interactive states present on the accessible
@@ -303,17 +303,17 @@ public:
   /**
    * Return native link states present on the accessible.
    */
   virtual uint64_t NativeLinkState() const;
 
   /**
    * Return bit set of invisible and offscreen states.
    */
-  uint64_t VisibilityState();
+  uint64_t VisibilityState() const;
 
   /**
    * Return true if native unavailable state present.
    */
   virtual bool NativelyUnavailable() const;
 
   /**
    * Return object attributes for the accessible.
--- a/accessible/generic/ApplicationAccessible.cpp
+++ b/accessible/generic/ApplicationAccessible.cpp
@@ -138,17 +138,17 @@ ApplicationAccessible::Shutdown()
 }
 
 void
 ApplicationAccessible::ApplyARIAState(uint64_t* aState) const
 {
 }
 
 role
-ApplicationAccessible::NativeRole()
+ApplicationAccessible::NativeRole() const
 {
   return roles::APP_ROOT;
 }
 
 uint64_t
 ApplicationAccessible::NativeState()
 {
   return 0;
--- a/accessible/generic/ApplicationAccessible.h
+++ b/accessible/generic/ApplicationAccessible.h
@@ -39,17 +39,17 @@ public:
   virtual nsIntRect Bounds() const override;
   virtual nsRect BoundsInAppUnits() const override;
   virtual already_AddRefed<nsIPersistentProperties> NativeAttributes() override;
   virtual GroupPos GroupPosition() override;
   virtual ENameValueFlag Name(nsString& aName) override;
   virtual void ApplyARIAState(uint64_t* aState) const override;
   virtual void Description(nsString& aDescription) override;
   virtual void Value(nsString& aValue) override;
-  virtual mozilla::a11y::role NativeRole() override;
+  virtual mozilla::a11y::role NativeRole() const override;
   virtual uint64_t State() override;
   virtual uint64_t NativeState() override;
   virtual Relation RelationByType(RelationType aType) override;
 
   virtual Accessible* ChildAtPoint(int32_t aX, int32_t aY,
                                    EWhichChildAtPoint aWhichChild) override;
   virtual Accessible* FocusedChild() override;
 
--- a/accessible/generic/BaseAccessibles.h
+++ b/accessible/generic/BaseAccessibles.h
@@ -94,17 +94,17 @@ class EnumRoleAccessible : public Access
 public:
   EnumRoleAccessible(nsIContent* aContent, DocAccessible* aDoc) :
     AccessibleWrap(aContent, aDoc) { }
 
   NS_IMETHOD QueryInterface(REFNSIID aIID, void** aPtr) override
     { return Accessible::QueryInterface(aIID, aPtr); }
 
   // Accessible
-  virtual a11y::role NativeRole() override { return R; }
+  virtual a11y::role NativeRole() const override { return R; }
 
 protected:
   virtual ~EnumRoleAccessible() { }
 };
 
 
 /**
  * A wrapper accessible around native accessible to connect it with
--- a/accessible/generic/DocAccessible.cpp
+++ b/accessible/generic/DocAccessible.cpp
@@ -189,17 +189,17 @@ DocAccessible::Name(nsString& aName)
     URL(aName);
   }
 
   return eNameOK;
 }
 
 // Accessible public method
 role
-DocAccessible::NativeRole()
+DocAccessible::NativeRole() const
 {
   nsCOMPtr<nsIDocShell> docShell = nsCoreUtils::GetDocShellFor(mDocumentNode);
   if (docShell) {
     nsCOMPtr<nsIDocShellTreeItem> sameTypeRoot;
     docShell->GetSameTypeRootTreeItem(getter_AddRefs(sameTypeRoot));
     int32_t itemType = docShell->ItemType();
     if (sameTypeRoot == docShell) {
       // Root of content or chrome tree
--- a/accessible/generic/DocAccessible.h
+++ b/accessible/generic/DocAccessible.h
@@ -67,17 +67,17 @@ public:
   virtual void Shutdown() override;
   virtual nsIFrame* GetFrame() const override;
   virtual nsINode* GetNode() const override { return mDocumentNode; }
   nsIDocument* DocumentNode() const { return mDocumentNode; }
 
   virtual mozilla::a11y::ENameValueFlag Name(nsString& aName) override;
   virtual void Description(nsString& aDescription) override;
   virtual Accessible* FocusedChild() override;
-  virtual mozilla::a11y::role NativeRole() override;
+  virtual mozilla::a11y::role NativeRole() const override;
   virtual uint64_t NativeState() override;
   virtual uint64_t NativeInteractiveState() const override;
   virtual bool NativelyUnavailable() const override;
   virtual void ApplyARIAState(uint64_t* aState) const override;
   virtual already_AddRefed<nsIPersistentProperties> Attributes() override;
 
   virtual void TakeFocus() override;
 
--- a/accessible/generic/FormControlAccessible.cpp
+++ b/accessible/generic/FormControlAccessible.cpp
@@ -20,17 +20,17 @@ using namespace mozilla::a11y;
 template class mozilla::a11y::ProgressMeterAccessible<1>;
 template class mozilla::a11y::ProgressMeterAccessible<100>;
 
 ////////////////////////////////////////////////////////////////////////////////
 // Accessible
 
 template<int Max>
 role
-ProgressMeterAccessible<Max>::NativeRole()
+ProgressMeterAccessible<Max>::NativeRole() const
 {
   return roles::PROGRESSBAR;
 }
 
 template<int Max>
 uint64_t
 ProgressMeterAccessible<Max>::NativeState()
 {
@@ -171,17 +171,17 @@ RadioButtonAccessible::DoAction(uint8_t 
   if (aIndex != eAction_Click)
     return false;
 
   DoCommand();
   return true;
 }
 
 role
-RadioButtonAccessible::NativeRole()
+RadioButtonAccessible::NativeRole() const
 {
   return roles::RADIOBUTTON;
 }
 
 ////////////////////////////////////////////////////////////////////////////////
 // RadioButtonAccessible: Widgets
 
 bool
--- a/accessible/generic/FormControlAccessible.h
+++ b/accessible/generic/FormControlAccessible.h
@@ -24,17 +24,17 @@ public:
     // Ignore 'ValueChange' DOM event in lieu of @value attribute change
     // notifications.
     mStateFlags |= eHasNumericValue | eIgnoreDOMUIEvent;
     mType = eProgressType;
   }
 
   // Accessible
   virtual void Value(nsString& aValue) override;
-  virtual mozilla::a11y::role NativeRole() override;
+  virtual mozilla::a11y::role NativeRole() const override;
   virtual uint64_t NativeState() override;
 
   // Value
   virtual double MaxValue() const override;
   virtual double MinValue() const override;
   virtual double CurValue() const override;
   virtual double Step() const override;
   virtual bool SetCurValue(double aValue) override;
@@ -51,17 +51,17 @@ protected:
   */
 class RadioButtonAccessible : public LeafAccessible
 {
 
 public:
   RadioButtonAccessible(nsIContent* aContent, DocAccessible* aDoc);
 
   // Accessible
-  virtual mozilla::a11y::role NativeRole() override;
+  virtual mozilla::a11y::role NativeRole() const override;
 
   // ActionAccessible
   virtual uint8_t ActionCount() override;
   virtual void ActionNameAt(uint8_t aIndex, nsAString& aName) override;
   virtual bool DoAction(uint8_t aIndex) override;
 
   enum { eAction_Click = 0 };
 
--- a/accessible/generic/HyperTextAccessible.cpp
+++ b/accessible/generic/HyperTextAccessible.cpp
@@ -52,17 +52,17 @@ HyperTextAccessible::
   HyperTextAccessible(nsIContent* aNode, DocAccessible* aDoc) :
   AccessibleWrap(aNode, aDoc)
 {
   mType = eHyperTextType;
   mGenericTypes |= eHyperText;
 }
 
 role
-HyperTextAccessible::NativeRole()
+HyperTextAccessible::NativeRole() const
 {
   a11y::role r = GetAccService()->MarkupRole(mContent);
   if (r != roles::NOTHING)
     return r;
 
   nsIFrame* frame = GetFrame();
   if (frame && frame->IsInlineFrame())
     return roles::TEXT;
--- a/accessible/generic/HyperTextAccessible.h
+++ b/accessible/generic/HyperTextAccessible.h
@@ -52,17 +52,17 @@ public:
   HyperTextAccessible(nsIContent* aContent, DocAccessible* aDoc);
 
   NS_INLINE_DECL_REFCOUNTING_INHERITED(HyperTextAccessible, AccessibleWrap)
 
   // Accessible
   virtual nsAtom* LandmarkRole() const override;
   virtual int32_t GetLevelInternal() override;
   virtual already_AddRefed<nsIPersistentProperties> NativeAttributes() override;
-  virtual mozilla::a11y::role NativeRole() override;
+  virtual mozilla::a11y::role NativeRole() const override;
   virtual uint64_t NativeState() override;
 
   virtual void Shutdown() override;
   virtual bool RemoveChild(Accessible* aAccessible) override;
   virtual bool InsertChildAt(uint32_t aIndex, Accessible* aChild) override;
   virtual Relation RelationByType(RelationType aType) override;
 
   // HyperTextAccessible (static helper method)
--- a/accessible/generic/ImageAccessible.cpp
+++ b/accessible/generic/ImageAccessible.cpp
@@ -85,17 +85,17 @@ ImageAccessible::NativeName(nsString& aN
   // No accessible name but empty 'alt' attribute is present. If further name
   // computation algorithm doesn't provide non empty name then it means
   // an empty 'alt' attribute was used to indicate a decorative image (see
   // Accessible::Name() method for details).
   return hasAltAttrib ? eNoNameOnPurpose : eNameOK;
 }
 
 role
-ImageAccessible::NativeRole()
+ImageAccessible::NativeRole() const
 {
   return roles::GRAPHIC;
 }
 
 ////////////////////////////////////////////////////////////////////////////////
 // Accessible
 
 uint8_t
--- a/accessible/generic/ImageAccessible.h
+++ b/accessible/generic/ImageAccessible.h
@@ -17,17 +17,17 @@ namespace a11y {
  * - support basic state
  */
 class ImageAccessible : public LinkableAccessible
 {
 public:
   ImageAccessible(nsIContent* aContent, DocAccessible* aDoc);
 
   // Accessible
-  virtual a11y::role NativeRole() override;
+  virtual a11y::role NativeRole() const override;
   virtual uint64_t NativeState() override;
   virtual already_AddRefed<nsIPersistentProperties> NativeAttributes() override;
 
   // ActionAccessible
   virtual uint8_t ActionCount() override;
   virtual void ActionNameAt(uint8_t aIndex, nsAString& aName) override;
   virtual bool DoAction(uint8_t aIndex) override;
 
--- a/accessible/generic/OuterDocAccessible.cpp
+++ b/accessible/generic/OuterDocAccessible.cpp
@@ -49,17 +49,17 @@ OuterDocAccessible::
 OuterDocAccessible::~OuterDocAccessible()
 {
 }
 
 ////////////////////////////////////////////////////////////////////////////////
 // Accessible public (DON'T add methods here)
 
 role
-OuterDocAccessible::NativeRole()
+OuterDocAccessible::NativeRole() const
 {
   return roles::INTERNAL_FRAME;
 }
 
 Accessible*
 OuterDocAccessible::ChildAtPoint(int32_t aX, int32_t aY,
                                  EWhichChildAtPoint aWhichChild)
 {
--- a/accessible/generic/OuterDocAccessible.h
+++ b/accessible/generic/OuterDocAccessible.h
@@ -27,17 +27,17 @@ public:
   OuterDocAccessible(nsIContent* aContent, DocAccessible* aDoc);
 
   NS_INLINE_DECL_REFCOUNTING_INHERITED(OuterDocAccessible, AccessibleWrap)
 
   DocAccessibleParent* RemoteChildDoc() const;
 
   // Accessible
   virtual void Shutdown() override;
-  virtual mozilla::a11y::role NativeRole() override;
+  virtual mozilla::a11y::role NativeRole() const override;
   virtual Accessible* ChildAtPoint(int32_t aX, int32_t aY,
                                    EWhichChildAtPoint aWhichChild) override;
 
   virtual bool InsertChildAt(uint32_t aIdx, Accessible* aChild) override;
   virtual bool RemoveChild(Accessible* aAccessible) override;
   virtual bool IsAcceptableChild(nsIContent* aEl) const override;
 
 #if defined(XP_WIN)
--- a/accessible/generic/RootAccessible.cpp
+++ b/accessible/generic/RootAccessible.cpp
@@ -84,17 +84,17 @@ RootAccessible::Name(nsString& aName)
       return eNameOK;
   }
 
   mDocumentNode->GetTitle(aName);
   return eNameOK;
 }
 
 role
-RootAccessible::NativeRole()
+RootAccessible::NativeRole() const
 {
   // If it's a <dialog> or <wizard>, use roles::DIALOG instead
   dom::Element* rootElm = mDocumentNode->GetRootElement();
   if (rootElm && rootElm->IsAnyOfXULElements(nsGkAtoms::dialog,
                                              nsGkAtoms::wizard))
     return roles::DIALOG;
 
   return DocAccessibleWrap::NativeRole();
--- a/accessible/generic/RootAccessible.h
+++ b/accessible/generic/RootAccessible.h
@@ -26,17 +26,17 @@ public:
 
   // nsIDOMEventListener
   NS_DECL_NSIDOMEVENTLISTENER
 
   // Accessible
   virtual void Shutdown() override;
   virtual mozilla::a11y::ENameValueFlag Name(nsString& aName) override;
   virtual Relation RelationByType(RelationType aType) override;
-  virtual mozilla::a11y::role NativeRole() override;
+  virtual mozilla::a11y::role NativeRole() const override;
   virtual uint64_t NativeState() override;
 
   // RootAccessible
 
   /**
    * Notify that the sub document presshell was activated.
    */
   virtual void DocumentActivated(DocAccessible* aDocument);
--- a/accessible/generic/TextLeafAccessible.cpp
+++ b/accessible/generic/TextLeafAccessible.cpp
@@ -24,17 +24,17 @@ TextLeafAccessible::
   mStateFlags |= eNoKidsFromDOM;
 }
 
 TextLeafAccessible::~TextLeafAccessible()
 {
 }
 
 role
-TextLeafAccessible::NativeRole()
+TextLeafAccessible::NativeRole() const
 {
   nsIFrame* frame = GetFrame();
   if (frame && frame->IsGeneratedContentFrame())
     return roles::STATICTEXT;
 
   return roles::TEXT_LEAF;
 }
 
--- a/accessible/generic/TextLeafAccessible.h
+++ b/accessible/generic/TextLeafAccessible.h
@@ -16,17 +16,17 @@ namespace a11y {
  */
 class TextLeafAccessible : public LinkableAccessible
 {
 public:
   TextLeafAccessible(nsIContent* aContent, DocAccessible* aDoc);
   virtual ~TextLeafAccessible();
 
   // Accessible
-  virtual mozilla::a11y::role NativeRole() override;
+  virtual mozilla::a11y::role NativeRole() const override;
   virtual void AppendTextTo(nsAString& aText, uint32_t aStartOffset = 0,
                             uint32_t aLength = UINT32_MAX) override;
   virtual ENameValueFlag Name(nsString& aName) override;
 
   // TextLeafAccessible
   void SetText(const nsAString& aText) { mText = aText; }
   const nsString& Text() const { return mText; }
 
--- a/accessible/html/HTMLCanvasAccessible.cpp
+++ b/accessible/html/HTMLCanvasAccessible.cpp
@@ -11,12 +11,12 @@ using namespace mozilla::a11y;
 
 HTMLCanvasAccessible::
   HTMLCanvasAccessible(nsIContent* aContent, DocAccessible* aDoc) :
   HyperTextAccessibleWrap(aContent, aDoc)
 {
 }
 
 role
-HTMLCanvasAccessible::NativeRole()
+HTMLCanvasAccessible::NativeRole() const
 {
   return roles::CANVAS;
 }
--- a/accessible/html/HTMLCanvasAccessible.h
+++ b/accessible/html/HTMLCanvasAccessible.h
@@ -19,17 +19,17 @@ class HTMLCanvasAccessible : public Hype
 public:
   HTMLCanvasAccessible(nsIContent* aContent, DocAccessible* aDoc);
 
   // nsISupports
   NS_INLINE_DECL_REFCOUNTING_INHERITED(HTMLCanvasAccessible,
                                        HyperTextAccessibleWrap)
 
   // Accessible
-  virtual a11y::role NativeRole() override;
+  virtual a11y::role NativeRole() const override;
 
 protected:
   virtual ~HTMLCanvasAccessible() { }
 };
 
 } // namespace a11y
 } // namespace mozilla
 
--- a/accessible/html/HTMLElementAccessibles.cpp
+++ b/accessible/html/HTMLElementAccessibles.cpp
@@ -19,27 +19,27 @@
 
 using namespace mozilla::a11y;
 
 ////////////////////////////////////////////////////////////////////////////////
 // HTMLHRAccessible
 ////////////////////////////////////////////////////////////////////////////////
 
 role
-HTMLHRAccessible::NativeRole()
+HTMLHRAccessible::NativeRole() const
 {
   return roles::SEPARATOR;
 }
 
 ////////////////////////////////////////////////////////////////////////////////
 // HTMLBRAccessible
 ////////////////////////////////////////////////////////////////////////////////
 
 role
-HTMLBRAccessible::NativeRole()
+HTMLBRAccessible::NativeRole() const
 {
   return roles::WHITESPACE;
 }
 
 uint64_t
 HTMLBRAccessible::NativeState()
 {
   return states::READONLY;
@@ -200,17 +200,17 @@ HTMLSummaryAccessible::IsWidget() const
 }
 
 
 ////////////////////////////////////////////////////////////////////////////////
 // HTMLHeaderOrFooterAccessible
 ////////////////////////////////////////////////////////////////////////////////
 
 role
-HTMLHeaderOrFooterAccessible::NativeRole()
+HTMLHeaderOrFooterAccessible::NativeRole() const
 {
   // Only map header and footer if they are direct descendants of the body tag.
   // If other sectioning or sectioning root elements, they become sections.
   nsIContent* parent = mContent->GetParent();
   while (parent) {
     if (parent->IsAnyOfHTMLElements(nsGkAtoms::article, nsGkAtoms::aside,
                              nsGkAtoms::nav, nsGkAtoms::section,
                              nsGkAtoms::blockquote, nsGkAtoms::details,
--- a/accessible/html/HTMLElementAccessibles.h
+++ b/accessible/html/HTMLElementAccessibles.h
@@ -17,34 +17,34 @@ namespace a11y {
 class HTMLHRAccessible : public LeafAccessible
 {
 public:
 
   HTMLHRAccessible(nsIContent* aContent, DocAccessible* aDoc) :
     LeafAccessible(aContent, aDoc) {}
 
   // Accessible
-  virtual a11y::role NativeRole() override;
+  virtual a11y::role NativeRole() const override;
 };
 
 /**
  * Used for HTML br element.
  */
 class HTMLBRAccessible : public LeafAccessible
 {
 public:
   HTMLBRAccessible(nsIContent* aContent, DocAccessible* aDoc) :
     LeafAccessible(aContent, aDoc)
   {
     mType = eHTMLBRType;
     mGenericTypes |= eText;
   }
 
   // Accessible
-  virtual a11y::role NativeRole() override;
+  virtual a11y::role NativeRole() const override;
   virtual uint64_t NativeState() override;
 
 protected:
   // Accessible
   virtual ENameValueFlag NativeName(nsString& aName) override;
 };
 
 /**
@@ -126,17 +126,17 @@ public:
   HTMLHeaderOrFooterAccessible(nsIContent* aContent, DocAccessible* aDoc) :
     HyperTextAccessibleWrap(aContent, aDoc) {}
 
   NS_INLINE_DECL_REFCOUNTING_INHERITED(HTMLHeaderOrFooterAccessible,
                                        HyperTextAccessibleWrap)
 
   // Accessible
   virtual nsAtom* LandmarkRole() const override;
-  virtual a11y::role NativeRole() override;
+  virtual a11y::role NativeRole() const override;
 
 protected:
   virtual ~HTMLHeaderOrFooterAccessible() {}
 };
 
 } // namespace a11y
 } // namespace mozilla
 
--- a/accessible/html/HTMLFormControlAccessible.cpp
+++ b/accessible/html/HTMLFormControlAccessible.cpp
@@ -35,17 +35,17 @@ using namespace mozilla;
 using namespace mozilla::dom;
 using namespace mozilla::a11y;
 
 ////////////////////////////////////////////////////////////////////////////////
 // HTMLCheckboxAccessible
 ////////////////////////////////////////////////////////////////////////////////
 
 role
-HTMLCheckboxAccessible::NativeRole()
+HTMLCheckboxAccessible::NativeRole() const
 {
   return roles::CHECKBUTTON;
 }
 
 uint8_t
 HTMLCheckboxAccessible::ActionCount()
 {
   return 1;
@@ -229,17 +229,17 @@ HTMLButtonAccessible::NativeState()
   EventStates elmState = mContent->AsElement()->State();
   if (elmState.HasState(NS_EVENT_STATE_DEFAULT))
     state |= states::DEFAULT;
 
   return state;
 }
 
 role
-HTMLButtonAccessible::NativeRole()
+HTMLButtonAccessible::NativeRole() const
 {
   return roles::PUSHBUTTON;
 }
 
 ENameValueFlag
 HTMLButtonAccessible::NativeName(nsString& aName)
 {
   // No need to check @value attribute for buttons since this attribute results
@@ -284,17 +284,17 @@ HTMLTextFieldAccessible::
 {
   mType = mContent->AsElement()->AttrValueIs(kNameSpaceID_None, nsGkAtoms::type,
                             nsGkAtoms::password, eIgnoreCase) ?
             eHTMLTextPasswordFieldType :
             eHTMLTextFieldType;
 }
 
 role
-HTMLTextFieldAccessible::NativeRole()
+HTMLTextFieldAccessible::NativeRole() const
 {
   if (mType == eHTMLTextPasswordFieldType) {
     return roles::PASSWORD_TEXT;
   }
 
   return roles::ENTRY;
 }
 
@@ -498,17 +498,17 @@ HTMLTextFieldAccessible::ContainerWidget
 HTMLFileInputAccessible::
 HTMLFileInputAccessible(nsIContent* aContent, DocAccessible* aDoc) :
   HyperTextAccessibleWrap(aContent, aDoc)
 {
   mType = eHTMLFileInputType;
 }
 
 role
-HTMLFileInputAccessible::NativeRole()
+HTMLFileInputAccessible::NativeRole() const
 {
   // JAWS wants a text container, others don't mind. No specific role in
   // AT APIs.
   return roles::TEXT_CONTAINER;
 }
 
 nsresult
 HTMLFileInputAccessible::HandleAccEvent(AccEvent* aEvent)
@@ -538,17 +538,17 @@ HTMLFileInputAccessible::HandleAccEvent(
 }
 
 
 ////////////////////////////////////////////////////////////////////////////////
 // HTMLSpinnerAccessible
 ////////////////////////////////////////////////////////////////////////////////
 
 role
-HTMLSpinnerAccessible::NativeRole()
+HTMLSpinnerAccessible::NativeRole() const
 {
   return roles::SPINBUTTON;
 }
 
 void
 HTMLSpinnerAccessible::Value(nsString& aValue)
 {
   AccessibleWrap::Value(aValue);
@@ -610,17 +610,17 @@ HTMLSpinnerAccessible::SetCurValue(doubl
 }
 
 
 ////////////////////////////////////////////////////////////////////////////////
 // HTMLRangeAccessible
 ////////////////////////////////////////////////////////////////////////////////
 
 role
-HTMLRangeAccessible::NativeRole()
+HTMLRangeAccessible::NativeRole() const
 {
   return roles::SLIDER;
 }
 
 bool
 HTMLRangeAccessible::IsWidget() const
 {
   return true;
@@ -694,17 +694,17 @@ HTMLRangeAccessible::SetCurValue(double 
 
 HTMLGroupboxAccessible::
   HTMLGroupboxAccessible(nsIContent* aContent, DocAccessible* aDoc) :
   HyperTextAccessibleWrap(aContent, aDoc)
 {
 }
 
 role
-HTMLGroupboxAccessible::NativeRole()
+HTMLGroupboxAccessible::NativeRole() const
 {
   return roles::GROUPING;
 }
 
 nsIContent*
 HTMLGroupboxAccessible::GetLegend() const
 {
   for (nsIContent* legendContent = mContent->GetFirstChild(); legendContent;
--- a/accessible/html/HTMLFormControlAccessible.h
+++ b/accessible/html/HTMLFormControlAccessible.h
@@ -31,17 +31,17 @@ public:
     LeafAccessible(aContent, aDoc)
   {
     // Ignore "CheckboxStateChange" DOM event in lieu of document observer
     // state change notification.
     mStateFlags |= eIgnoreDOMUIEvent;
   }
 
   // Accessible
-  virtual mozilla::a11y::role NativeRole() override;
+  virtual mozilla::a11y::role NativeRole() const override;
   virtual uint64_t NativeState() override;
 
   // ActionAccessible
   virtual uint8_t ActionCount() override;
   virtual void ActionNameAt(uint8_t aIndex, nsAString& aName) override;
   virtual bool DoAction(uint8_t aIndex) override;
 
   // Widgets
@@ -79,17 +79,17 @@ class HTMLButtonAccessible : public Hype
 {
 
 public:
   enum { eAction_Click = 0 };
 
   HTMLButtonAccessible(nsIContent* aContent, DocAccessible* aDoc);
 
   // Accessible
-  virtual mozilla::a11y::role NativeRole() override;
+  virtual mozilla::a11y::role NativeRole() const override;
   virtual uint64_t State() override;
   virtual uint64_t NativeState() override;
 
   // ActionAccessible
   virtual uint8_t ActionCount() override;
   virtual void ActionNameAt(uint8_t aIndex, nsAString& aName) override;
   virtual bool DoAction(uint8_t aIndex) override;
 
@@ -118,17 +118,17 @@ public:
                                        HyperTextAccessibleWrap)
 
   // HyperTextAccessible
   virtual already_AddRefed<TextEditor> GetEditor() const override;
 
   // Accessible
   virtual void Value(nsString& aValue) override;
   virtual void ApplyARIAState(uint64_t* aState) const override;
-  virtual mozilla::a11y::role NativeRole() override;
+  virtual mozilla::a11y::role NativeRole() const override;
   virtual uint64_t NativeState() override;
   virtual already_AddRefed<nsIPersistentProperties> NativeAttributes() override;
 
   // ActionAccessible
   virtual uint8_t ActionCount() override;
   virtual void ActionNameAt(uint8_t aIndex, nsAString& aName) override;
   virtual bool DoAction(uint8_t aIndex) override;
 
@@ -153,17 +153,17 @@ protected:
  * Accessible for input@type="file" element.
  */
 class HTMLFileInputAccessible : public HyperTextAccessibleWrap
 {
 public:
   HTMLFileInputAccessible(nsIContent* aContent, DocAccessible* aDoc);
 
   // Accessible
-  virtual mozilla::a11y::role NativeRole() override;
+  virtual mozilla::a11y::role NativeRole() const override;
   virtual nsresult HandleAccEvent(AccEvent* aAccEvent) override;
 };
 
 
 /**
  * Used for HTML input@type="number".
  */
 class HTMLSpinnerAccessible : public AccessibleWrap
@@ -171,17 +171,17 @@ class HTMLSpinnerAccessible : public Acc
 public:
   HTMLSpinnerAccessible(nsIContent* aContent, DocAccessible* aDoc) :
     AccessibleWrap(aContent, aDoc)
   {
     mStateFlags |= eHasNumericValue;
 }
 
   // Accessible
-  virtual mozilla::a11y::role NativeRole() override;
+  virtual mozilla::a11y::role NativeRole() const override;
   virtual void Value(nsString& aValue) override;
 
   virtual double MaxValue() const override;
   virtual double MinValue() const override;
   virtual double CurValue() const override;
   virtual double Step() const override;
   virtual bool SetCurValue(double aValue) override;
 };
@@ -196,17 +196,17 @@ public:
   HTMLRangeAccessible(nsIContent* aContent, DocAccessible* aDoc) :
     LeafAccessible(aContent, aDoc)
   {
     mStateFlags |= eHasNumericValue;
   }
 
   // Accessible
   virtual void Value(nsString& aValue) override;
-  virtual mozilla::a11y::role NativeRole() override;
+  virtual mozilla::a11y::role NativeRole() const override;
 
   // Value
   virtual double MaxValue() const override;
   virtual double MinValue() const override;
   virtual double CurValue() const override;
   virtual double Step() const override;
   virtual bool SetCurValue(double aValue) override;
 
@@ -219,17 +219,17 @@ public:
  * Accessible for HTML fieldset element.
  */
 class HTMLGroupboxAccessible : public HyperTextAccessibleWrap
 {
 public:
   HTMLGroupboxAccessible(nsIContent* aContent, DocAccessible* aDoc);
 
   // Accessible
-  virtual mozilla::a11y::role NativeRole() override;
+  virtual mozilla::a11y::role NativeRole() const override;
   virtual Relation RelationByType(RelationType aType) override;
 
 protected:
   // Accessible
   virtual ENameValueFlag NativeName(nsString& aName) override;
 
   // HTMLGroupboxAccessible
   nsIContent* GetLegend() const;
--- a/accessible/html/HTMLImageMapAccessible.cpp
+++ b/accessible/html/HTMLImageMapAccessible.cpp
@@ -31,17 +31,17 @@ HTMLImageMapAccessible::
 
   UpdateChildAreas(false);
 }
 
 ////////////////////////////////////////////////////////////////////////////////
 // HTMLImageMapAccessible: Accessible public
 
 role
-HTMLImageMapAccessible::NativeRole()
+HTMLImageMapAccessible::NativeRole() const
 {
   return roles::IMAGE_MAP;
 }
 
 ////////////////////////////////////////////////////////////////////////////////
 // HTMLImageMapAccessible: HyperLinkAccessible
 
 uint32_t
--- a/accessible/html/HTMLImageMapAccessible.h
+++ b/accessible/html/HTMLImageMapAccessible.h
@@ -20,17 +20,17 @@ class HTMLImageMapAccessible final : pub
 public:
   HTMLImageMapAccessible(nsIContent* aContent, DocAccessible* aDoc);
 
   // nsISupports and cycle collector
   NS_INLINE_DECL_REFCOUNTING_INHERITED(HTMLImageMapAccessible,
                                        ImageAccessibleWrap)
 
   // Accessible
-  virtual a11y::role NativeRole() override;
+  virtual a11y::role NativeRole() const override;
 
   // HyperLinkAccessible
   virtual uint32_t AnchorCount() override;
   virtual Accessible* AnchorAt(uint32_t aAnchorIndex) override;
   virtual already_AddRefed<nsIURI> AnchorURIAt(uint32_t aAnchorIndex) override;
 
   /**
    * Update area children of the image map.
--- a/accessible/html/HTMLLinkAccessible.cpp
+++ b/accessible/html/HTMLLinkAccessible.cpp
@@ -26,17 +26,17 @@ HTMLLinkAccessible::
   HyperTextAccessibleWrap(aContent, aDoc)
 {
 }
 
 ////////////////////////////////////////////////////////////////////////////////
 // nsIAccessible
 
 role
-HTMLLinkAccessible::NativeRole()
+HTMLLinkAccessible::NativeRole() const
 {
   return roles::LINK;
 }
 
 uint64_t
 HTMLLinkAccessible::NativeState()
 {
   return HyperTextAccessibleWrap::NativeState() & ~states::READONLY;
--- a/accessible/html/HTMLLinkAccessible.h
+++ b/accessible/html/HTMLLinkAccessible.h
@@ -16,17 +16,17 @@ class HTMLLinkAccessible : public HyperT
 public:
   HTMLLinkAccessible(nsIContent* aContent, DocAccessible* aDoc);
 
   NS_INLINE_DECL_REFCOUNTING_INHERITED(HTMLLinkAccessible,
                                        HyperTextAccessibleWrap)
 
   // Accessible
   virtual void Value(nsString& aValue) override;
-  virtual a11y::role NativeRole() override;
+  virtual a11y::role NativeRole() const override;
   virtual uint64_t NativeState() override;
   virtual uint64_t NativeLinkState() const override;
   virtual uint64_t NativeInteractiveState() const override;
 
   // ActionAccessible
   virtual uint8_t ActionCount() override;
   virtual void ActionNameAt(uint8_t aIndex, nsAString& aName) override;
   virtual bool DoAction(uint8_t aIndex) override;
--- a/accessible/html/HTMLListAccessible.cpp
+++ b/accessible/html/HTMLListAccessible.cpp
@@ -17,17 +17,17 @@
 using namespace mozilla;
 using namespace mozilla::a11y;
 
 ////////////////////////////////////////////////////////////////////////////////
 // HTMLListAccessible
 ////////////////////////////////////////////////////////////////////////////////
 
 role
-HTMLListAccessible::NativeRole()
+HTMLListAccessible::NativeRole() const
 {
   a11y::role r = GetAccService()->MarkupRole(mContent);
   return r != roles::NOTHING ? r : roles::LIST;
 }
 
 uint64_t
 HTMLListAccessible::NativeState()
 {
@@ -57,17 +57,17 @@ void
 HTMLLIAccessible::Shutdown()
 {
   mBullet = nullptr;
 
   HyperTextAccessibleWrap::Shutdown();
 }
 
 role
-HTMLLIAccessible::NativeRole()
+HTMLLIAccessible::NativeRole() const
 {
   a11y::role r = GetAccService()->MarkupRole(mContent);
   return r != roles::NOTHING ? r : roles::LISTITEM;
 }
 
 uint64_t
 HTMLLIAccessible::NativeState()
 {
@@ -156,17 +156,17 @@ HTMLListBulletAccessible::Name(nsString 
   if (blockFrame) {
     blockFrame->GetSpokenBulletText(aName);
   }
 
   return eNameOK;
 }
 
 role
-HTMLListBulletAccessible::NativeRole()
+HTMLListBulletAccessible::NativeRole() const
 {
   return roles::STATICTEXT;
 }
 
 uint64_t
 HTMLListBulletAccessible::NativeState()
 {
   return LeafAccessible::NativeState() | states::READONLY;
--- a/accessible/html/HTMLListAccessible.h
+++ b/accessible/html/HTMLListAccessible.h
@@ -24,17 +24,17 @@ public:
   HTMLListAccessible(nsIContent* aContent, DocAccessible* aDoc) :
     HyperTextAccessibleWrap(aContent, aDoc) { mGenericTypes |= eList; }
 
   // nsISupports
   NS_INLINE_DECL_REFCOUNTING_INHERITED(HTMLListAccessible,
                                        HyperTextAccessibleWrap)
 
   // Accessible
-  virtual a11y::role NativeRole() override;
+  virtual a11y::role NativeRole() const override;
   virtual uint64_t NativeState() override;
 
 protected:
   virtual ~HTMLListAccessible() { }
 };
 
 
 /**
@@ -47,17 +47,17 @@ public:
 
   // nsISupports
   NS_INLINE_DECL_REFCOUNTING_INHERITED(HTMLLIAccessible,
                                        HyperTextAccessibleWrap)
 
   // Accessible
   virtual void Shutdown() override;
   virtual nsRect BoundsInAppUnits() const override;
-  virtual a11y::role NativeRole() override;
+  virtual a11y::role NativeRole() const override;
   virtual uint64_t NativeState() override;
 
   virtual bool InsertChildAt(uint32_t aIndex, Accessible* aChild) override;
 
   // HTMLLIAccessible
   HTMLListBulletAccessible* Bullet() const { return mBullet; }
   void UpdateBullet(bool aHasBullet);
 
@@ -76,17 +76,17 @@ class HTMLListBulletAccessible : public 
 {
 public:
   HTMLListBulletAccessible(nsIContent* aContent, DocAccessible* aDoc);
   virtual ~HTMLListBulletAccessible() { }
 
   // Accessible
   virtual nsIFrame* GetFrame() const override;
   virtual ENameValueFlag Name(nsString& aName) override;
-  virtual a11y::role NativeRole() override;
+  virtual a11y::role NativeRole() const override;
   virtual uint64_t NativeState() override;
   virtual void AppendTextTo(nsAString& aText, uint32_t aStartOffset = 0,
                             uint32_t aLength = UINT32_MAX) override;
 
   // HTMLListBulletAccessible
 
   /**
    * Return true if the bullet is inside of list item element boundaries.
--- a/accessible/html/HTMLSelectAccessible.cpp
+++ b/accessible/html/HTMLSelectAccessible.cpp
@@ -44,17 +44,17 @@ HTMLSelectListAccessible::NativeState()
   uint64_t state = AccessibleWrap::NativeState();
   if (mContent->AsElement()->HasAttr(kNameSpaceID_None, nsGkAtoms::multiple))
     state |= states::MULTISELECTABLE | states::EXTSELECTABLE;
 
   return state;
 }
 
 role
-HTMLSelectListAccessible::NativeRole()
+HTMLSelectListAccessible::NativeRole() const
 {
   return roles::LISTBOX;
 }
 
 ////////////////////////////////////////////////////////////////////////////////
 // HTMLSelectListAccessible: SelectAccessible
 
 bool
@@ -134,17 +134,17 @@ HTMLSelectOptionAccessible::
   HyperTextAccessibleWrap(aContent, aDoc)
 {
 }
 
 ////////////////////////////////////////////////////////////////////////////////
 // HTMLSelectOptionAccessible: Accessible public
 
 role
-HTMLSelectOptionAccessible::NativeRole()
+HTMLSelectOptionAccessible::NativeRole() const
 {
   if (GetCombobox())
     return roles::COMBOBOX_OPTION;
 
   return roles::OPTION;
 }
 
 ENameValueFlag
@@ -301,17 +301,17 @@ HTMLSelectOptionAccessible::ContainerWid
   return parent && parent->IsListControl() ? parent : nullptr;
 }
 
 ////////////////////////////////////////////////////////////////////////////////
 // HTMLSelectOptGroupAccessible
 ////////////////////////////////////////////////////////////////////////////////
 
 role
-HTMLSelectOptGroupAccessible::NativeRole()
+HTMLSelectOptGroupAccessible::NativeRole() const
 {
   return roles::GROUPING;
 }
 
 uint64_t
 HTMLSelectOptGroupAccessible::NativeInteractiveState() const
 {
   return NativelyUnavailable() ? states::UNAVAILABLE : 0;
@@ -363,17 +363,17 @@ HTMLComboboxAccessible::
     }
   }
 }
 
 ////////////////////////////////////////////////////////////////////////////////
 // HTMLComboboxAccessible: Accessible
 
 role
-HTMLComboboxAccessible::NativeRole()
+HTMLComboboxAccessible::NativeRole() const
 {
   return roles::COMBOBOX;
 }
 
 bool
 HTMLComboboxAccessible::RemoveChild(Accessible* aChild)
 {
   MOZ_ASSERT(aChild == mListAccessible);
@@ -557,17 +557,17 @@ HTMLComboboxListAccessible::GetFrame() c
   if (comboBox) {
     return comboBox->GetDropDown();
   }
 
   return nullptr;
 }
 
 role
-HTMLComboboxListAccessible::NativeRole()
+HTMLComboboxListAccessible::NativeRole() const
 {
   return roles::COMBOBOX_LIST;
 }
 
 uint64_t
 HTMLComboboxListAccessible::NativeState()
 {
   // As a HTMLComboboxListAccessible we can have the following states:
--- a/accessible/html/HTMLSelectAccessible.h
+++ b/accessible/html/HTMLSelectAccessible.h
@@ -32,17 +32,17 @@ namespace a11y {
 class HTMLSelectListAccessible : public AccessibleWrap
 {
 public:
 
   HTMLSelectListAccessible(nsIContent* aContent, DocAccessible* aDoc);
   virtual ~HTMLSelectListAccessible() {}
 
   // Accessible
-  virtual a11y::role NativeRole() override;
+  virtual a11y::role NativeRole() const override;
   virtual uint64_t NativeState() override;
   virtual bool IsAcceptableChild(nsIContent* aEl) const override;
 
   // SelectAccessible
   virtual bool SelectAll() override;
   virtual bool UnselectAll() override;
 
   // Widgets
@@ -60,17 +60,17 @@ class HTMLSelectOptionAccessible : publi
 {
 public:
   enum { eAction_Select = 0 };
 
   HTMLSelectOptionAccessible(nsIContent* aContent, DocAccessible* aDoc);
   virtual ~HTMLSelectOptionAccessible() {}
 
   // Accessible
-  virtual a11y::role NativeRole() override;
+  virtual a11y::role NativeRole() const override;
   virtual uint64_t NativeState() override;
   virtual uint64_t NativeInteractiveState() const override;
 
   virtual int32_t GetLevelInternal() override;
   virtual nsRect RelativeBounds(nsIFrame** aBoundingFrame) const override;
   virtual void SetSelected(bool aSelect) override;
 
   // ActionAccessible
@@ -130,17 +130,17 @@ class HTMLSelectOptGroupAccessible : pub
 public:
 
   HTMLSelectOptGroupAccessible(nsIContent* aContent, DocAccessible* aDoc) :
     HTMLSelectOptionAccessible(aContent, aDoc)
     { mType = eHTMLOptGroupType; }
   virtual ~HTMLSelectOptGroupAccessible() {}
 
   // Accessible
-  virtual a11y::role NativeRole() override;
+  virtual a11y::role NativeRole() const override;
   virtual uint64_t NativeInteractiveState() const override;
   virtual bool IsAcceptableChild(nsIContent* aEl) const override;
 
   // ActionAccessible
   virtual uint8_t ActionCount() override;
   virtual void ActionNameAt(uint8_t aIndex, nsAString& aName) override;
   virtual bool DoAction(uint8_t aIndex) override;
 };
@@ -161,17 +161,17 @@ public:
 
   HTMLComboboxAccessible(nsIContent* aContent, DocAccessible* aDoc);
   virtual ~HTMLComboboxAccessible() {}
 
   // Accessible
   virtual void Shutdown() override;
   virtual void Description(nsString& aDescription) override;
   virtual void Value(nsString& aValue) override;
-  virtual a11y::role NativeRole() override;
+  virtual a11y::role NativeRole() const override;
   virtual uint64_t NativeState() override;
   virtual bool RemoveChild(Accessible* aChild) override;
   virtual bool IsAcceptableChild(nsIContent* aEl) const override;
 
   // ActionAccessible
   virtual uint8_t ActionCount() override;
   virtual void ActionNameAt(uint8_t aIndex, nsAString& aName) override;
   virtual bool DoAction(uint8_t aIndex) override;
@@ -203,17 +203,17 @@ class HTMLComboboxListAccessible : publi
 public:
 
   HTMLComboboxListAccessible(Accessible* aParent, nsIContent* aContent,
                              DocAccessible* aDoc);
   virtual ~HTMLComboboxListAccessible() {}
 
   // Accessible
   virtual nsIFrame* GetFrame() const override;
-  virtual a11y::role NativeRole() override;
+  virtual a11y::role NativeRole() const override;
   virtual uint64_t NativeState() override;
   virtual nsRect RelativeBounds(nsIFrame** aBoundingFrame) const override;
   virtual bool IsAcceptableChild(nsIContent* aEl) const override;
 
   // Widgets
   virtual bool IsActiveWidget() const override;
   virtual bool AreItemsOperable() const override;
 };
--- a/accessible/html/HTMLTableAccessible.cpp
+++ b/accessible/html/HTMLTableAccessible.cpp
@@ -48,17 +48,17 @@ HTMLTableCellAccessible::
   mType = eHTMLTableCellType;
   mGenericTypes |= eTableCell;
 }
 
 ////////////////////////////////////////////////////////////////////////////////
 // HTMLTableCellAccessible: Accessible implementation
 
 role
-HTMLTableCellAccessible::NativeRole()
+HTMLTableCellAccessible::NativeRole() const
 {
   if (mContent->IsMathMLElement(nsGkAtoms::mtd_)) {
     return roles::MATHML_CELL;
   }
   return roles::CELL;
 }
 
 uint64_t
@@ -299,17 +299,17 @@ HTMLTableHeaderCellAccessible::
   HTMLTableCellAccessible(aContent, aDoc)
 {
 }
 
 ////////////////////////////////////////////////////////////////////////////////
 // HTMLTableHeaderCellAccessible: Accessible implementation
 
 role
-HTMLTableHeaderCellAccessible::NativeRole()
+HTMLTableHeaderCellAccessible::NativeRole() const
 {
   // Check value of @scope attribute.
   static Element::AttrValuesArray scopeValues[] =
     { &nsGkAtoms::col, &nsGkAtoms::colgroup,
       &nsGkAtoms::row, &nsGkAtoms::rowgroup, nullptr };
   int32_t valueIdx =
     mContent->AsElement()->FindAttrValueIn(kNameSpaceID_None, nsGkAtoms::scope,
                                            scopeValues, eCaseMatters);
@@ -348,17 +348,17 @@ HTMLTableHeaderCellAccessible::NativeRol
 }
 
 
 ////////////////////////////////////////////////////////////////////////////////
 // HTMLTableRowAccessible
 ////////////////////////////////////////////////////////////////////////////////
 
 role
-HTMLTableRowAccessible::NativeRole()
+HTMLTableRowAccessible::NativeRole() const
 {
   if (mContent->IsMathMLElement(nsGkAtoms::mtr_)) {
     return roles::MATHML_TABLE_ROW;
   } else if (mContent->IsMathMLElement(nsGkAtoms::mlabeledtr_)) {
     return roles::MATHML_LABELED_ROW;
   }
   return roles::ROW;
 }
@@ -390,17 +390,17 @@ HTMLTableAccessible::InsertChildAt(uint3
   // Move caption accessible so that it's the first child. Check for the first
   // caption only, because nsAccessibilityService ensures we don't create
   // accessibles for the other captions, since only the first is actually
   // visible.
   return Accessible::InsertChildAt(aChild->IsHTMLCaption() ? 0 : aIndex, aChild);
 }
 
 role
-HTMLTableAccessible::NativeRole()
+HTMLTableAccessible::NativeRole() const
 {
   if (mContent->IsMathMLElement(nsGkAtoms::mtable_)) {
     return roles::MATHML_TABLE;
   }
   return roles::TABLE;
 }
 
 uint64_t
@@ -1109,12 +1109,12 @@ HTMLCaptionAccessible::RelationByType(Re
   Relation rel = HyperTextAccessible::RelationByType(aType);
   if (aType == RelationType::LABEL_FOR)
     rel.AppendTarget(Parent());
 
   return rel;
 }
 
 role
-HTMLCaptionAccessible::NativeRole()
+HTMLCaptionAccessible::NativeRole() const
 {
   return roles::CAPTION;
 }
--- a/accessible/html/HTMLTableAccessible.h
+++ b/accessible/html/HTMLTableAccessible.h
@@ -29,17 +29,17 @@ public:
   HTMLTableCellAccessible(nsIContent* aContent, DocAccessible* aDoc);
 
   // nsISupports
   NS_INLINE_DECL_REFCOUNTING_INHERITED(HTMLTableCellAccessible,
                                        HyperTextAccessibleWrap)
 
   // Accessible
   virtual TableCellAccessible* AsTableCell() override { return this; }
-  virtual a11y::role NativeRole() override;
+  virtual a11y::role NativeRole() const override;
   virtual uint64_t NativeState() override;
   virtual uint64_t NativeInteractiveState() const override;
   virtual already_AddRefed<nsIPersistentProperties> NativeAttributes() override;
   virtual mozilla::a11y::GroupPos GroupPosition() override;
 
   // TableCellAccessible
   virtual TableAccessible* Table() const override;
   virtual uint32_t ColIdx() const override;
@@ -74,17 +74,17 @@ protected:
  * HTML table row/column header accessible (html:th or html:td@scope).
  */
 class HTMLTableHeaderCellAccessible : public HTMLTableCellAccessible
 {
 public:
   HTMLTableHeaderCellAccessible(nsIContent* aContent, DocAccessible* aDoc);
 
   // Accessible
-  virtual a11y::role NativeRole() override;
+  virtual a11y::role NativeRole() const override;
 };
 
 
 /**
  * HTML table row accessible (html:tr).
  */
 class HTMLTableRowAccessible : public AccessibleWrap
 {
@@ -94,17 +94,17 @@ public:
   {
     mType = eHTMLTableRowType;
     mGenericTypes |= eTableRow;
   }
 
   NS_INLINE_DECL_REFCOUNTING_INHERITED(HTMLTableRowAccessible, AccessibleWrap)
 
   // Accessible
-  virtual a11y::role NativeRole() override;
+  virtual a11y::role NativeRole() const override;
   virtual mozilla::a11y::GroupPos GroupPosition() override;
 
 protected:
   virtual ~HTMLTableRowAccessible() { }
 };
 
 
 /**
@@ -157,17 +157,17 @@ public:
   virtual void UnselectCol(uint32_t aColIdx) override;
   virtual void UnselectRow(uint32_t aRowIdx) override;
   virtual bool IsProbablyLayoutTable() override;
   virtual Accessible* AsAccessible() override { return this; }
 
   // Accessible
   virtual TableAccessible* AsTable() override { return this; }
   virtual void Description(nsString& aDescription) override;
-  virtual a11y::role NativeRole() override;
+  virtual a11y::role NativeRole() const override;
   virtual uint64_t NativeState() override;
   virtual already_AddRefed<nsIPersistentProperties> NativeAttributes() override;
   virtual Relation RelationByType(RelationType aRelationType) override;
 
   virtual bool InsertChildAt(uint32_t aIndex, Accessible* aChild) override;
 
 protected:
   virtual ~HTMLTableAccessible() {}
@@ -218,17 +218,17 @@ protected:
  */
 class HTMLCaptionAccessible : public HyperTextAccessibleWrap
 {
 public:
   HTMLCaptionAccessible(nsIContent* aContent, DocAccessible* aDoc) :
     HyperTextAccessibleWrap(aContent, aDoc) { mType = eHTMLCaptionType; }
 
   // Accessible
-  virtual a11y::role NativeRole() override;
+  virtual a11y::role NativeRole() const override;
   virtual Relation RelationByType(RelationType aRelationType) override;
 
 protected:
   virtual ~HTMLCaptionAccessible() { }
 };
 
 } // namespace a11y
 } // namespace mozilla
--- a/accessible/windows/msaa/HTMLWin32ObjectAccessible.cpp
+++ b/accessible/windows/msaa/HTMLWin32ObjectAccessible.cpp
@@ -34,17 +34,17 @@ HTMLWin32ObjectOwnerAccessible::
 void
 HTMLWin32ObjectOwnerAccessible::Shutdown()
 {
   AccessibleWrap::Shutdown();
   mNativeAccessible = nullptr;
 }
 
 role
-HTMLWin32ObjectOwnerAccessible::NativeRole()
+HTMLWin32ObjectOwnerAccessible::NativeRole() const
 {
   return roles::EMBEDDED_OBJECT;
 }
 
 bool
 HTMLWin32ObjectOwnerAccessible::NativelyUnavailable() const
 {
   // XXX: No HWND means this is windowless plugin which is not accessible in
--- a/accessible/windows/msaa/HTMLWin32ObjectAccessible.h
+++ b/accessible/windows/msaa/HTMLWin32ObjectAccessible.h
@@ -27,17 +27,17 @@ public:
   // Mozilla tree, and returns null for previous and next sibling. This would
   // have the effect of cutting off all content after the plugin.
   HTMLWin32ObjectOwnerAccessible(nsIContent* aContent,
                                  DocAccessible* aDoc, void* aHwnd);
   virtual ~HTMLWin32ObjectOwnerAccessible() {}
 
   // Accessible
   virtual void Shutdown();
-  virtual mozilla::a11y::role NativeRole();
+  virtual mozilla::a11y::role NativeRole() const override;
   virtual bool NativelyUnavailable() const;
 
 protected:
   void* mHwnd;
   RefPtr<Accessible> mNativeAccessible;
 };
 
 /**
--- a/accessible/xul/XULAlertAccessible.cpp
+++ b/accessible/xul/XULAlertAccessible.cpp
@@ -22,17 +22,17 @@ XULAlertAccessible::
   mGenericTypes |= eAlert;
 }
 
 XULAlertAccessible::~XULAlertAccessible()
 {
 }
 
 role
-XULAlertAccessible::NativeRole()
+XULAlertAccessible::NativeRole() const
 {
   return roles::ALERT;
 }
 
 uint64_t
 XULAlertAccessible::NativeState()
 {
   return Accessible::NativeState() | states::ALERT;
--- a/accessible/xul/XULAlertAccessible.h
+++ b/accessible/xul/XULAlertAccessible.h
@@ -19,17 +19,17 @@ class XULAlertAccessible : public Access
 {
 public:
   XULAlertAccessible(nsIContent* aContent, DocAccessible* aDoc);
 
   NS_INLINE_DECL_REFCOUNTING_INHERITED(XULAlertAccessible, AccessibleWrap)
 
   // Accessible
   virtual mozilla::a11y::ENameValueFlag Name(nsString& aName) override;
-  virtual a11y::role NativeRole() override;
+  virtual a11y::role NativeRole() const override;
   virtual uint64_t NativeState() override;
 
   // Widgets
   virtual bool IsWidget() const override;
   virtual Accessible* ContainerWidget() const override;
 
 protected:
   ~XULAlertAccessible();
--- a/accessible/xul/XULColorPickerAccessible.cpp
+++ b/accessible/xul/XULColorPickerAccessible.cpp
@@ -32,17 +32,17 @@ void
 XULColorPickerTileAccessible::Value(nsString& aValue)
 {
   aValue.Truncate();
 
   mContent->AsElement()->GetAttr(kNameSpaceID_None, nsGkAtoms::color, aValue);
 }
 
 role
-XULColorPickerTileAccessible::NativeRole()
+XULColorPickerTileAccessible::NativeRole() const
 {
   return roles::PUSHBUTTON;
 }
 
 uint64_t
 XULColorPickerTileAccessible::NativeState()
 {
   uint64_t state = AccessibleWrap::NativeState();
@@ -91,17 +91,17 @@ XULColorPickerAccessible::
 uint64_t
 XULColorPickerAccessible::NativeState()
 {
   uint64_t state = AccessibleWrap::NativeState();
   return state | states::HASPOPUP;
 }
 
 role
-XULColorPickerAccessible::NativeRole()
+XULColorPickerAccessible::NativeRole() const
 {
   return roles::BUTTONDROPDOWNGRID;
 }
 
 ////////////////////////////////////////////////////////////////////////////////
 // XULColorPickerAccessible: Widgets
 
 bool
--- a/accessible/xul/XULColorPickerAccessible.h
+++ b/accessible/xul/XULColorPickerAccessible.h
@@ -17,17 +17,17 @@ namespace a11y {
 class XULColorPickerTileAccessible : public AccessibleWrap
 {
 public:
   XULColorPickerTileAccessible(nsIContent* aContent,
                                DocAccessible* aDoc);
 
   // Accessible
   virtual void Value(nsString& aValue) override;
-  virtual a11y::role NativeRole() override;
+  virtual a11y::role NativeRole() const override;
   virtual uint64_t NativeState() override;
   virtual uint64_t NativeInteractiveState() const override;
 
   // Widgets
   virtual Accessible* ContainerWidget() const override;
 };
 
 
@@ -35,17 +35,17 @@ public:
  * Used for colorpicker button (xul:colorpicker@type="button").
  */
 class XULColorPickerAccessible : public XULColorPickerTileAccessible
 {
 public:
   XULColorPickerAccessible(nsIContent* aContent, DocAccessible* aDoc);
 
   // Accessible
-  virtual a11y::role NativeRole() override;
+  virtual a11y::role NativeRole() const override;
   virtual uint64_t NativeState() override;
 
   // Widgets
   virtual bool IsWidget() const override;
   virtual bool IsActiveWidget() const override;
   virtual bool AreItemsOperable() const override;
 
   virtual bool IsAcceptableChild(nsIContent* aEl) const override;
--- a/accessible/xul/XULComboboxAccessible.cpp
+++ b/accessible/xul/XULComboboxAccessible.cpp
@@ -39,17 +39,17 @@ XULComboboxAccessible::
       !mContent->AsElement()->AttrValueIs(kNameSpaceID_None,
                                           nsGkAtoms::editable, nsGkAtoms::_true,
                                           eIgnoreCase)) {
     mStateFlags |= eNoXBLKids;
   }
 }
 
 role
-XULComboboxAccessible::NativeRole()
+XULComboboxAccessible::NativeRole() const
 {
   return IsAutoComplete() ? roles::AUTOCOMPLETE : roles::COMBOBOX;
 }
 
 uint64_t
 XULComboboxAccessible::NativeState()
 {
   // As a nsComboboxAccessible we can have the following states:
--- a/accessible/xul/XULComboboxAccessible.h
+++ b/accessible/xul/XULComboboxAccessible.h
@@ -19,17 +19,17 @@ class XULComboboxAccessible : public Acc
 public:
   enum { eAction_Click = 0 };
 
   XULComboboxAccessible(nsIContent* aContent, DocAccessible* aDoc);
 
   // Accessible
   virtual void Description(nsString& aDescription) override;
   virtual void Value(nsString& aValue) override;
-  virtual a11y::role NativeRole() override;
+  virtual a11y::role NativeRole() const override;
   virtual uint64_t NativeState() override;
 
   // ActionAccessible
   virtual uint8_t ActionCount() override;
   virtual void ActionNameAt(uint8_t aIndex, nsAString& aName) override;
   virtual bool DoAction(uint8_t aIndex) override;
 
   // Widgets
--- a/accessible/xul/XULElementAccessibles.cpp
+++ b/accessible/xul/XULElementAccessibles.cpp
@@ -68,17 +68,17 @@ XULLabelAccessible::NativeName(nsString&
   // from the accessible text interface or from the children
   if (mValueTextLeaf)
     return mValueTextLeaf->Name(aName);
 
   return Accessible::NativeName(aName);
 }
 
 role
-XULLabelAccessible::NativeRole()
+XULLabelAccessible::NativeRole() const
 {
   return roles::LABEL;
 }
 
 uint64_t
 XULLabelAccessible::NativeState()
 {
   // Labels and description have read only state
@@ -122,17 +122,17 @@ XULLabelAccessible::UpdateLabelValue(con
 }
 
 
 ////////////////////////////////////////////////////////////////////////////////
 // XULLabelTextLeafAccessible
 ////////////////////////////////////////////////////////////////////////////////
 
 role
-XULLabelTextLeafAccessible::NativeRole()
+XULLabelTextLeafAccessible::NativeRole() const
 {
   return roles::TEXT_LEAF;
 }
 
 uint64_t
 XULLabelTextLeafAccessible::NativeState()
 {
   return TextLeafAccessibleWrap::NativeState() | states::READONLY;
@@ -151,17 +151,17 @@ XULTooltipAccessible::
 
 uint64_t
 XULTooltipAccessible::NativeState()
 {
   return LeafAccessible::NativeState() | states::READONLY;
 }
 
 role
-XULTooltipAccessible::NativeRole()
+XULTooltipAccessible::NativeRole() const
 {
   return roles::TOOLTIP;
 }
 
 
 ////////////////////////////////////////////////////////////////////////////////
 // XULLinkAccessible
 ////////////////////////////////////////////////////////////////////////////////
@@ -194,17 +194,17 @@ XULLinkAccessible::NativeName(nsString& 
   if (!aName.IsEmpty())
     return eNameOK;
 
   nsTextEquivUtils::GetNameFromSubtree(this, aName);
   return aName.IsEmpty() ? eNameOK : eNameFromSubtree;
 }
 
 role
-XULLinkAccessible::NativeRole()
+XULLinkAccessible::NativeRole() const
 {
   return roles::LINK;
 }
 
 
 uint64_t
 XULLinkAccessible::NativeLinkState() const
 {
--- a/accessible/xul/XULElementAccessibles.h
+++ b/accessible/xul/XULElementAccessibles.h
@@ -19,17 +19,17 @@ class XULLabelTextLeafAccessible;
  */
 class XULLabelAccessible : public HyperTextAccessibleWrap
 {
 public:
   XULLabelAccessible(nsIContent* aContent, DocAccessible* aDoc);
 
   // Accessible
   virtual void Shutdown() override;
-  virtual a11y::role NativeRole() override;
+  virtual a11y::role NativeRole() const override;
   virtual uint64_t NativeState() override;
   virtual Relation RelationByType(RelationType aType) override;
 
   void UpdateLabelValue(const nsString& aValue);
 
 protected:
   // Accessible
   virtual ENameValueFlag NativeName(nsString& aName) override;
@@ -54,44 +54,44 @@ class XULLabelTextLeafAccessible final :
 public:
   XULLabelTextLeafAccessible(nsIContent* aContent, DocAccessible* aDoc) :
     TextLeafAccessibleWrap(aContent, aDoc)
   { mStateFlags |= eSharedNode; }
 
   virtual ~XULLabelTextLeafAccessible() { }
 
   // Accessible
-  virtual a11y::role NativeRole() override;
+  virtual a11y::role NativeRole() const override;
   virtual uint64_t NativeState() override;
 };
 
 
 /**
  * Used for XUL tooltip element.
  */
 class XULTooltipAccessible : public LeafAccessible
 {
 
 public:
   XULTooltipAccessible(nsIContent* aContent, DocAccessible* aDoc);
 
   // Accessible
-  virtual a11y::role NativeRole() override;
+  virtual a11y::role NativeRole() const override;
   virtual uint64_t NativeState() override;
 };
 
 class XULLinkAccessible : public XULLabelAccessible
 {
 
 public:
   XULLinkAccessible(nsIContent* aContent, DocAccessible* aDoc);
 
   // Accessible
   virtual void Value(nsString& aValue) override;
-  virtual a11y::role NativeRole() override;
+  virtual a11y::role NativeRole() const override;
   virtual uint64_t NativeLinkState() const override;
 
   // ActionAccessible
   virtual uint8_t ActionCount() override;
   virtual void ActionNameAt(uint8_t aIndex, nsAString& aName) override;
   virtual bool DoAction(uint8_t aIndex) override;
 
   // HyperLinkAccessible
--- a/accessible/xul/XULFormControlAccessible.cpp
+++ b/accessible/xul/XULFormControlAccessible.cpp
@@ -77,17 +77,17 @@ XULButtonAccessible::DoAction(uint8_t aI
   DoCommand();
   return true;
 }
 
 ////////////////////////////////////////////////////////////////////////////////
 // XULButtonAccessible: Accessible
 
 role
-XULButtonAccessible::NativeRole()
+XULButtonAccessible::NativeRole() const
 {
   return roles::PUSHBUTTON;
 }
 
 uint64_t
 XULButtonAccessible::NativeState()
 {
   // Possible states: focused, focusable, unavailable(disabled).
@@ -259,17 +259,17 @@ XULDropmarkerAccessible::DoAction(uint8_
   if (index == eAction_Click) {
     DropmarkerOpen(true); // Reverse the open attribute
     return true;
   }
   return false;
 }
 
 role
-XULDropmarkerAccessible::NativeRole()
+XULDropmarkerAccessible::NativeRole() const
 {
   return roles::PUSHBUTTON;
 }
 
 uint64_t
 XULDropmarkerAccessible::NativeState()
 {
   return DropmarkerOpen(false) ? states::PRESSED : 0;
@@ -281,17 +281,17 @@ XULDropmarkerAccessible::NativeState()
 
 XULCheckboxAccessible::
   XULCheckboxAccessible(nsIContent* aContent, DocAccessible* aDoc) :
   LeafAccessible(aContent, aDoc)
 {
 }
 
 role
-XULCheckboxAccessible::NativeRole()
+XULCheckboxAccessible::NativeRole() const
 {
   return roles::CHECKBUTTON;
 }
 
 uint8_t
 XULCheckboxAccessible::ActionCount()
 {
   return 1;
@@ -347,17 +347,17 @@ XULCheckboxAccessible::NativeState()
 
 XULGroupboxAccessible::
   XULGroupboxAccessible(nsIContent* aContent, DocAccessible* aDoc) :
   AccessibleWrap(aContent, aDoc)
 {
 }
 
 role
-XULGroupboxAccessible::NativeRole()
+XULGroupboxAccessible::NativeRole() const
 {
   return roles::GROUPING;
 }
 
 ENameValueFlag
 XULGroupboxAccessible::NativeName(nsString& aName)
 {
   // XXX: we use the first related accessible only.
@@ -457,17 +457,17 @@ XULRadioButtonAccessible::ContainerWidge
 
 XULRadioGroupAccessible::
   XULRadioGroupAccessible(nsIContent* aContent, DocAccessible* aDoc) :
   XULSelectControlAccessible(aContent, aDoc)
 {
 }
 
 role
-XULRadioGroupAccessible::NativeRole()
+XULRadioGroupAccessible::NativeRole() const
 {
   return roles::RADIO_GROUP;
 }
 
 uint64_t
 XULRadioGroupAccessible::NativeInteractiveState() const
 {
   // The radio group is not focusable. Sometimes the focus controller will
@@ -504,17 +504,17 @@ XULRadioGroupAccessible::AreItemsOperabl
 
 XULStatusBarAccessible::
   XULStatusBarAccessible(nsIContent* aContent, DocAccessible* aDoc) :
   AccessibleWrap(aContent, aDoc)
 {
 }
 
 role
-XULStatusBarAccessible::NativeRole()
+XULStatusBarAccessible::NativeRole() const
 {
   return roles::STATUSBAR;
 }
 
 
 ////////////////////////////////////////////////////////////////////////////////
 // XULToolbarButtonAccessible
 ////////////////////////////////////////////////////////////////////////////////
@@ -573,17 +573,17 @@ XULToolbarButtonAccessible::IsSeparator(
 
 XULToolbarAccessible::
   XULToolbarAccessible(nsIContent* aContent, DocAccessible* aDoc) :
   AccessibleWrap(aContent, aDoc)
 {
 }
 
 role
-XULToolbarAccessible::NativeRole()
+XULToolbarAccessible::NativeRole() const
 {
   return roles::TOOLBAR;
 }
 
 ENameValueFlag
 XULToolbarAccessible::NativeName(nsString& aName)
 {
   if (mContent->AsElement()->GetAttr(kNameSpaceID_None, nsGkAtoms::toolbarname, aName))
@@ -599,17 +599,17 @@ XULToolbarAccessible::NativeName(nsStrin
 
 XULToolbarSeparatorAccessible::
   XULToolbarSeparatorAccessible(nsIContent* aContent, DocAccessible* aDoc) :
   LeafAccessible(aContent, aDoc)
 {
 }
 
 role
-XULToolbarSeparatorAccessible::NativeRole()
+XULToolbarSeparatorAccessible::NativeRole() const
 {
   return roles::SEPARATOR;
 }
 
 uint64_t
 XULToolbarSeparatorAccessible::NativeState()
 {
   return 0;
--- a/accessible/xul/XULFormControlAccessible.h
+++ b/accessible/xul/XULFormControlAccessible.h
@@ -31,17 +31,17 @@ class XULButtonAccessible : public Acces
 public:
   enum { eAction_Click = 0 };
   XULButtonAccessible(nsIContent* aContent, DocAccessible* aDoc);
 
   // nsISupports
   NS_INLINE_DECL_REFCOUNTING_INHERITED(XULButtonAccessible, AccessibleWrap)
 
   // Accessible
-  virtual mozilla::a11y::role NativeRole() override;
+  virtual mozilla::a11y::role NativeRole() const override;
   virtual uint64_t NativeState() override;
 
   // ActionAccessible
   virtual uint8_t ActionCount() override;
   virtual void ActionNameAt(uint8_t aIndex, nsAString& aName) override;
   virtual bool DoAction(uint8_t aIndex) override;
 
   // Widgets
@@ -65,17 +65,17 @@ protected:
  */
 class XULCheckboxAccessible : public LeafAccessible
 {
 public:
   enum { eAction_Click = 0 };
   XULCheckboxAccessible(nsIContent* aContent, DocAccessible* aDoc);
 
   // Accessible
-  virtual mozilla::a11y::role NativeRole() override;
+  virtual mozilla::a11y::role NativeRole() const override;
   virtual uint64_t NativeState() override;
 
   // ActionAccessible
   virtual uint8_t ActionCount() override;
   virtual void ActionNameAt(uint8_t aIndex, nsAString& aName) override;
   virtual bool DoAction(uint8_t aIndex) override;
 };
 
@@ -84,17 +84,17 @@ public:
  */
 class XULDropmarkerAccessible : public LeafAccessible
 {
 public:
   enum { eAction_Click = 0 };
   XULDropmarkerAccessible(nsIContent* aContent, DocAccessible* aDoc);
 
   // Accessible
-  virtual mozilla::a11y::role NativeRole() override;
+  virtual mozilla::a11y::role NativeRole() const override;
   virtual uint64_t NativeState() override;
 
   // ActionAccessible
   virtual uint8_t ActionCount() override;
   virtual void ActionNameAt(uint8_t aIndex, nsAString& aName) override;
   virtual bool DoAction(uint8_t aIndex) override;
 
 private:
@@ -105,17 +105,17 @@ private:
  * Used for XUL groupbox element.
  */
 class XULGroupboxAccessible final : public AccessibleWrap
 {
 public:
   XULGroupboxAccessible(nsIContent* aContent, DocAccessible* aDoc);
 
   // Accessible
-  virtual mozilla::a11y::role NativeRole() override;
+  virtual mozilla::a11y::role NativeRole() const override;
   virtual Relation RelationByType(RelationType aType) override;
 
 protected:
   // Accessible
   virtual ENameValueFlag NativeName(nsString& aName) override;
 };
 
 /**
@@ -139,17 +139,17 @@ public:
  * Used for XUL radiogroup element.
  */
 class XULRadioGroupAccessible : public XULSelectControlAccessible
 {
 public:
   XULRadioGroupAccessible(nsIContent* aContent, DocAccessible* aDoc);
 
   // Accessible
-  virtual mozilla::a11y::role NativeRole() override;
+  virtual mozilla::a11y::role NativeRole() const override;
   virtual uint64_t NativeInteractiveState() const override;
 
   // Widgets
   virtual bool IsWidget() const override;
   virtual bool IsActiveWidget() const override;
   virtual bool AreItemsOperable() const override;
 };
 
@@ -157,17 +157,17 @@ public:
  * Used for XUL statusbar element.
  */
 class XULStatusBarAccessible : public AccessibleWrap
 {
 public:
   XULStatusBarAccessible(nsIContent* aContent, DocAccessible* aDoc);
 
   // Accessible
-  virtual mozilla::a11y::role NativeRole() override;
+  virtual mozilla::a11y::role NativeRole() const override;
 };
 
 /**
  * Used for XUL toolbarbutton element.
  */
 class XULToolbarButtonAccessible : public XULButtonAccessible
 {
 public:
@@ -185,34 +185,34 @@ public:
  * Used for XUL toolbar element.
  */
 class XULToolbarAccessible : public AccessibleWrap
 {
 public:
   XULToolbarAccessible(nsIContent* aContent, DocAccessible* aDoc);
 
   // Accessible
-  virtual mozilla::a11y::role NativeRole() override;
+  virtual mozilla::a11y::role NativeRole() const override;
 
 protected:
   // Accessible
   virtual ENameValueFlag NativeName(nsString& aName) override;
 };
 
 /**
  * Used for XUL toolbarseparator element.
  */
 class XULToolbarSeparatorAccessible : public LeafAccessible
 {
 public:
   XULToolbarSeparatorAccessible(nsIContent* aContent,
                                 DocAccessible* aDoc);
 
   // Accessible
-  virtual mozilla::a11y::role NativeRole() override;
+  virtual mozilla::a11y::role NativeRole() const override;
   virtual uint64_t NativeState() override;
 };
 
 } // namespace a11y
 } // namespace mozilla
 
 #endif
 
--- a/accessible/xul/XULListboxAccessible.cpp
+++ b/accessible/xul/XULListboxAccessible.cpp
@@ -30,17 +30,17 @@ using namespace mozilla::a11y;
 
 XULColumAccessible::
   XULColumAccessible(nsIContent* aContent, DocAccessible* aDoc) :
   AccessibleWrap(aContent, aDoc)
 {
 }
 
 role
-XULColumAccessible::NativeRole()
+XULColumAccessible::NativeRole() const
 {
   return roles::LIST;
 }
 
 uint64_t
 XULColumAccessible::NativeState()
 {
   return states::READONLY;
@@ -53,17 +53,17 @@ XULColumAccessible::NativeState()
 
 XULColumnItemAccessible::
   XULColumnItemAccessible(nsIContent* aContent, DocAccessible* aDoc) :
   LeafAccessible(aContent, aDoc)
 {
 }
 
 role
-XULColumnItemAccessible::NativeRole()
+XULColumnItemAccessible::NativeRole() const
 {
   return roles::COLUMNHEADER;
 }
 
 uint64_t
 XULColumnItemAccessible::NativeState()
 {
   return states::READONLY;
@@ -147,17 +147,17 @@ XULListboxAccessible::Value(nsString& aV
     nsCOMPtr<nsIDOMXULSelectControlItemElement> selectedItem;
     select->GetSelectedItem(getter_AddRefs(selectedItem));
     if (selectedItem)
       selectedItem->GetLabel(aValue);
   }
 }
 
 role
-XULListboxAccessible::NativeRole()
+XULListboxAccessible::NativeRole() const
 {
   // A richlistbox is used with the new autocomplete URL bar, and has a parent
   // popup <panel>.
   if (mContent->GetParent() && mContent->GetParent()->IsXULElement(nsGkAtoms::panel))
     return roles::COMBOBOX_LIST;
 
   return IsMulticolumn() ? roles::TABLE : roles::LISTBOX;
 }
@@ -587,17 +587,17 @@ XULListitemAccessible::NativeName(nsStri
       return eNameOK;
     }
   }
 
   return Accessible::NativeName(aName);
 }
 
 role
-XULListitemAccessible::NativeRole()
+XULListitemAccessible::NativeRole() const
 {
   Accessible* list = GetListAccessible();
   if (!list) {
     NS_ERROR("No list accessible for listitem accessible!");
     return roles::NOTHING;
   }
 
   if (list->Role() == roles::TABLE)
@@ -779,17 +779,17 @@ XULListCellAccessible::Selected()
 
   return table->IsRowSelected(RowIdx());
 }
 
 ////////////////////////////////////////////////////////////////////////////////
 // XULListCellAccessible. Accessible implementation
 
 role
-XULListCellAccessible::NativeRole()
+XULListCellAccessible::NativeRole() const
 {
   return roles::CELL;
 }
 
 already_AddRefed<nsIPersistentProperties>
 XULListCellAccessible::NativeAttributes()
 {
   nsCOMPtr<nsIPersistentProperties> attributes =
--- a/accessible/xul/XULListboxAccessible.h
+++ b/accessible/xul/XULListboxAccessible.h
@@ -22,31 +22,31 @@ namespace a11y {
  * (xul:treecols and xul:listcols).
  */
 class XULColumAccessible : public AccessibleWrap
 {
 public:
   XULColumAccessible(nsIContent* aContent, DocAccessible* aDoc);
 
   // Accessible
-  virtual a11y::role NativeRole() override;
+  virtual a11y::role NativeRole() const override;
   virtual uint64_t NativeState() override;
 };
 
 /**
  * XULColumnItemAccessible are accessibles for list and tree column elements
  * (xul:listcol and xul:treecol).
  */
 class XULColumnItemAccessible : public LeafAccessible
 {
 public:
   XULColumnItemAccessible(nsIContent* aContent, DocAccessible* aDoc);
 
   // Accessible
-  virtual a11y::role NativeRole() override;
+  virtual a11y::role NativeRole() const override;
   virtual uint64_t NativeState() override;
 
   // ActionAccessible
   virtual uint8_t ActionCount() override;
   virtual void ActionNameAt(uint8_t aIndex, nsAString& aName) override;
   virtual bool DoAction(uint8_t aIndex) override;
 
   enum { eAction_Click = 0 };
@@ -77,17 +77,17 @@ public:
   virtual void SelectedRowIndices(nsTArray<uint32_t>* aRows) override;
   virtual void SelectRow(uint32_t aRowIdx) override;
   virtual void UnselectRow(uint32_t aRowIdx) override;
   virtual Accessible* AsAccessible() override { return this; }
 
   // Accessible
   virtual void Value(nsString& aValue) override;
   virtual TableAccessible* AsTable() override { return this; }
-  virtual a11y::role NativeRole() override;
+  virtual a11y::role NativeRole() const override;
   virtual uint64_t NativeState() override;
 
   // Widgets
   virtual bool IsWidget() const override;
   virtual bool IsActiveWidget() const override;
   virtual bool AreItemsOperable() const override;
 
   virtual Accessible* ContainerWidget() const override;
@@ -108,17 +108,17 @@ public:
 
   NS_INLINE_DECL_REFCOUNTING_INHERITED(XULListitemAccessible,
                                        XULMenuitemAccessible)
 
   XULListitemAccessible(nsIContent* aContent, DocAccessible* aDoc);
 
   // Accessible
   virtual void Description(nsString& aDesc) override;
-  virtual a11y::role NativeRole() override;
+  virtual a11y::role NativeRole() const override;
   virtual uint64_t NativeState() override;
   virtual uint64_t NativeInteractiveState() const override;
 
   // Actions
   virtual void ActionNameAt(uint8_t index, nsAString& aName) override;
 
   // Widgets
   virtual Accessible* ContainerWidget() const override;
@@ -151,17 +151,17 @@ public:
 
   // nsISupports
   NS_INLINE_DECL_REFCOUNTING_INHERITED(XULListCellAccessible,
                                        HyperTextAccessibleWrap)
 
   // Accessible
   virtual TableCellAccessible* AsTableCell() override { return this; }
   virtual already_AddRefed<nsIPersistentProperties> NativeAttributes() override;
-  virtual a11y::role NativeRole() override;
+  virtual a11y::role NativeRole() const override;
 
   // TableCellAccessible
   virtual TableAccessible* Table() const override;
   virtual uint32_t ColIdx() const override;
   virtual uint32_t RowIdx() const override;
   virtual void ColHeaderCells(nsTArray<Accessible*>* aHeaderCells) override;
   virtual bool Selected() override;
 
--- a/accessible/xul/XULMenuAccessible.cpp
+++ b/accessible/xul/XULMenuAccessible.cpp
@@ -237,17 +237,17 @@ XULMenuitemAccessible::KeyboardShortcut(
   if (modifiersStr.Find("accel") != -1) {
     modifierMask |= KeyBinding::AccelModifier();
   }
 
   return KeyBinding(key, modifierMask);
 }
 
 role
-XULMenuitemAccessible::NativeRole()
+XULMenuitemAccessible::NativeRole() const
 {
   nsCOMPtr<nsIDOMXULContainerElement> xulContainer(do_QueryInterface(mContent));
   if (xulContainer)
     return roles::PARENT_MENUITEM;
 
   if (mParent && mParent->Role() == roles::COMBOBOX_LIST)
     return roles::COMBOBOX_OPTION;
 
@@ -363,17 +363,17 @@ XULMenuSeparatorAccessible::NativeState(
 
 ENameValueFlag
 XULMenuSeparatorAccessible::NativeName(nsString& aName)
 {
   return eNameOK;
 }
 
 role
-XULMenuSeparatorAccessible::NativeRole()
+XULMenuSeparatorAccessible::NativeRole() const
 {
   return roles::SEPARATOR;
 }
 
 bool
 XULMenuSeparatorAccessible::DoAction(uint8_t index)
 {
   return false;
@@ -449,17 +449,17 @@ XULMenupopupAccessible::NativeName(nsStr
     }
     content = content->GetFlattenedTreeParent();
   }
 
   return eNameOK;
 }
 
 role
-XULMenupopupAccessible::NativeRole()
+XULMenupopupAccessible::NativeRole() const
 {
   // If accessible is not bound to the tree (this happens while children are
   // cached) return general role.
   if (mParent) {
     if (mParent->IsCombobox() || mParent->IsAutoComplete())
       return roles::COMBOBOX_LIST;
 
     if (mParent->Role() == roles::PUSHBUTTON) {
@@ -546,17 +546,17 @@ XULMenubarAccessible::
 ENameValueFlag
 XULMenubarAccessible::NativeName(nsString& aName)
 {
   aName.AssignLiteral("Application");
   return eNameOK;
 }
 
 role
-XULMenubarAccessible::NativeRole()
+XULMenubarAccessible::NativeRole() const
 {
   return roles::MENUBAR;
 }
 
 ////////////////////////////////////////////////////////////////////////////////
 // XULMenubarAccessible: Widgets
 
 bool
--- a/accessible/xul/XULMenuAccessible.h
+++ b/accessible/xul/XULMenuAccessible.h
@@ -20,17 +20,17 @@ class XULMenuitemAccessible : public Acc
 {
 public:
   enum { eAction_Click = 0 };
 
   XULMenuitemAccessible(nsIContent* aContent, DocAccessible* aDoc);
 
   // Accessible
   virtual void Description(nsString& aDescription) override;
-  virtual a11y::role NativeRole() override;
+  virtual a11y::role NativeRole() const override;
   virtual uint64_t NativeState() override;
   virtual uint64_t NativeInteractiveState() const override;
   virtual int32_t GetLevelInternal() override;
 
   // ActionAccessible
   virtual uint8_t ActionCount() override;
   virtual void ActionNameAt(uint8_t aIndex, nsAString& aName) override;
   virtual bool DoAction(uint8_t aIndex) override;
@@ -51,17 +51,17 @@ protected:
  * Used for XUL menuseparator element.
  */
 class XULMenuSeparatorAccessible : public XULMenuitemAccessible
 {
 public:
   XULMenuSeparatorAccessible(nsIContent* aContent, DocAccessible* aDoc);
 
   // Accessible
-  virtual a11y::role NativeRole() override;
+  virtual a11y::role NativeRole() const override;
   virtual uint64_t NativeState() override;
 
   // ActionAccessible
   virtual uint8_t ActionCount() override;
   virtual void ActionNameAt(uint8_t aIndex, nsAString& aName) override;
   virtual bool DoAction(uint8_t aIndex) override;
 
 protected:
@@ -74,17 +74,17 @@ protected:
  * Used for XUL menupopup and panel.
  */
 class XULMenupopupAccessible : public XULSelectControlAccessible
 {
 public:
   XULMenupopupAccessible(nsIContent* aContent, DocAccessible* aDoc);
 
   // Accessible
-  virtual a11y::role NativeRole() override;
+  virtual a11y::role NativeRole() const override;
   virtual uint64_t NativeState() override;
 
   // Widgets
   virtual bool IsWidget() const override;
   virtual bool IsActiveWidget() const override;
   virtual bool AreItemsOperable() const override;
 
   virtual Accessible* ContainerWidget() const override;
@@ -98,17 +98,17 @@ protected:
  * Used for XUL menubar element.
  */
 class XULMenubarAccessible : public AccessibleWrap
 {
 public:
   XULMenubarAccessible(nsIContent* aContent, DocAccessible* aDoc);
 
   // Accessible
-  virtual a11y::role NativeRole() override;
+  virtual a11y::role NativeRole() const override;
 
   // Widget
   virtual bool IsActiveWidget() const override;
   virtual bool AreItemsOperable() const override;
   virtual Accessible* CurrentItem() override;
   virtual void SetCurrentItem(Accessible* aItem) override;
 
 protected:
--- a/accessible/xul/XULSliderAccessible.cpp
+++ b/accessible/xul/XULSliderAccessible.cpp
@@ -25,17 +25,17 @@ XULSliderAccessible::
   AccessibleWrap(aContent, aDoc)
 {
   mStateFlags |= eHasNumericValue | eNoXBLKids;
 }
 
 // Accessible
 
 role
-XULSliderAccessible::NativeRole()
+XULSliderAccessible::NativeRole() const
 {
   return roles::SLIDER;
 }
 
 uint64_t
 XULSliderAccessible::NativeInteractiveState() const
  {
   if (NativelyUnavailable())
@@ -202,15 +202,15 @@ XULThumbAccessible::
   AccessibleWrap(aContent, aDoc)
 {
 }
 
 ////////////////////////////////////////////////////////////////////////////////
 // XULThumbAccessible: Accessible
 
 role
-XULThumbAccessible::NativeRole()
+XULThumbAccessible::NativeRole() const
 {
   return roles::INDICATOR;
 }
 
 }
 }
--- a/accessible/xul/XULSliderAccessible.h
+++ b/accessible/xul/XULSliderAccessible.h
@@ -16,17 +16,17 @@ namespace a11y {
  */
 class XULSliderAccessible : public AccessibleWrap
 {
 public:
   XULSliderAccessible(nsIContent* aContent, DocAccessible* aDoc);
 
   // Accessible
   virtual void Value(nsString& aValue) override;
-  virtual a11y::role NativeRole() override;
+  virtual a11y::role NativeRole() const override;
   virtual uint64_t NativeInteractiveState() const override;
   virtual bool NativelyUnavailable() const override;
 
   // Value
   virtual double MaxValue() const override;
   virtual double MinValue() const override;
   virtual double CurValue() const override;
   virtual double Step() const override;
@@ -58,16 +58,16 @@ private:
  * Used for slider's thumb element.
  */
 class XULThumbAccessible : public AccessibleWrap
 {
 public:
   XULThumbAccessible(nsIContent* aContent, DocAccessible* aDoc);
 
   // Accessible
-  virtual a11y::role NativeRole() override;
+  virtual a11y::role NativeRole() const override;
 };
 
 } // namespace a11y
 } // namespace mozilla
 
 #endif
 
--- a/accessible/xul/XULTabAccessible.cpp
+++ b/accessible/xul/XULTabAccessible.cpp
@@ -60,17 +60,17 @@ XULTabAccessible::DoAction(uint8_t index
   }
   return false;
 }
 
 ////////////////////////////////////////////////////////////////////////////////
 // XULTabAccessible: Accessible
 
 role
-XULTabAccessible::NativeRole()
+XULTabAccessible::NativeRole() const
 {
   return roles::PAGETAB;
 }
 
 uint64_t
 XULTabAccessible::NativeState()
 {
   // Possible states: focused, focusable, unavailable(disabled), offscreen.
@@ -132,17 +132,17 @@ XULTabAccessible::RelationByType(Relatio
 
 XULTabsAccessible::
   XULTabsAccessible(nsIContent* aContent, DocAccessible* aDoc) :
   XULSelectControlAccessible(aContent, aDoc)
 {
 }
 
 role
-XULTabsAccessible::NativeRole()
+XULTabsAccessible::NativeRole() const
 {
   return roles::PAGETABLIST;
 }
 
 uint8_t
 XULTabsAccessible::ActionCount()
 {
   return 0;
@@ -162,33 +162,33 @@ XULTabsAccessible::NativeName(nsString& 
 }
 
 
 ////////////////////////////////////////////////////////////////////////////////
 // XULTabpanelsAccessible
 ////////////////////////////////////////////////////////////////////////////////
 
 role
-XULTabpanelsAccessible::NativeRole()
+XULTabpanelsAccessible::NativeRole() const
 {
   return roles::PANE;
 }
 
 ////////////////////////////////////////////////////////////////////////////////
 // XULTabpanelAccessible
 ////////////////////////////////////////////////////////////////////////////////
 
 XULTabpanelAccessible::
   XULTabpanelAccessible(nsIContent* aContent, DocAccessible* aDoc) :
   AccessibleWrap(aContent, aDoc)
 {
 }
 
 role
-XULTabpanelAccessible::NativeRole()
+XULTabpanelAccessible::NativeRole() const
 {
   return roles::PROPERTYPAGE;
 }
 
 Relation
 XULTabpanelAccessible::RelationByType(RelationType aType)
 {
   Relation rel = AccessibleWrap::RelationByType(aType);
--- a/accessible/xul/XULTabAccessible.h
+++ b/accessible/xul/XULTabAccessible.h
@@ -20,17 +20,17 @@ namespace a11y {
 class XULTabAccessible : public HyperTextAccessibleWrap
 {
 public:
   enum { eAction_Switch = 0 };
 
   XULTabAccessible(nsIContent* aContent, DocAccessible* aDoc);
 
   // Accessible
-  virtual a11y::role NativeRole() override;
+  virtual a11y::role NativeRole() const override;
   virtual uint64_t NativeState() override;
   virtual uint64_t NativeInteractiveState() const override;
   virtual Relation RelationByType(RelationType aType) override;
 
   // ActionAccessible
   virtual uint8_t ActionCount() override;
   virtual void ActionNameAt(uint8_t aIndex, nsAString& aName) override;
   virtual bool DoAction(uint8_t aIndex) override;
@@ -42,17 +42,17 @@ public:
  */
 class XULTabsAccessible : public XULSelectControlAccessible
 {
 public:
   XULTabsAccessible(nsIContent* aContent, DocAccessible* aDoc);
 
   // Accessible
   virtual void Value(nsString& aValue) override;
-  virtual a11y::role NativeRole() override;
+  virtual a11y::role NativeRole() const override;
 
   // ActionAccessible
   virtual uint8_t ActionCount() override;
 
 protected:
   // Accessible
   virtual ENameValueFlag NativeName(nsString& aName) override;
 };
@@ -64,34 +64,34 @@ protected:
 class XULTabpanelsAccessible : public AccessibleWrap
 {
 public:
   XULTabpanelsAccessible(nsIContent* aContent, DocAccessible* aDoc) :
     AccessibleWrap(aContent, aDoc)
     { mType = eXULTabpanelsType; }
 
   // Accessible
-  virtual a11y::role NativeRole() override;
+  virtual a11y::role NativeRole() const override;
 };
 
 
 /**
  * A tabpanel object, child elements of xul:tabpanels element.
  *
  * XXX: we need to move the class logic into generic class since
  * for example we do not create instance of this class for XUL textbox used as
  * a tabpanel.
  */
 class XULTabpanelAccessible : public AccessibleWrap
 {
 public:
   XULTabpanelAccessible(nsIContent* aContent, DocAccessible* aDoc);
 
   // Accessible
-  virtual a11y::role NativeRole() override;
+  virtual a11y::role NativeRole() const override;
   virtual Relation RelationByType(RelationType aType) override;
 };
 
 } // namespace a11y
 } // namespace mozilla
 
 #endif
 
--- a/accessible/xul/XULTreeAccessible.cpp
+++ b/accessible/xul/XULTreeAccessible.cpp
@@ -148,17 +148,17 @@ XULTreeAccessible::Shutdown()
 
   mTree = nullptr;
   mTreeView = nullptr;
 
   AccessibleWrap::Shutdown();
 }
 
 role
-XULTreeAccessible::NativeRole()
+XULTreeAccessible::NativeRole() const
 {
   // No primary column means we're in a list. In fact, history and mail turn off
   // the primary flag when switching to a flat view.
 
   nsIContent* child = nsTreeUtils::GetDescendantChild(mContent, nsGkAtoms::treechildren);
   NS_ASSERTION(child, "tree without treechildren!");
   nsTreeBodyFrame* treeFrame = do_QueryFrame(child->GetPrimaryFrame());
   NS_ASSERTION(treeFrame, "xul tree accessible for tree without a frame!");
@@ -1113,17 +1113,17 @@ XULTreeItemAccessible::Name(nsString& aN
 void
 XULTreeItemAccessible::Shutdown()
 {
   mColumn = nullptr;
   XULTreeItemAccessibleBase::Shutdown();
 }
 
 role
-XULTreeItemAccessible::NativeRole()
+XULTreeItemAccessible::NativeRole() const
 {
   nsCOMPtr<nsITreeColumns> columns;
   mTree->GetColumns(getter_AddRefs(columns));
   if (!columns) {
     NS_ERROR("No tree columns object in the tree!");
     return roles::NOTHING;
   }
 
--- a/accessible/xul/XULTreeAccessible.h
+++ b/accessible/xul/XULTreeAccessible.h
@@ -36,17 +36,17 @@ public:
 
   // nsISupports and cycle collection
   NS_DECL_ISUPPORTS_INHERITED
   NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED(XULTreeAccessible, Accessible)
 
   // Accessible
   virtual void Shutdown() override;
   virtual void Value(nsString& aValue) override;
-  virtual a11y::role NativeRole() override;
+  virtual a11y::role NativeRole() const override;
   virtual uint64_t NativeState() override;
   virtual Accessible* ChildAtPoint(int32_t aX, int32_t aY,
                                    EWhichChildAtPoint aWhichChild) override;
 
   virtual Accessible* GetChildAt(uint32_t aIndex) const override;
   virtual uint32_t ChildCount() const override;
   virtual Relation RelationByType(RelationType aType) override;
 
@@ -230,17 +230,17 @@ public:
   // nsISupports and cycle collection
   NS_DECL_ISUPPORTS_INHERITED
   NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED(XULTreeItemAccessible,
                                            XULTreeItemAccessibleBase)
 
   // Accessible
   virtual void Shutdown() override;
   virtual ENameValueFlag Name(nsString& aName) override;
-  virtual a11y::role NativeRole() override;
+  virtual a11y::role NativeRole() const override;
 
   // XULTreeItemAccessibleBase
   virtual void RowInvalidated(int32_t aStartColIdx, int32_t aEndColIdx) override;
 
 protected:
   virtual ~XULTreeItemAccessible();
 
   // XULTreeItemAccessible
--- a/accessible/xul/XULTreeGridAccessible.cpp
+++ b/accessible/xul/XULTreeGridAccessible.cpp
@@ -204,17 +204,17 @@ XULTreeGridAccessible::UnselectRow(uint3
   if (selection)
     selection->ClearRange(aRowIdx, aRowIdx);
 }
 
 ////////////////////////////////////////////////////////////////////////////////
 // XULTreeGridAccessible: Accessible implementation
 
 role
-XULTreeGridAccessible::NativeRole()
+XULTreeGridAccessible::NativeRole() const
 {
   nsCOMPtr<nsITreeColumns> treeColumns;
   mTree->GetColumns(getter_AddRefs(treeColumns));
   if (!treeColumns) {
     NS_ERROR("No treecolumns object for tree!");
     return roles::NOTHING;
   }
 
@@ -282,17 +282,17 @@ XULTreeGridRowAccessible::Shutdown()
   if (mDoc && !mDoc->IsDefunct()) {
     UnbindCacheEntriesFromDocument(mAccessibleCache);
   }
 
   XULTreeItemAccessibleBase::Shutdown();
 }
 
 role
-XULTreeGridRowAccessible::NativeRole()
+XULTreeGridRowAccessible::NativeRole() const
 {
   return roles::ROW;
 }
 
 ENameValueFlag
 XULTreeGridRowAccessible::Name(nsString& aName)
 {
   aName.Truncate();
@@ -677,17 +677,17 @@ XULTreeGridCellAccessible::NativeAttribu
   if (NS_SUCCEEDED(rv) && isCycler)
     nsAccUtils::SetAccAttr(attributes, nsGkAtoms::cycles,
                            NS_LITERAL_STRING("true"));
 
   return attributes.forget();
 }
 
 role
-XULTreeGridCellAccessible::NativeRole()
+XULTreeGridCellAccessible::NativeRole() const
 {
   return roles::GRID_CELL;
 }
 
 uint64_t
 XULTreeGridCellAccessible::NativeState()
 {
   if (!mTreeView)
--- a/accessible/xul/XULTreeGridAccessible.h
+++ b/accessible/xul/XULTreeGridAccessible.h
@@ -45,17 +45,17 @@ public:
   virtual void SelectedColIndices(nsTArray<uint32_t>* aCols) override;
   virtual void SelectedRowIndices(nsTArray<uint32_t>* aRows) override;
   virtual void SelectRow(uint32_t aRowIdx) override;
   virtual void UnselectRow(uint32_t aRowIdx) override;
   virtual Accessible* AsAccessible() override { return this; }
 
   // Accessible
   virtual TableAccessible* AsTable() override { return this; }
-  virtual a11y::role NativeRole() override;
+  virtual a11y::role NativeRole() const override;
 
 protected:
   virtual ~XULTreeGridAccessible();
 
   // XULTreeAccessible
   virtual already_AddRefed<Accessible>
     CreateTreeItemAccessible(int32_t aRow) const override;
 };
@@ -76,17 +76,17 @@ public:
 
   // nsISupports and cycle collection
   NS_DECL_ISUPPORTS_INHERITED
   NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED(XULTreeGridRowAccessible,
                                            XULTreeItemAccessibleBase)
 
   // Accessible
   virtual void Shutdown() override;
-  virtual a11y::role NativeRole() override;
+  virtual a11y::role NativeRole() const override;
   virtual ENameValueFlag Name(nsString& aName) override;
   virtual Accessible* ChildAtPoint(int32_t aX, int32_t aY,
                                    EWhichChildAtPoint aWhichChild) override;
 
   virtual Accessible* GetChildAt(uint32_t aIndex) const override;
   virtual uint32_t ChildCount() const override;
 
   // XULTreeItemAccessibleBase
@@ -128,17 +128,17 @@ public:
   virtual TableCellAccessible* AsTableCell() override { return this; }
   virtual nsRect BoundsInAppUnits() const override;
   virtual nsIntRect BoundsInCSSPixels() const override;
   virtual ENameValueFlag Name(nsString& aName) override;
   virtual Accessible* FocusedChild() override;
   virtual already_AddRefed<nsIPersistentProperties> NativeAttributes() override;
   virtual int32_t IndexInParent() const override;
   virtual Relation RelationByType(RelationType aType) override;
-  virtual a11y::role NativeRole() override;
+  virtual a11y::role NativeRole() const override;
   virtual uint64_t NativeState() override;
   virtual uint64_t NativeInteractiveState() const override;
 
   // ActionAccessible
   virtual uint8_t ActionCount() override;
   virtual void ActionNameAt(uint8_t aIndex, nsAString& aName) override;
   virtual bool DoAction(uint8_t aIndex) override;