Bug 1438193 - part11-8: DoAction r=surkov
authorTokio Kajitsuka <kajitsuka-tokio@g.ecc.u-tokyo.ac.jp>
Wed, 16 May 2018 02:40:22 +0900
changeset 418612 835d704af69f0dd13db43d8b5de85bd70c58c468
parent 418611 289b4c6fe61feee2537c0bc027781663516fa52c
child 418613 1c7fc1a1c68314f568ed25f35f885e901d17083a
push id34007
push usercsabou@mozilla.com
push dateThu, 17 May 2018 09:47:02 +0000
treeherdermozilla-central@8fb36531f7d0 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssurkov
bugs1438193
milestone62.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1438193 - part11-8: DoAction r=surkov turn DoAction & ActionCount into const functions
accessible/generic/Accessible.cpp
accessible/generic/Accessible.h
accessible/generic/BaseAccessibles.cpp
accessible/generic/BaseAccessibles.h
accessible/generic/FormControlAccessible.cpp
accessible/generic/FormControlAccessible.h
accessible/generic/ImageAccessible.cpp
accessible/generic/ImageAccessible.h
accessible/html/HTMLElementAccessibles.cpp
accessible/html/HTMLElementAccessibles.h
accessible/html/HTMLFormControlAccessible.cpp
accessible/html/HTMLFormControlAccessible.h
accessible/html/HTMLLinkAccessible.cpp
accessible/html/HTMLLinkAccessible.h
accessible/html/HTMLSelectAccessible.cpp
accessible/html/HTMLSelectAccessible.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/Accessible.cpp
+++ b/accessible/generic/Accessible.cpp
@@ -1521,17 +1521,17 @@ Accessible::LandmarkRole() const
 
 role
 Accessible::NativeRole() const
 {
   return roles::NOTHING;
 }
 
 uint8_t
-Accessible::ActionCount()
+Accessible::ActionCount() const
 {
   return GetActionRule() == eNoAction ? 0 : 1;
 }
 
 void
 Accessible::ActionNameAt(uint8_t aIndex, nsAString& aName)
 {
   aName.Truncate();
@@ -1594,17 +1594,17 @@ Accessible::ActionNameAt(uint8_t aIndex,
        aName.AssignLiteral("expand");
      else
        aName.AssignLiteral("collapse");
      return;
   }
 }
 
 bool
-Accessible::DoAction(uint8_t aIndex)
+Accessible::DoAction(uint8_t aIndex) const
 {
   if (aIndex != 0)
     return false;
 
   if (GetActionRule() != eNoAction) {
     DoCommand();
     return true;
   }
--- a/accessible/generic/Accessible.h
+++ b/accessible/generic/Accessible.h
@@ -681,17 +681,17 @@ public:
   bool HasGenericType(AccGenericType aType) const;
 
   //////////////////////////////////////////////////////////////////////////////
   // ActionAccessible
 
   /**
    * Return the number of actions that can be performed on this accessible.
    */
-  virtual uint8_t ActionCount();
+  virtual uint8_t ActionCount() const;
 
   /**
    * Return action name at given index.
    */
   virtual void ActionNameAt(uint8_t aIndex, nsAString& aName);
 
   /**
    * Default to localized action name.
@@ -701,17 +701,17 @@ public:
     nsAutoString name;
     ActionNameAt(aIndex, name);
     TranslateString(name, aDescription);
   }
 
   /**
    * Invoke the accessible action.
    */
-  virtual bool DoAction(uint8_t aIndex);
+  virtual bool DoAction(uint8_t aIndex) const;
 
   /**
    * Return access key, such as Alt+D.
    */
   virtual KeyBinding AccessKey() const;
 
   /**
    * Return global keyboard shortcut for default action, such as Ctrl+O for
--- a/accessible/generic/BaseAccessibles.cpp
+++ b/accessible/generic/BaseAccessibles.cpp
@@ -102,17 +102,17 @@ LinkableAccessible::Value(nsString& aVal
   bool isLink;
   const Accessible* actionAcc = ActionWalk(&isLink);
   if (isLink) {
     actionAcc->Value(aValue);
   }
 }
 
 uint8_t
-LinkableAccessible::ActionCount()
+LinkableAccessible::ActionCount() const
 {
   bool isLink, isOnclick, isLabelWithControl;
   ActionWalk(&isLink, &isOnclick, &isLabelWithControl);
   return (isLink || isOnclick || isLabelWithControl) ? 1 : 0;
 }
 
 const Accessible*
 LinkableAccessible::ActionWalk(bool* aIsLink, bool* aIsOnclick,
@@ -177,17 +177,17 @@ LinkableAccessible::ActionNameAt(uint8_t
       aName.AssignLiteral("jump");
     } else if (isOnclick || isLabelWithControl) {
       aName.AssignLiteral("click");
     }
   }
 }
 
 bool
-LinkableAccessible::DoAction(uint8_t aIndex)
+LinkableAccessible::DoAction(uint8_t aIndex) const
 {
   if (aIndex != eAction_Jump) {
     return false;
   }
 
   if (const Accessible* actionAcc = ActionWalk()) {
     return actionAcc->DoAction(aIndex);
   }
--- a/accessible/generic/BaseAccessibles.h
+++ b/accessible/generic/BaseAccessibles.h
@@ -63,19 +63,19 @@ public:
   NS_INLINE_DECL_REFCOUNTING_INHERITED(LinkableAccessible, AccessibleWrap)
 
   // Accessible
   virtual void Value(nsString& aValue) const override;
   virtual uint64_t NativeLinkState() const override;
   virtual void TakeFocus() const override;
 
   // ActionAccessible
-  virtual uint8_t ActionCount() override;
+  virtual uint8_t ActionCount() const override;
   virtual void ActionNameAt(uint8_t aIndex, nsAString& aName) override;
-  virtual bool DoAction(uint8_t index) override;
+  virtual bool DoAction(uint8_t index) const override;
   virtual KeyBinding AccessKey() const override;
 
   // ActionAccessible helpers
   const Accessible* ActionWalk(bool* aIsLink = nullptr,
                                bool* aIsOnclick = nullptr,
                                bool* aIsLabelWithControl = nullptr) const;
   // HyperLinkAccessible
   virtual already_AddRefed<nsIURI> AnchorURIAt(uint32_t aAnchorIndex) const override;
--- a/accessible/generic/FormControlAccessible.cpp
+++ b/accessible/generic/FormControlAccessible.cpp
@@ -148,30 +148,30 @@ ProgressMeterAccessible<Max>::SetCurValu
 
 RadioButtonAccessible::
   RadioButtonAccessible(nsIContent* aContent, DocAccessible* aDoc) :
   LeafAccessible(aContent, aDoc)
 {
 }
 
 uint8_t
-RadioButtonAccessible::ActionCount()
+RadioButtonAccessible::ActionCount() const
 {
   return 1;
 }
 
 void
 RadioButtonAccessible::ActionNameAt(uint8_t aIndex, nsAString& aName)
 {
   if (aIndex == eAction_Click)
     aName.AssignLiteral("select");
 }
 
 bool
-RadioButtonAccessible::DoAction(uint8_t aIndex)
+RadioButtonAccessible::DoAction(uint8_t aIndex) const
 {
   if (aIndex != eAction_Click)
     return false;
 
   DoCommand();
   return true;
 }
 
--- a/accessible/generic/FormControlAccessible.h
+++ b/accessible/generic/FormControlAccessible.h
@@ -54,19 +54,19 @@ class RadioButtonAccessible : public Lea
 
 public:
   RadioButtonAccessible(nsIContent* aContent, DocAccessible* aDoc);
 
   // Accessible
   virtual mozilla::a11y::role NativeRole() const override;
 
   // ActionAccessible
-  virtual uint8_t ActionCount() override;
+  virtual uint8_t ActionCount() const override;
   virtual void ActionNameAt(uint8_t aIndex, nsAString& aName) override;
-  virtual bool DoAction(uint8_t aIndex) override;
+  virtual bool DoAction(uint8_t aIndex) const override;
 
   enum { eAction_Click = 0 };
 
   // Widgets
   virtual bool IsWidget() const override;
 };
 
 } // namespace a11y
--- a/accessible/generic/ImageAccessible.cpp
+++ b/accessible/generic/ImageAccessible.cpp
@@ -94,34 +94,34 @@ ImageAccessible::NativeRole() const
 {
   return roles::GRAPHIC;
 }
 
 ////////////////////////////////////////////////////////////////////////////////
 // Accessible
 
 uint8_t
-ImageAccessible::ActionCount()
+ImageAccessible::ActionCount() const
 {
   uint8_t actionCount = LinkableAccessible::ActionCount();
   return HasLongDesc() ? actionCount + 1 : actionCount;
 }
 
 void
 ImageAccessible::ActionNameAt(uint8_t aIndex, nsAString& aName)
 {
   aName.Truncate();
   if (IsLongDescIndex(aIndex) && HasLongDesc())
     aName.AssignLiteral("showlongdesc");
   else
     LinkableAccessible::ActionNameAt(aIndex, aName);
 }
 
 bool
-ImageAccessible::DoAction(uint8_t aIndex)
+ImageAccessible::DoAction(uint8_t aIndex) const
 {
   // Get the long description uri and open in a new window.
   if (!IsLongDescIndex(aIndex))
     return LinkableAccessible::DoAction(aIndex);
 
   nsCOMPtr<nsIURI> uri = GetLongDescURI();
   if (!uri)
     return false;
@@ -211,13 +211,13 @@ ImageAccessible::GetLongDescURI() const
       }
     }
   }
 
   return nullptr;
 }
 
 bool
-ImageAccessible::IsLongDescIndex(uint8_t aIndex)
+ImageAccessible::IsLongDescIndex(uint8_t aIndex) const
 {
   return aIndex == LinkableAccessible::ActionCount();
 }
 
--- a/accessible/generic/ImageAccessible.h
+++ b/accessible/generic/ImageAccessible.h
@@ -22,19 +22,19 @@ public:
   ImageAccessible(nsIContent* aContent, DocAccessible* aDoc);
 
   // Accessible
   virtual a11y::role NativeRole() const override;
   virtual uint64_t NativeState() override;
   virtual already_AddRefed<nsIPersistentProperties> NativeAttributes() override;
 
   // ActionAccessible
-  virtual uint8_t ActionCount() override;
+  virtual uint8_t ActionCount() const override;
   virtual void ActionNameAt(uint8_t aIndex, nsAString& aName) override;
-  virtual bool DoAction(uint8_t aIndex) override;
+  virtual bool DoAction(uint8_t aIndex) const override;
 
   // ImageAccessible
   nsIntPoint Position(uint32_t aCoordType);
   nsIntSize Size();
 
 protected:
   virtual ~ImageAccessible();
 
@@ -62,17 +62,17 @@ private:
    * It is always assumed that the highest possible index opens the longdesc.
    * This doesn't check that there is actually a longdesc, just that the index
    * would be correct if there was one.
    *
    * @param aIndex  The 0-based index to be tested.
    *
    * @returns  true if index is valid for longdesc action.
    */
-  inline bool IsLongDescIndex(uint8_t aIndex);
+  inline bool IsLongDescIndex(uint8_t aIndex) const;
 
 };
 
 ////////////////////////////////////////////////////////////////////////////////
 // Accessible downcasting method
 
 inline ImageAccessible*
 Accessible::AsImage()
--- a/accessible/html/HTMLElementAccessibles.cpp
+++ b/accessible/html/HTMLElementAccessibles.cpp
@@ -71,32 +71,32 @@ HTMLLabelAccessible::RelationByType(Rela
     dom::HTMLLabelElement* label = dom::HTMLLabelElement::FromNode(mContent);
     rel.AppendTarget(mDoc, label->GetControl());
   }
 
   return rel;
 }
 
 uint8_t
-HTMLLabelAccessible::ActionCount()
+HTMLLabelAccessible::ActionCount() const
 {
   return nsCoreUtils::IsLabelWithControl(mContent) ? 1 : 0;
 }
 
 void
 HTMLLabelAccessible::ActionNameAt(uint8_t aIndex, nsAString& aName)
 {
   if (aIndex == 0) {
     if (nsCoreUtils::IsLabelWithControl(mContent))
       aName.AssignLiteral("click");
   }
 }
 
 bool
-HTMLLabelAccessible::DoAction(uint8_t aIndex)
+HTMLLabelAccessible::DoAction(uint8_t aIndex) const
 {
   if (aIndex != 0)
     return false;
 
   DoCommand();
   return true;
 }
 
@@ -122,17 +122,17 @@ HTMLOutputAccessible::RelationByType(Rel
 HTMLSummaryAccessible::
   HTMLSummaryAccessible(nsIContent* aContent, DocAccessible* aDoc) :
   HyperTextAccessibleWrap(aContent, aDoc)
 {
   mGenericTypes |= eButton;
 }
 
 uint8_t
-HTMLSummaryAccessible::ActionCount()
+HTMLSummaryAccessible::ActionCount() const
 {
   return 1;
 }
 
 void
 HTMLSummaryAccessible::ActionNameAt(uint8_t aIndex, nsAString& aName)
 {
   if (aIndex != eAction_Click) {
@@ -152,17 +152,17 @@ HTMLSummaryAccessible::ActionNameAt(uint
   if (details->Open()) {
     aName.AssignLiteral("collapse");
   } else {
     aName.AssignLiteral("expand");
   }
 }
 
 bool
-HTMLSummaryAccessible::DoAction(uint8_t aIndex)
+HTMLSummaryAccessible::DoAction(uint8_t aIndex) const
 {
   if (aIndex != eAction_Click)
     return false;
 
   DoCommand();
   return true;
 }
 
--- a/accessible/html/HTMLElementAccessibles.h
+++ b/accessible/html/HTMLElementAccessibles.h
@@ -59,19 +59,19 @@ public:
 
   NS_INLINE_DECL_REFCOUNTING_INHERITED(HTMLLabelAccessible,
                                        HyperTextAccessibleWrap)
 
   // Accessible
   virtual Relation RelationByType(RelationType aType) const override;
 
   // ActionAccessible
-  virtual uint8_t ActionCount() override;
+  virtual uint8_t ActionCount() const override;
   virtual void ActionNameAt(uint8_t aIndex, nsAString& aName) override;
-  virtual bool DoAction(uint8_t aIndex) override;
+  virtual bool DoAction(uint8_t aIndex) const override;
 
 protected:
   virtual ~HTMLLabelAccessible() {}
   virtual ENameValueFlag NativeName(nsString& aName) const override;
 };
 
 /**
  * Used for HTML output element.
@@ -103,19 +103,19 @@ public:
   enum { eAction_Click = 0 };
 
   HTMLSummaryAccessible(nsIContent* aContent, DocAccessible* aDoc);
 
   // Accessible
   virtual uint64_t NativeState() override;
 
   // ActionAccessible
-  virtual uint8_t ActionCount() override;
+  virtual uint8_t ActionCount() const override;
   virtual void ActionNameAt(uint8_t aIndex, nsAString& aName) override;
-  virtual bool DoAction(uint8_t aIndex) override;
+  virtual bool DoAction(uint8_t aIndex) const override;
 
   // Widgets
   virtual bool IsWidget() const override;
 };
 
 /**
  * Used for HTML header and footer elements.
  */
--- a/accessible/html/HTMLFormControlAccessible.cpp
+++ b/accessible/html/HTMLFormControlAccessible.cpp
@@ -41,17 +41,17 @@ using namespace mozilla::a11y;
 
 role
 HTMLCheckboxAccessible::NativeRole() const
 {
   return roles::CHECKBUTTON;
 }
 
 uint8_t
-HTMLCheckboxAccessible::ActionCount()
+HTMLCheckboxAccessible::ActionCount() const
 {
   return 1;
 }
 
 void
 HTMLCheckboxAccessible::ActionNameAt(uint8_t aIndex, nsAString& aName)
 {
   if (aIndex == eAction_Click) {    // 0 is the magic value for default action
@@ -61,17 +61,17 @@ HTMLCheckboxAccessible::ActionNameAt(uin
     else if (state & states::MIXED)
       aName.AssignLiteral("cycle");
     else
       aName.AssignLiteral("check");
   }
 }
 
 bool
-HTMLCheckboxAccessible::DoAction(uint8_t aIndex)
+HTMLCheckboxAccessible::DoAction(uint8_t aIndex) const
 {
   if (aIndex != 0)
     return false;
 
   DoCommand();
   return true;
 }
 
@@ -175,30 +175,30 @@ HTMLRadioButtonAccessible::GetPositionAn
 HTMLButtonAccessible::
   HTMLButtonAccessible(nsIContent* aContent, DocAccessible* aDoc) :
   HyperTextAccessibleWrap(aContent, aDoc)
 {
   mGenericTypes |= eButton;
 }
 
 uint8_t
-HTMLButtonAccessible::ActionCount()
+HTMLButtonAccessible::ActionCount() const
 {
   return 1;
 }
 
 void
 HTMLButtonAccessible::ActionNameAt(uint8_t aIndex, nsAString& aName)
 {
   if (aIndex == eAction_Click)
     aName.AssignLiteral("press");
 }
 
 bool
-HTMLButtonAccessible::DoAction(uint8_t aIndex)
+HTMLButtonAccessible::DoAction(uint8_t aIndex) const
 {
   if (aIndex != eAction_Click)
     return false;
 
   DoCommand();
   return true;
 }
 
@@ -433,30 +433,30 @@ HTMLTextFieldAccessible::NativeState()
         state |= states::SUPPORTS_AUTOCOMPLETION;
     }
   }
 
   return state;
 }
 
 uint8_t
-HTMLTextFieldAccessible::ActionCount()
+HTMLTextFieldAccessible::ActionCount() const
 {
   return 1;
 }
 
 void
 HTMLTextFieldAccessible::ActionNameAt(uint8_t aIndex, nsAString& aName)
 {
   if (aIndex == eAction_Click)
     aName.AssignLiteral("activate");
 }
 
 bool
-HTMLTextFieldAccessible::DoAction(uint8_t aIndex)
+HTMLTextFieldAccessible::DoAction(uint8_t aIndex) const
 {
   if (aIndex != 0)
     return false;
 
   TakeFocus();
   return true;
 }
 
--- a/accessible/html/HTMLFormControlAccessible.h
+++ b/accessible/html/HTMLFormControlAccessible.h
@@ -35,19 +35,19 @@ public:
     mStateFlags |= eIgnoreDOMUIEvent;
   }
 
   // Accessible
   virtual mozilla::a11y::role NativeRole() const override;
   virtual uint64_t NativeState() override;
 
   // ActionAccessible
-  virtual uint8_t ActionCount() override;
+  virtual uint8_t ActionCount() const override;
   virtual void ActionNameAt(uint8_t aIndex, nsAString& aName) override;
-  virtual bool DoAction(uint8_t aIndex) override;
+  virtual bool DoAction(uint8_t aIndex) const override;
 
   // Widgets
   virtual bool IsWidget() const override;
 };
 
 
 /**
  * Accessible for HTML input@type="radio" element.
@@ -84,19 +84,19 @@ public:
   HTMLButtonAccessible(nsIContent* aContent, DocAccessible* aDoc);
 
   // Accessible
   virtual mozilla::a11y::role NativeRole() const override;
   virtual uint64_t State() override;
   virtual uint64_t NativeState() override;
 
   // ActionAccessible
-  virtual uint8_t ActionCount() override;
+  virtual uint8_t ActionCount() const override;
   virtual void ActionNameAt(uint8_t aIndex, nsAString& aName) override;
-  virtual bool DoAction(uint8_t aIndex) override;
+  virtual bool DoAction(uint8_t aIndex) const override;
 
   // Widgets
   virtual bool IsWidget() const override;
 
 protected:
   // Accessible
   virtual ENameValueFlag NativeName(nsString& aName) const override;
 };
@@ -123,19 +123,19 @@ public:
   // Accessible
   virtual void Value(nsString& aValue) const override;
   virtual void ApplyARIAState(uint64_t* aState) const 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 uint8_t ActionCount() const override;
   virtual void ActionNameAt(uint8_t aIndex, nsAString& aName) override;
-  virtual bool DoAction(uint8_t aIndex) override;
+  virtual bool DoAction(uint8_t aIndex) const override;
 
   // Widgets
   virtual bool IsWidget() const override;
   virtual Accessible* ContainerWidget() const override;
 
 protected:
   virtual ~HTMLTextFieldAccessible() {}
 
--- a/accessible/html/HTMLLinkAccessible.cpp
+++ b/accessible/html/HTMLLinkAccessible.cpp
@@ -78,17 +78,17 @@ HTMLLinkAccessible::Value(nsString& aVal
   aValue.Truncate();
 
   HyperTextAccessible::Value(aValue);
   if (aValue.IsEmpty())
     nsContentUtils::GetLinkLocation(mContent->AsElement(), aValue);
 }
 
 uint8_t
-HTMLLinkAccessible::ActionCount()
+HTMLLinkAccessible::ActionCount() const
 {
   return IsLinked() ? 1 : HyperTextAccessible::ActionCount();
 }
 
 void
 HTMLLinkAccessible::ActionNameAt(uint8_t aIndex, nsAString& aName)
 {
   aName.Truncate();
@@ -99,17 +99,17 @@ HTMLLinkAccessible::ActionNameAt(uint8_t
   }
 
   // Action 0 (default action): Jump to link
   if (aIndex == eAction_Jump)
     aName.AssignLiteral("jump");
 }
 
 bool
-HTMLLinkAccessible::DoAction(uint8_t aIndex)
+HTMLLinkAccessible::DoAction(uint8_t aIndex) const
 {
   if (!IsLinked())
     return HyperTextAccessible::DoAction(aIndex);
 
   // Action 0 (default action): Jump to link
   if (aIndex != eAction_Jump)
     return false;
 
--- a/accessible/html/HTMLLinkAccessible.h
+++ b/accessible/html/HTMLLinkAccessible.h
@@ -22,19 +22,19 @@ public:
   // Accessible
   virtual void Value(nsString& aValue) const 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 uint8_t ActionCount() const override;
   virtual void ActionNameAt(uint8_t aIndex, nsAString& aName) override;
-  virtual bool DoAction(uint8_t aIndex) override;
+  virtual bool DoAction(uint8_t aIndex) const override;
 
   // HyperLinkAccessible
   virtual bool IsLink() const override;
   virtual already_AddRefed<nsIURI> AnchorURIAt(uint32_t aAnchorIndex) const override;
 
 protected:
   virtual ~HTMLLinkAccessible() {}
 
--- a/accessible/html/HTMLSelectAccessible.cpp
+++ b/accessible/html/HTMLSelectAccessible.cpp
@@ -260,23 +260,23 @@ HTMLSelectOptionAccessible::RelativeBoun
 void
 HTMLSelectOptionAccessible::ActionNameAt(uint8_t aIndex, nsAString& aName)
 {
   if (aIndex == eAction_Select)
     aName.AssignLiteral("select");
 }
 
 uint8_t
-HTMLSelectOptionAccessible::ActionCount()
+HTMLSelectOptionAccessible::ActionCount() const
 {
   return 1;
 }
 
 bool
-HTMLSelectOptionAccessible::DoAction(uint8_t aIndex)
+HTMLSelectOptionAccessible::DoAction(uint8_t aIndex) const
 {
   if (aIndex != eAction_Select)
     return false;
 
   DoCommand();
   return true;
 }
 
@@ -319,29 +319,29 @@ HTMLSelectOptGroupAccessible::NativeInte
 
 bool
 HTMLSelectOptGroupAccessible::IsAcceptableChild(nsIContent* aEl) const
 {
   return aEl->IsCharacterData() || aEl->IsHTMLElement(nsGkAtoms::option);
 }
 
 uint8_t
-HTMLSelectOptGroupAccessible::ActionCount()
+HTMLSelectOptGroupAccessible::ActionCount() const
 {
   return 0;
 }
 
 void
 HTMLSelectOptGroupAccessible::ActionNameAt(uint8_t aIndex, nsAString& aName)
 {
   aName.Truncate();
 }
 
 bool
-HTMLSelectOptGroupAccessible::DoAction(uint8_t aIndex)
+HTMLSelectOptGroupAccessible::DoAction(uint8_t aIndex) const
 {
   return false;
 }
 
 ////////////////////////////////////////////////////////////////////////////////
 // HTMLComboboxAccessible
 ////////////////////////////////////////////////////////////////////////////////
 
@@ -435,23 +435,23 @@ HTMLComboboxAccessible::Value(nsString& 
 {
   // Use accessible name of selected option.
   Accessible* option = SelectedOption();
   if (option)
     option->Name(aValue);
 }
 
 uint8_t
-HTMLComboboxAccessible::ActionCount()
+HTMLComboboxAccessible::ActionCount() const
 {
   return 1;
 }
 
 bool
-HTMLComboboxAccessible::DoAction(uint8_t aIndex)
+HTMLComboboxAccessible::DoAction(uint8_t aIndex) const
 {
   if (aIndex != eAction_Click)
     return false;
 
   DoCommand();
   return true;
 }
 
--- a/accessible/html/HTMLSelectAccessible.h
+++ b/accessible/html/HTMLSelectAccessible.h
@@ -69,19 +69,19 @@ public:
   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
-  virtual uint8_t ActionCount() override;
+  virtual uint8_t ActionCount() const override;
   virtual void ActionNameAt(uint8_t aIndex, nsAString& aName) override;
-  virtual bool DoAction(uint8_t aIndex) override;
+  virtual bool DoAction(uint8_t aIndex) const override;
 
   // Widgets
   virtual Accessible* ContainerWidget() const override;
 
 protected:
   // Accessible
   virtual ENameValueFlag NativeName(nsString& aName) const override;
 
@@ -135,19 +135,19 @@ public:
   virtual ~HTMLSelectOptGroupAccessible() {}
 
   // Accessible
   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 uint8_t ActionCount() const override;
   virtual void ActionNameAt(uint8_t aIndex, nsAString& aName) override;
-  virtual bool DoAction(uint8_t aIndex) override;
+  virtual bool DoAction(uint8_t aIndex) const override;
 };
 
 /** ------------------------------------------------------ */
 /**  Finally, the Combobox widgets                         */
 /** ------------------------------------------------------ */
 
 class HTMLComboboxListAccessible;
 
@@ -167,19 +167,19 @@ public:
   virtual void Description(nsString& aDescription) override;
   virtual void Value(nsString& aValue) const 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 uint8_t ActionCount() const override;
   virtual void ActionNameAt(uint8_t aIndex, nsAString& aName) override;
-  virtual bool DoAction(uint8_t aIndex) override;
+  virtual bool DoAction(uint8_t aIndex) const override;
 
   // Widgets
   virtual bool IsWidget() const override;
   virtual bool IsActiveWidget() const override;
   virtual bool AreItemsOperable() const override;
   virtual Accessible* CurrentItem() const override;
   virtual void SetCurrentItem(const Accessible* aItem) override;
 
--- a/accessible/xul/XULComboboxAccessible.cpp
+++ b/accessible/xul/XULComboboxAccessible.cpp
@@ -102,24 +102,24 @@ XULComboboxAccessible::Value(nsString& a
 
   // The value is the option or text shown entered in the combobox.
   nsCOMPtr<nsIDOMXULMenuListElement> menuList(do_QueryInterface(mContent));
   if (menuList)
     menuList->GetLabel(aValue);
 }
 
 uint8_t
-XULComboboxAccessible::ActionCount()
+XULComboboxAccessible::ActionCount() const
 {
   // Just one action (click).
   return 1;
 }
 
 bool
-XULComboboxAccessible::DoAction(uint8_t aIndex)
+XULComboboxAccessible::DoAction(uint8_t aIndex) const
 {
   if (aIndex != XULComboboxAccessible::eAction_Click)
     return false;
 
   // Programmaticaly toggle the combo box.
   nsCOMPtr<nsIDOMXULMenuListElement> menuList(do_QueryInterface(mContent));
   if (!menuList)
     return false;
--- a/accessible/xul/XULComboboxAccessible.h
+++ b/accessible/xul/XULComboboxAccessible.h
@@ -23,19 +23,19 @@ public:
 
   // Accessible
   virtual void Description(nsString& aDescription) override;
   virtual void Value(nsString& aValue) const override;
   virtual a11y::role NativeRole() const override;
   virtual uint64_t NativeState() override;
 
   // ActionAccessible
-  virtual uint8_t ActionCount() override;
+  virtual uint8_t ActionCount() const override;
   virtual void ActionNameAt(uint8_t aIndex, nsAString& aName) override;
-  virtual bool DoAction(uint8_t aIndex) override;
+  virtual bool DoAction(uint8_t aIndex) const override;
 
   // Widgets
   virtual bool IsActiveWidget() const override;
   virtual bool AreItemsOperable() const override;
 };
 
 } // namespace a11y
 } // namespace mozilla
--- a/accessible/xul/XULElementAccessibles.cpp
+++ b/accessible/xul/XULElementAccessibles.cpp
@@ -207,32 +207,32 @@ XULLinkAccessible::NativeRole() const
 
 uint64_t
 XULLinkAccessible::NativeLinkState() const
 {
   return states::LINKED;
 }
 
 uint8_t
-XULLinkAccessible::ActionCount()
+XULLinkAccessible::ActionCount() const
 {
   return 1;
 }
 
 void
 XULLinkAccessible::ActionNameAt(uint8_t aIndex, nsAString& aName)
 {
   aName.Truncate();
 
   if (aIndex == eAction_Jump)
     aName.AssignLiteral("jump");
 }
 
 bool
-XULLinkAccessible::DoAction(uint8_t aIndex)
+XULLinkAccessible::DoAction(uint8_t aIndex) const
 {
   if (aIndex != eAction_Jump)
     return false;
 
   DoCommand();
   return true;
 }
 
--- a/accessible/xul/XULElementAccessibles.h
+++ b/accessible/xul/XULElementAccessibles.h
@@ -85,19 +85,19 @@ public:
   XULLinkAccessible(nsIContent* aContent, DocAccessible* aDoc);
 
   // Accessible
   virtual void Value(nsString& aValue) const override;
   virtual a11y::role NativeRole() const override;
   virtual uint64_t NativeLinkState() const override;
 
   // ActionAccessible
-  virtual uint8_t ActionCount() override;
+  virtual uint8_t ActionCount() const override;
   virtual void ActionNameAt(uint8_t aIndex, nsAString& aName) override;
-  virtual bool DoAction(uint8_t aIndex) override;
+  virtual bool DoAction(uint8_t aIndex) const override;
 
   // HyperLinkAccessible
   virtual bool IsLink() const override;
   virtual uint32_t StartOffset() override;
   virtual uint32_t EndOffset() override;
   virtual already_AddRefed<nsIURI> AnchorURIAt(uint32_t aAnchorIndex) const override;
 
 protected:
--- a/accessible/xul/XULFormControlAccessible.cpp
+++ b/accessible/xul/XULFormControlAccessible.cpp
@@ -51,30 +51,30 @@ XULButtonAccessible::~XULButtonAccessibl
 
 ////////////////////////////////////////////////////////////////////////////////
 // XULButtonAccessible: nsISupports
 
 ////////////////////////////////////////////////////////////////////////////////
 // XULButtonAccessible: nsIAccessible
 
 uint8_t
-XULButtonAccessible::ActionCount()
+XULButtonAccessible::ActionCount() const
 {
   return 1;
 }
 
 void
 XULButtonAccessible::ActionNameAt(uint8_t aIndex, nsAString& aName)
 {
   if (aIndex == eAction_Click)
     aName.AssignLiteral("press");
 }
 
 bool
-XULButtonAccessible::DoAction(uint8_t aIndex)
+XULButtonAccessible::DoAction(uint8_t aIndex) const
 {
   if (aIndex != 0)
     return false;
 
   DoCommand();
   return true;
 }
 
@@ -200,17 +200,17 @@ XULButtonAccessible::ContainsMenu() cons
 
 XULDropmarkerAccessible::
   XULDropmarkerAccessible(nsIContent* aContent, DocAccessible* aDoc) :
   LeafAccessible(aContent, aDoc)
 {
 }
 
 uint8_t
-XULDropmarkerAccessible::ActionCount()
+XULDropmarkerAccessible::ActionCount() const
 {
   return 1;
 }
 
 bool
 XULDropmarkerAccessible::DropmarkerOpen(bool aToggleOpen) const
 {
   bool isOpen = false;
@@ -249,17 +249,17 @@ XULDropmarkerAccessible::ActionNameAt(ui
     if (DropmarkerOpen(false))
       aName.AssignLiteral("close");
     else
       aName.AssignLiteral("open");
   }
 }
 
 bool
-XULDropmarkerAccessible::DoAction(uint8_t index)
+XULDropmarkerAccessible::DoAction(uint8_t index) const
 {
   if (index == eAction_Click) {
     DropmarkerOpen(true); // Reverse the open attribute
     return true;
   }
   return false;
 }
 
@@ -287,34 +287,34 @@ XULCheckboxAccessible::
 
 role
 XULCheckboxAccessible::NativeRole() const
 {
   return roles::CHECKBUTTON;
 }
 
 uint8_t
-XULCheckboxAccessible::ActionCount()
+XULCheckboxAccessible::ActionCount() const
 {
   return 1;
 }
 
 void
 XULCheckboxAccessible::ActionNameAt(uint8_t aIndex, nsAString& aName)
 {
   if (aIndex == eAction_Click) {
     if (NativeState() & states::CHECKED)
       aName.AssignLiteral("uncheck");
     else
       aName.AssignLiteral("check");
   }
 }
 
 bool
-XULCheckboxAccessible::DoAction(uint8_t aIndex)
+XULCheckboxAccessible::DoAction(uint8_t aIndex) const
 {
   if (aIndex != eAction_Click)
     return false;
 
   DoCommand();
   return true;
 }
 
--- a/accessible/xul/XULFormControlAccessible.h
+++ b/accessible/xul/XULFormControlAccessible.h
@@ -35,19 +35,19 @@ public:
   // nsISupports
   NS_INLINE_DECL_REFCOUNTING_INHERITED(XULButtonAccessible, AccessibleWrap)
 
   // Accessible
   virtual mozilla::a11y::role NativeRole() const override;
   virtual uint64_t NativeState() override;
 
   // ActionAccessible
-  virtual uint8_t ActionCount() override;
+  virtual uint8_t ActionCount() const override;
   virtual void ActionNameAt(uint8_t aIndex, nsAString& aName) override;
-  virtual bool DoAction(uint8_t aIndex) override;
+  virtual bool DoAction(uint8_t aIndex) const override;
 
   // Widgets
   virtual bool IsWidget() const override;
   virtual bool IsActiveWidget() const override;
   virtual bool AreItemsOperable() const override;
   virtual Accessible* ContainerWidget() const override;
 
   virtual bool IsAcceptableChild(nsIContent* aEl) const override;
@@ -69,38 +69,38 @@ public:
   enum { eAction_Click = 0 };
   XULCheckboxAccessible(nsIContent* aContent, DocAccessible* aDoc);
 
   // Accessible
   virtual mozilla::a11y::role NativeRole() const override;
   virtual uint64_t NativeState() override;
 
   // ActionAccessible
-  virtual uint8_t ActionCount() override;
+  virtual uint8_t ActionCount() const override;
   virtual void ActionNameAt(uint8_t aIndex, nsAString& aName) override;
-  virtual bool DoAction(uint8_t aIndex) override;
+  virtual bool DoAction(uint8_t aIndex) const override;
 };
 
 /**
  * Used for XUL dropmarker element.
  */
 class XULDropmarkerAccessible : public LeafAccessible
 {
 public:
   enum { eAction_Click = 0 };
   XULDropmarkerAccessible(nsIContent* aContent, DocAccessible* aDoc);
 
   // Accessible
   virtual mozilla::a11y::role NativeRole() const override;
   virtual uint64_t NativeState() override;
 
   // ActionAccessible
-  virtual uint8_t ActionCount() override;
+  virtual uint8_t ActionCount() const override;
   virtual void ActionNameAt(uint8_t aIndex, nsAString& aName) override;
-  virtual bool DoAction(uint8_t aIndex) override;
+  virtual bool DoAction(uint8_t aIndex) const override;
 
 private:
   bool DropmarkerOpen(bool aToggleOpen) const;
 };
 
 /**
  * Used for XUL groupbox element.
  */
--- a/accessible/xul/XULListboxAccessible.cpp
+++ b/accessible/xul/XULListboxAccessible.cpp
@@ -65,30 +65,30 @@ XULColumnItemAccessible::NativeRole() co
 
 uint64_t
 XULColumnItemAccessible::NativeState()
 {
   return states::READONLY;
 }
 
 uint8_t
-XULColumnItemAccessible::ActionCount()
+XULColumnItemAccessible::ActionCount() const
 {
   return 1;
 }
 
 void
 XULColumnItemAccessible::ActionNameAt(uint8_t aIndex, nsAString& aName)
 {
   if (aIndex == eAction_Click)
     aName.AssignLiteral("click");
 }
 
 bool
-XULColumnItemAccessible::DoAction(uint8_t aIndex)
+XULColumnItemAccessible::DoAction(uint8_t aIndex) const
 {
   if (aIndex != eAction_Click)
     return false;
 
   DoCommand();
   return true;
 }
 
--- a/accessible/xul/XULListboxAccessible.h
+++ b/accessible/xul/XULListboxAccessible.h
@@ -40,19 +40,19 @@ class XULColumnItemAccessible : public L
 public:
   XULColumnItemAccessible(nsIContent* aContent, DocAccessible* aDoc);
 
   // Accessible
   virtual a11y::role NativeRole() const override;
   virtual uint64_t NativeState() override;
 
   // ActionAccessible
-  virtual uint8_t ActionCount() override;
+  virtual uint8_t ActionCount() const override;
   virtual void ActionNameAt(uint8_t aIndex, nsAString& aName) override;
-  virtual bool DoAction(uint8_t aIndex) override;
+  virtual bool DoAction(uint8_t aIndex) const override;
 
   enum { eAction_Click = 0 };
 };
 
 /*
  * A class the represents the XUL Listbox widget.
  */
 class XULListboxAccessible : public XULSelectControlAccessible,
--- a/accessible/xul/XULMenuAccessible.cpp
+++ b/accessible/xul/XULMenuAccessible.cpp
@@ -264,17 +264,17 @@ XULMenuitemAccessible::NativeRole() cons
 
 int32_t
 XULMenuitemAccessible::GetLevelInternal()
 {
   return nsAccUtils::GetLevelForXULContainerItem(mContent);
 }
 
 bool
-XULMenuitemAccessible::DoAction(uint8_t index)
+XULMenuitemAccessible::DoAction(uint8_t index) const
 {
   if (index == eAction_Click) {   // default action
     DoCommand();
     return true;
   }
 
   return false;
 }
@@ -282,17 +282,17 @@ XULMenuitemAccessible::DoAction(uint8_t 
 void
 XULMenuitemAccessible::ActionNameAt(uint8_t aIndex, nsAString& aName)
 {
   if (aIndex == eAction_Click)
     aName.AssignLiteral("click");
 }
 
 uint8_t
-XULMenuitemAccessible::ActionCount()
+XULMenuitemAccessible::ActionCount() const
 {
   return 1;
 }
 
 ////////////////////////////////////////////////////////////////////////////////
 // XULMenuitemAccessible: Widgets
 
 bool
@@ -369,29 +369,29 @@ XULMenuSeparatorAccessible::NativeName(n
 
 role
 XULMenuSeparatorAccessible::NativeRole() const
 {
   return roles::SEPARATOR;
 }
 
 bool
-XULMenuSeparatorAccessible::DoAction(uint8_t index)
+XULMenuSeparatorAccessible::DoAction(uint8_t index) const
 {
   return false;
 }
 
 void
 XULMenuSeparatorAccessible::ActionNameAt(uint8_t aIndex, nsAString& aName)
 {
   aName.Truncate();
 }
 
 uint8_t
-XULMenuSeparatorAccessible::ActionCount()
+XULMenuSeparatorAccessible::ActionCount() const
 {
   return 0;
 }
 
 ////////////////////////////////////////////////////////////////////////////////
 // XULMenupopupAccessible
 ////////////////////////////////////////////////////////////////////////////////
 
--- a/accessible/xul/XULMenuAccessible.h
+++ b/accessible/xul/XULMenuAccessible.h
@@ -26,19 +26,19 @@ public:
   // Accessible
   virtual void Description(nsString& aDescription) 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 uint8_t ActionCount() const override;
   virtual void ActionNameAt(uint8_t aIndex, nsAString& aName) override;
-  virtual bool DoAction(uint8_t aIndex) override;
+  virtual bool DoAction(uint8_t aIndex) const override;
   virtual KeyBinding AccessKey() const override;
   virtual KeyBinding KeyboardShortcut() const override;
 
   // Widgets
   virtual bool IsActiveWidget() const override;
   virtual bool AreItemsOperable() const override;
   virtual Accessible* ContainerWidget() const override;
 
@@ -55,19 +55,19 @@ class XULMenuSeparatorAccessible : publi
 public:
   XULMenuSeparatorAccessible(nsIContent* aContent, DocAccessible* aDoc);
 
   // Accessible
   virtual a11y::role NativeRole() const override;
   virtual uint64_t NativeState() override;
 
   // ActionAccessible
-  virtual uint8_t ActionCount() override;
+  virtual uint8_t ActionCount() const override;
   virtual void ActionNameAt(uint8_t aIndex, nsAString& aName) override;
-  virtual bool DoAction(uint8_t aIndex) override;
+  virtual bool DoAction(uint8_t aIndex) const override;
 
 protected:
   // Accessible
   virtual ENameValueFlag NativeName(nsString& aName) const override;
 };
 
 
 /**
--- a/accessible/xul/XULSliderAccessible.cpp
+++ b/accessible/xul/XULSliderAccessible.cpp
@@ -60,31 +60,31 @@ XULSliderAccessible::NativelyUnavailable
 
 void
 XULSliderAccessible::Value(nsString& aValue) const
 {
   GetSliderAttr(nsGkAtoms::curpos, aValue);
 }
 
 uint8_t
-XULSliderAccessible::ActionCount()
+XULSliderAccessible::ActionCount() const
 {
   return 1;
 }
 
 void
 XULSliderAccessible::ActionNameAt(uint8_t aIndex, nsAString& aName)
 {
   aName.Truncate();
   if (aIndex == 0)
     aName.AssignLiteral("activate");
 }
 
 bool
-XULSliderAccessible::DoAction(uint8_t aIndex)
+XULSliderAccessible::DoAction(uint8_t aIndex) const
 {
   if (aIndex != 0)
     return false;
 
   dom::Element* sliderElm = GetSliderElement();
   if (sliderElm)
     DoCommand(sliderElm);
 
--- a/accessible/xul/XULSliderAccessible.h
+++ b/accessible/xul/XULSliderAccessible.h
@@ -28,19 +28,19 @@ public:
   // 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;
 
   // ActionAccessible
-  virtual uint8_t ActionCount() override;
+  virtual uint8_t ActionCount() const override;
   virtual void ActionNameAt(uint8_t aIndex, nsAString& aName) override;
-  virtual bool DoAction(uint8_t aIndex) override;
+  virtual bool DoAction(uint8_t aIndex) const override;
 
 protected:
   /**
    * Return anonymous slider element.
    */
   dom::Element* GetSliderElement() const;
 
   nsresult GetSliderAttr(nsAtom *aName, nsAString& aValue) const;
--- a/accessible/xul/XULTabAccessible.cpp
+++ b/accessible/xul/XULTabAccessible.cpp
@@ -30,30 +30,30 @@ XULTabAccessible::
   HyperTextAccessibleWrap(aContent, aDoc)
 {
 }
 
 ////////////////////////////////////////////////////////////////////////////////
 // XULTabAccessible: Accessible
 
 uint8_t
-XULTabAccessible::ActionCount()
+XULTabAccessible::ActionCount() const
 {
   return 1;
 }
 
 void
 XULTabAccessible::ActionNameAt(uint8_t aIndex, nsAString& aName)
 {
   if (aIndex == eAction_Switch)
     aName.AssignLiteral("switch");
 }
 
 bool
-XULTabAccessible::DoAction(uint8_t index)
+XULTabAccessible::DoAction(uint8_t index) const
 {
   if (index == eAction_Switch) {
     // XXXbz Could this just FromContent?
     RefPtr<nsXULElement> tab = nsXULElement::FromNodeOrNull(mContent);
     if (tab) {
       tab->Click(mozilla::dom::CallerType::System);
       return true;
     }
@@ -138,17 +138,17 @@ XULTabsAccessible::
 
 role
 XULTabsAccessible::NativeRole() const
 {
   return roles::PAGETABLIST;
 }
 
 uint8_t
-XULTabsAccessible::ActionCount()
+XULTabsAccessible::ActionCount() const
 {
   return 0;
 }
 
 void
 XULTabsAccessible::Value(nsString& aValue) const
 {
   aValue.Truncate();
--- a/accessible/xul/XULTabAccessible.h
+++ b/accessible/xul/XULTabAccessible.h
@@ -26,36 +26,36 @@ public:
 
   // Accessible
   virtual a11y::role NativeRole() const override;
   virtual uint64_t NativeState() override;
   virtual uint64_t NativeInteractiveState() const override;
   virtual Relation RelationByType(RelationType aType) const override;
 
   // ActionAccessible
-  virtual uint8_t ActionCount() override;
+  virtual uint8_t ActionCount() const override;
   virtual void ActionNameAt(uint8_t aIndex, nsAString& aName) override;
-  virtual bool DoAction(uint8_t aIndex) override;
+  virtual bool DoAction(uint8_t aIndex) const override;
 };
 
 
 /**
  * A container of tab objects, xul:tabs element.
  */
 class XULTabsAccessible : public XULSelectControlAccessible
 {
 public:
   XULTabsAccessible(nsIContent* aContent, DocAccessible* aDoc);
 
   // Accessible
   virtual void Value(nsString& aValue) const override;
   virtual a11y::role NativeRole() const override;
 
   // ActionAccessible
-  virtual uint8_t ActionCount() override;
+  virtual uint8_t ActionCount() const override;
 
 protected:
   // Accessible
   virtual ENameValueFlag NativeName(nsString& aName) const override;
 };
 
 
 /**
--- a/accessible/xul/XULTreeAccessible.cpp
+++ b/accessible/xul/XULTreeAccessible.cpp
@@ -819,17 +819,17 @@ XULTreeItemAccessibleBase::RelationByTyp
     }
 
     default:
       return Relation();
   }
 }
 
 uint8_t
-XULTreeItemAccessibleBase::ActionCount()
+XULTreeItemAccessibleBase::ActionCount() const
 {
   // "activate" action is available for all treeitems, "expand/collapse" action
   // is avaible for treeitem which is container.
   return IsExpandable() ? 2 : 1;
 }
 
 void
 XULTreeItemAccessibleBase::ActionNameAt(uint8_t aIndex, nsAString& aName)
@@ -845,17 +845,17 @@ XULTreeItemAccessibleBase::ActionNameAt(
     if (isContainerOpen)
       aName.AssignLiteral("collapse");
     else
       aName.AssignLiteral("expand");
   }
 }
 
 bool
-XULTreeItemAccessibleBase::DoAction(uint8_t aIndex)
+XULTreeItemAccessibleBase::DoAction(uint8_t aIndex) const
 {
   if (aIndex != eAction_Click &&
       (aIndex != eAction_Expand || !IsExpandable()))
     return false;
 
   DoCommand(nullptr, aIndex);
   return true;
 }
--- a/accessible/xul/XULTreeAccessible.h
+++ b/accessible/xul/XULTreeAccessible.h
@@ -153,19 +153,19 @@ public:
   virtual uint64_t NativeInteractiveState() const override;
   virtual int32_t IndexInParent() const override;
   virtual Relation RelationByType(RelationType aType) const override;
   virtual Accessible* FocusedChild() override;
   virtual void SetSelected(bool aSelect) override;
   virtual void TakeFocus() const override;
 
   // ActionAccessible
-  virtual uint8_t ActionCount() override;
+  virtual uint8_t ActionCount() const override;
   virtual void ActionNameAt(uint8_t aIndex, nsAString& aName) override;
-  virtual bool DoAction(uint8_t aIndex) override;
+  virtual bool DoAction(uint8_t aIndex) const override;
 
   // Widgets
   virtual Accessible* ContainerWidget() const override;
 
   // XULTreeItemAccessibleBase
   NS_DECLARE_STATIC_IID_ACCESSOR(XULTREEITEMBASEACCESSIBLE_IMPL_CID)
 
   /**
--- a/accessible/xul/XULTreeGridAccessible.cpp
+++ b/accessible/xul/XULTreeGridAccessible.cpp
@@ -530,17 +530,17 @@ XULTreeGridCellAccessible::BoundsInAppUn
   nsPresContext* presContext = mDoc->PresContext();
   return nsRect(presContext->CSSPixelsToAppUnits(bounds.X()),
                 presContext->CSSPixelsToAppUnits(bounds.Y()),
                 presContext->CSSPixelsToAppUnits(bounds.Width()),
                 presContext->CSSPixelsToAppUnits(bounds.Height()));
 }
 
 uint8_t
-XULTreeGridCellAccessible::ActionCount()
+XULTreeGridCellAccessible::ActionCount() const
 {
   bool isCycler = false;
   mColumn->GetCycler(&isCycler);
   if (isCycler)
     return 1;
 
   int16_t type;
   mColumn->GetType(&type);
@@ -573,17 +573,17 @@ XULTreeGridCellAccessible::ActionNameAt(
     if (value.EqualsLiteral("true"))
       aName.AssignLiteral("uncheck");
     else
       aName.AssignLiteral("check");
   }
 }
 
 bool
-XULTreeGridCellAccessible::DoAction(uint8_t aIndex)
+XULTreeGridCellAccessible::DoAction(uint8_t aIndex) const
 {
   if (aIndex != eAction_Click)
     return false;
 
   bool isCycler = false;
   mColumn->GetCycler(&isCycler);
   if (isCycler) {
     DoCommand();
--- a/accessible/xul/XULTreeGridAccessible.h
+++ b/accessible/xul/XULTreeGridAccessible.h
@@ -133,19 +133,19 @@ public:
   virtual already_AddRefed<nsIPersistentProperties> NativeAttributes() override;
   virtual int32_t IndexInParent() const override;
   virtual Relation RelationByType(RelationType aType) const 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 uint8_t ActionCount() const override;
   virtual void ActionNameAt(uint8_t aIndex, nsAString& aName) override;
-  virtual bool DoAction(uint8_t aIndex) override;
+  virtual bool DoAction(uint8_t aIndex) 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 void RowHeaderCells(nsTArray<Accessible*>* aCells) override { }
   virtual bool Selected() override;