Bug 1438193 - part11-9: NativeState r=surkov
authorTokio Kajitsuka <kajitsuka-tokio@g.ecc.u-tokyo.ac.jp>
Wed, 16 May 2018 03:04:50 +0900
changeset 418613 1c7fc1a1c68314f568ed25f35f885e901d17083a
parent 418612 835d704af69f0dd13db43d8b5de85bd70c58c468
child 418614 651a5ed46d2de351c933ebcc47fc44dd6eccb3af
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-9: NativeState r=surkov turn NativeState into const functions
accessible/generic/Accessible.cpp
accessible/generic/Accessible.h
accessible/generic/ApplicationAccessible.cpp
accessible/generic/ApplicationAccessible.h
accessible/generic/BaseAccessibles.cpp
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/RootAccessible.cpp
accessible/generic/RootAccessible.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/HTMLListAccessible.cpp
accessible/html/HTMLListAccessible.h
accessible/html/HTMLSelectAccessible.cpp
accessible/html/HTMLSelectAccessible.h
accessible/html/HTMLTableAccessible.cpp
accessible/html/HTMLTableAccessible.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/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
@@ -402,17 +402,17 @@ Accessible::VisibilityState() const
       return states::INVISIBLE;
     }
   }
 
   return 0;
 }
 
 uint64_t
-Accessible::NativeState()
+Accessible::NativeState() const
 {
   uint64_t state = 0;
 
   if (!IsInDocument())
     state |= states::STALE;
 
   if (HasOwnContent() && mContent->IsElement()) {
     EventStates elementState = mContent->AsElement()->State();
--- a/accessible/generic/Accessible.h
+++ b/accessible/generic/Accessible.h
@@ -288,17 +288,17 @@ public:
     ApplyARIAState(&state);
     return state & states::UNAVAILABLE;
   }
 
   /**
    * Return the states of accessible, not taking into account ARIA states.
    * Use State() to get complete set of states.
    */
-  virtual uint64_t NativeState();
+  virtual uint64_t NativeState() const;
 
   /**
    * Return native interactice state (unavailable, focusable or selectable).
    */
   virtual uint64_t NativeInteractiveState() const;
 
   /**
    * Return native link states present on the accessible.
--- a/accessible/generic/ApplicationAccessible.cpp
+++ b/accessible/generic/ApplicationAccessible.cpp
@@ -143,17 +143,17 @@ ApplicationAccessible::ApplyARIAState(ui
 
 role
 ApplicationAccessible::NativeRole() const
 {
   return roles::APP_ROOT;
 }
 
 uint64_t
-ApplicationAccessible::NativeState()
+ApplicationAccessible::NativeState() const
 {
   return 0;
 }
 
 KeyBinding
 ApplicationAccessible::AccessKey() const
 {
   return KeyBinding();
--- a/accessible/generic/ApplicationAccessible.h
+++ b/accessible/generic/ApplicationAccessible.h
@@ -41,17 +41,17 @@ public:
   virtual already_AddRefed<nsIPersistentProperties> NativeAttributes() override;
   virtual GroupPos GroupPosition() override;
   virtual ENameValueFlag Name(nsString& aName) const override;
   virtual void ApplyARIAState(uint64_t* aState) const override;
   virtual void Description(nsString& aDescription) override;
   virtual void Value(nsString& aValue) const override;
   virtual mozilla::a11y::role NativeRole() const override;
   virtual uint64_t State() override;
-  virtual uint64_t NativeState() override;
+  virtual uint64_t NativeState() const override;
   virtual Relation RelationByType(RelationType aType) const override;
 
   virtual Accessible* ChildAtPoint(int32_t aX, int32_t aY,
                                    EWhichChildAtPoint aWhichChild) override;
   virtual Accessible* FocusedChild() override;
 
   // ActionAccessible
   virtual KeyBinding AccessKey() const override;
--- a/accessible/generic/BaseAccessibles.cpp
+++ b/accessible/generic/BaseAccessibles.cpp
@@ -226,17 +226,17 @@ LinkableAccessible::AnchorURIAt(uint32_t
 }
 
 
 ////////////////////////////////////////////////////////////////////////////////
 // DummyAccessible
 ////////////////////////////////////////////////////////////////////////////////
 
 uint64_t
-DummyAccessible::NativeState()
+DummyAccessible::NativeState() const
 {
   return 0;
 }
 uint64_t
 DummyAccessible::NativeInteractiveState() const
 {
   return 0;
 }
--- a/accessible/generic/BaseAccessibles.h
+++ b/accessible/generic/BaseAccessibles.h
@@ -111,17 +111,17 @@ protected:
  * crossplatform accessible tree.
  */
 class DummyAccessible : public AccessibleWrap
 {
 public:
   explicit DummyAccessible(DocAccessible* aDocument = nullptr) :
     AccessibleWrap(nullptr, aDocument) { }
 
-  uint64_t NativeState() final;
+  uint64_t NativeState() const final;
   uint64_t NativeInteractiveState() const final;
   uint64_t NativeLinkState() const final;
   bool NativelyUnavailable() const final;
   void ApplyARIAState(uint64_t* aState) const final;
 
 protected:
   virtual ~DummyAccessible() { }
 };
--- a/accessible/generic/DocAccessible.cpp
+++ b/accessible/generic/DocAccessible.cpp
@@ -231,17 +231,17 @@ DocAccessible::Description(nsString& aDe
     nsTextEquivUtils::
       GetTextEquivFromIDRefs(this, nsGkAtoms::aria_describedby,
                              aDescription);
   }
 }
 
 // Accessible public method
 uint64_t
-DocAccessible::NativeState()
+DocAccessible::NativeState() const
 {
   // Document is always focusable.
   uint64_t state = states::FOCUSABLE; // keep in sync with NativeInteractiveState() impl
   if (FocusMgr()->IsFocused(this))
     state |= states::FOCUSED;
 
   // Expose stale state until the document is ready (DOM is loaded and tree is
   // constructed).
--- a/accessible/generic/DocAccessible.h
+++ b/accessible/generic/DocAccessible.h
@@ -68,17 +68,17 @@ public:
   virtual nsIFrame* GetFrame() const override;
   virtual nsINode* GetNode() const override { return mDocumentNode; }
   nsIDocument* DocumentNode() const { return mDocumentNode; }
 
   virtual mozilla::a11y::ENameValueFlag Name(nsString& aName) const override;
   virtual void Description(nsString& aDescription) override;
   virtual Accessible* FocusedChild() override;
   virtual mozilla::a11y::role NativeRole() const override;
-  virtual uint64_t NativeState() override;
+  virtual uint64_t NativeState() const 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() const override;
 
 #ifdef A11Y_LOG
--- a/accessible/generic/FormControlAccessible.cpp
+++ b/accessible/generic/FormControlAccessible.cpp
@@ -27,17 +27,17 @@ template<int Max>
 role
 ProgressMeterAccessible<Max>::NativeRole() const
 {
   return roles::PROGRESSBAR;
 }
 
 template<int Max>
 uint64_t
-ProgressMeterAccessible<Max>::NativeState()
+ProgressMeterAccessible<Max>::NativeState() const
 {
   uint64_t state = LeafAccessible::NativeState();
 
   // An undetermined progressbar (i.e. without a value) has a mixed state.
   nsAutoString attrValue;
   mContent->AsElement()->GetAttr(kNameSpaceID_None, nsGkAtoms::value, attrValue);
 
   if (attrValue.IsEmpty())
--- a/accessible/generic/FormControlAccessible.h
+++ b/accessible/generic/FormControlAccessible.h
@@ -25,17 +25,17 @@ public:
     // notifications.
     mStateFlags |= eHasNumericValue | eIgnoreDOMUIEvent;
     mType = eProgressType;
   }
 
   // Accessible
   virtual void Value(nsString& aValue) const override;
   virtual mozilla::a11y::role NativeRole() const override;
-  virtual uint64_t NativeState() override;
+  virtual uint64_t NativeState() 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;
 
--- a/accessible/generic/HyperTextAccessible.cpp
+++ b/accessible/generic/HyperTextAccessible.cpp
@@ -66,17 +66,17 @@ HyperTextAccessible::NativeRole() const
   nsIFrame* frame = GetFrame();
   if (frame && frame->IsInlineFrame())
     return roles::TEXT;
 
   return roles::TEXT_CONTAINER;
 }
 
 uint64_t
-HyperTextAccessible::NativeState()
+HyperTextAccessible::NativeState() const
 {
   uint64_t states = AccessibleWrap::NativeState();
 
   if (mContent->AsElement()->State().HasState(NS_EVENT_STATE_MOZ_READWRITE)) {
     states |= states::EDITABLE;
 
   } else if (mContent->IsHTMLElement(nsGkAtoms::article)) {
     // We want <article> to behave like a document in terms of readonly state.
--- a/accessible/generic/HyperTextAccessible.h
+++ b/accessible/generic/HyperTextAccessible.h
@@ -53,17 +53,17 @@ public:
 
   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() const override;
-  virtual uint64_t NativeState() override;
+  virtual uint64_t NativeState() const 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) const override;
 
   // HyperTextAccessible (static helper method)
 
--- a/accessible/generic/ImageAccessible.cpp
+++ b/accessible/generic/ImageAccessible.cpp
@@ -37,17 +37,17 @@ ImageAccessible::
 ImageAccessible::~ImageAccessible()
 {
 }
 
 ////////////////////////////////////////////////////////////////////////////////
 // Accessible public
 
 uint64_t
-ImageAccessible::NativeState()
+ImageAccessible::NativeState() const
 {
   // The state is a bitfield, get our inherited state, then logically OR it with
   // states::ANIMATED if this is an animated image.
 
   uint64_t state = LinkableAccessible::NativeState();
 
   nsCOMPtr<nsIImageLoadingContent> content(do_QueryInterface(mContent));
   nsCOMPtr<imgIRequest> imageRequest;
--- a/accessible/generic/ImageAccessible.h
+++ b/accessible/generic/ImageAccessible.h
@@ -18,17 +18,17 @@ namespace a11y {
  */
 class ImageAccessible : public LinkableAccessible
 {
 public:
   ImageAccessible(nsIContent* aContent, DocAccessible* aDoc);
 
   // Accessible
   virtual a11y::role NativeRole() const override;
-  virtual uint64_t NativeState() override;
+  virtual uint64_t NativeState() const override;
   virtual already_AddRefed<nsIPersistentProperties> NativeAttributes() override;
 
   // ActionAccessible
   virtual uint8_t ActionCount() const override;
   virtual void ActionNameAt(uint8_t aIndex, nsAString& aName) override;
   virtual bool DoAction(uint8_t aIndex) const override;
 
   // ImageAccessible
--- a/accessible/generic/RootAccessible.cpp
+++ b/accessible/generic/RootAccessible.cpp
@@ -118,17 +118,17 @@ RootAccessible::GetChromeFlags() const
   }
   uint32_t chromeFlags;
   xulWin->GetChromeFlags(&chromeFlags);
   return chromeFlags;
 }
 #endif
 
 uint64_t
-RootAccessible::NativeState()
+RootAccessible::NativeState() const
 {
   uint64_t state = DocAccessibleWrap::NativeState();
   if (state & states::DEFUNCT)
     return state;
 
 #ifdef MOZ_XUL
   uint32_t chromeFlags = GetChromeFlags();
   if (chromeFlags & nsIWebBrowserChrome::CHROME_WINDOW_RESIZE)
--- a/accessible/generic/RootAccessible.h
+++ b/accessible/generic/RootAccessible.h
@@ -27,17 +27,17 @@ public:
   // nsIDOMEventListener
   NS_DECL_NSIDOMEVENTLISTENER
 
   // Accessible
   virtual void Shutdown() override;
   virtual mozilla::a11y::ENameValueFlag Name(nsString& aName) const override;
   virtual Relation RelationByType(RelationType aType) const override;
   virtual mozilla::a11y::role NativeRole() const override;
-  virtual uint64_t NativeState() override;
+  virtual uint64_t NativeState() const override;
 
   // RootAccessible
 
   /**
    * Notify that the sub document presshell was activated.
    */
   virtual void DocumentActivated(DocAccessible* aDocument);
 
--- a/accessible/html/HTMLElementAccessibles.cpp
+++ b/accessible/html/HTMLElementAccessibles.cpp
@@ -35,17 +35,17 @@ HTMLHRAccessible::NativeRole() const
 
 role
 HTMLBRAccessible::NativeRole() const
 {
   return roles::WHITESPACE;
 }
 
 uint64_t
-HTMLBRAccessible::NativeState()
+HTMLBRAccessible::NativeState() const
 {
   return states::READONLY;
 }
 
 ENameValueFlag
 HTMLBRAccessible::NativeName(nsString& aName) const
 {
   aName = static_cast<char16_t>('\n');    // Newline char
@@ -162,17 +162,17 @@ HTMLSummaryAccessible::DoAction(uint8_t 
   if (aIndex != eAction_Click)
     return false;
 
   DoCommand();
   return true;
 }
 
 uint64_t
-HTMLSummaryAccessible::NativeState()
+HTMLSummaryAccessible::NativeState() const
 {
   uint64_t state = HyperTextAccessibleWrap::NativeState();
 
   dom::HTMLSummaryElement* summary = dom::HTMLSummaryElement::FromNode(mContent);
   if (!summary) {
     return state;
   }
 
--- a/accessible/html/HTMLElementAccessibles.h
+++ b/accessible/html/HTMLElementAccessibles.h
@@ -35,17 +35,17 @@ public:
     LeafAccessible(aContent, aDoc)
   {
     mType = eHTMLBRType;
     mGenericTypes |= eText;
   }
 
   // Accessible
   virtual a11y::role NativeRole() const override;
-  virtual uint64_t NativeState() override;
+  virtual uint64_t NativeState() const override;
 
 protected:
   // Accessible
   virtual ENameValueFlag NativeName(nsString& aName) const override;
 };
 
 /**
  * Used for HTML label element.
@@ -100,17 +100,17 @@ class HTMLSummaryAccessible : public Hyp
 {
 
 public:
   enum { eAction_Click = 0 };
 
   HTMLSummaryAccessible(nsIContent* aContent, DocAccessible* aDoc);
 
   // Accessible
-  virtual uint64_t NativeState() override;
+  virtual uint64_t NativeState() const override;
 
   // ActionAccessible
   virtual uint8_t ActionCount() const override;
   virtual void ActionNameAt(uint8_t aIndex, nsAString& aName) override;
   virtual bool DoAction(uint8_t aIndex) const override;
 
   // Widgets
   virtual bool IsWidget() const override;
--- a/accessible/html/HTMLFormControlAccessible.cpp
+++ b/accessible/html/HTMLFormControlAccessible.cpp
@@ -71,17 +71,17 @@ HTMLCheckboxAccessible::DoAction(uint8_t
   if (aIndex != 0)
     return false;
 
   DoCommand();
   return true;
 }
 
 uint64_t
-HTMLCheckboxAccessible::NativeState()
+HTMLCheckboxAccessible::NativeState() const
 {
   uint64_t state = LeafAccessible::NativeState();
 
   state |= states::CHECKABLE;
   HTMLInputElement* input = HTMLInputElement::FromNode(mContent);
   if (!input)
     return state;
 
@@ -104,17 +104,17 @@ HTMLCheckboxAccessible::IsWidget() const
 }
 
 
 ////////////////////////////////////////////////////////////////////////////////
 // HTMLRadioButtonAccessible
 ////////////////////////////////////////////////////////////////////////////////
 
 uint64_t
-HTMLRadioButtonAccessible::NativeState()
+HTMLRadioButtonAccessible::NativeState() const
 {
   uint64_t state = AccessibleWrap::NativeState();
 
   state |= states::CHECKABLE;
 
   HTMLInputElement* input = HTMLInputElement::FromNode(mContent);
   if (input && input->Checked())
     state |= states::CHECKED;
@@ -217,17 +217,17 @@ HTMLButtonAccessible::State()
     state |= parentState & (states::BUSY | states::REQUIRED |
                             states::HASPOPUP | states::INVALID);
   }
 
   return state;
 }
 
 uint64_t
-HTMLButtonAccessible::NativeState()
+HTMLButtonAccessible::NativeState() const
 {
   uint64_t state = HyperTextAccessibleWrap::NativeState();
 
   EventStates elmState = mContent->AsElement()->State();
   if (elmState.HasState(NS_EVENT_STATE_DEFAULT))
     state |= states::DEFAULT;
 
   return state;
@@ -368,17 +368,17 @@ HTMLTextFieldAccessible::ApplyARIAState(
   // If part of compound of XUL widget then pick up ARIA stuff from XUL widget
   // element.
   nsIContent* widgetElm = XULWidgetElm();
   if (widgetElm)
     aria::MapToState(aria::eARIAAutoComplete, widgetElm->AsElement(), aState);
 }
 
 uint64_t
-HTMLTextFieldAccessible::NativeState()
+HTMLTextFieldAccessible::NativeState() const
 {
   uint64_t state = HyperTextAccessibleWrap::NativeState();
 
   // Text fields are always editable, even if they are also read only or
   // disabled.
   state |= states::EDITABLE;
 
   // can be focusable, focused, protected. readonly, unavailable, selected
--- a/accessible/html/HTMLFormControlAccessible.h
+++ b/accessible/html/HTMLFormControlAccessible.h
@@ -32,17 +32,17 @@ public:
   {
     // Ignore "CheckboxStateChange" DOM event in lieu of document observer
     // state change notification.
     mStateFlags |= eIgnoreDOMUIEvent;
   }
 
   // Accessible
   virtual mozilla::a11y::role NativeRole() const override;
-  virtual uint64_t NativeState() override;
+  virtual uint64_t NativeState() const override;
 
   // ActionAccessible
   virtual uint8_t ActionCount() const override;
   virtual void ActionNameAt(uint8_t aIndex, nsAString& aName) override;
   virtual bool DoAction(uint8_t aIndex) const override;
 
   // Widgets
   virtual bool IsWidget() const override;
@@ -60,17 +60,17 @@ public:
     RadioButtonAccessible(aContent, aDoc)
   {
     // Ignore "RadioStateChange" DOM event in lieu of document observer
     // state change notification.
     mStateFlags |= eIgnoreDOMUIEvent;
   }
 
   // Accessible
-  virtual uint64_t NativeState() override;
+  virtual uint64_t NativeState() const override;
   virtual void GetPositionAndSizeInternal(int32_t *aPosInSet,
                                           int32_t *aSetSize) override;
 };
 
 
 /**
  * Accessible for HTML input@type="button", @type="submit", @type="image"
  * and HTML button elements.
@@ -81,17 +81,17 @@ class HTMLButtonAccessible : public Hype
 public:
   enum { eAction_Click = 0 };
 
   HTMLButtonAccessible(nsIContent* aContent, DocAccessible* aDoc);
 
   // Accessible
   virtual mozilla::a11y::role NativeRole() const override;
   virtual uint64_t State() override;
-  virtual uint64_t NativeState() override;
+  virtual uint64_t NativeState() const override;
 
   // ActionAccessible
   virtual uint8_t ActionCount() const override;
   virtual void ActionNameAt(uint8_t aIndex, nsAString& aName) override;
   virtual bool DoAction(uint8_t aIndex) const override;
 
   // Widgets
   virtual bool IsWidget() const override;
@@ -119,17 +119,17 @@ public:
 
   // HyperTextAccessible
   virtual already_AddRefed<TextEditor> GetEditor() const override;
 
   // 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 uint64_t NativeState() const override;
   virtual already_AddRefed<nsIPersistentProperties> NativeAttributes() override;
 
   // ActionAccessible
   virtual uint8_t ActionCount() const override;
   virtual void ActionNameAt(uint8_t aIndex, nsAString& aName) override;
   virtual bool DoAction(uint8_t aIndex) const override;
 
   // Widgets
--- a/accessible/html/HTMLLinkAccessible.cpp
+++ b/accessible/html/HTMLLinkAccessible.cpp
@@ -32,17 +32,17 @@ HTMLLinkAccessible::
 
 role
 HTMLLinkAccessible::NativeRole() const
 {
   return roles::LINK;
 }
 
 uint64_t
-HTMLLinkAccessible::NativeState()
+HTMLLinkAccessible::NativeState() const
 {
   return HyperTextAccessibleWrap::NativeState() & ~states::READONLY;
 }
 
 uint64_t
 HTMLLinkAccessible::NativeLinkState() const
 {
   EventStates eventState = mContent->AsElement()->State();
--- a/accessible/html/HTMLLinkAccessible.h
+++ b/accessible/html/HTMLLinkAccessible.h
@@ -17,17 +17,17 @@ public:
   HTMLLinkAccessible(nsIContent* aContent, DocAccessible* aDoc);
 
   NS_INLINE_DECL_REFCOUNTING_INHERITED(HTMLLinkAccessible,
                                        HyperTextAccessibleWrap)
 
   // Accessible
   virtual void Value(nsString& aValue) const override;
   virtual a11y::role NativeRole() const override;
-  virtual uint64_t NativeState() override;
+  virtual uint64_t NativeState() const override;
   virtual uint64_t NativeLinkState() const override;
   virtual uint64_t NativeInteractiveState() const override;
 
   // ActionAccessible
   virtual uint8_t ActionCount() const override;
   virtual void ActionNameAt(uint8_t aIndex, nsAString& aName) override;
   virtual bool DoAction(uint8_t aIndex) const override;
 
--- a/accessible/html/HTMLListAccessible.cpp
+++ b/accessible/html/HTMLListAccessible.cpp
@@ -24,17 +24,17 @@ using namespace mozilla::a11y;
 role
 HTMLListAccessible::NativeRole() const
 {
   a11y::role r = GetAccService()->MarkupRole(mContent);
   return r != roles::NOTHING ? r : roles::LIST;
 }
 
 uint64_t
-HTMLListAccessible::NativeState()
+HTMLListAccessible::NativeState() const
 {
   return HyperTextAccessibleWrap::NativeState() | states::READONLY;
 }
 
 
 ////////////////////////////////////////////////////////////////////////////////
 // HTMLLIAccessible
 ////////////////////////////////////////////////////////////////////////////////
@@ -64,17 +64,17 @@ HTMLLIAccessible::Shutdown()
 role
 HTMLLIAccessible::NativeRole() const
 {
   a11y::role r = GetAccService()->MarkupRole(mContent);
   return r != roles::NOTHING ? r : roles::LISTITEM;
 }
 
 uint64_t
-HTMLLIAccessible::NativeState()
+HTMLLIAccessible::NativeState() const
 {
   return HyperTextAccessibleWrap::NativeState() | states::READONLY;
 }
 
 nsRect
 HTMLLIAccessible::BoundsInAppUnits() const
 {
   nsRect rect = AccessibleWrap::BoundsInAppUnits();
@@ -162,17 +162,17 @@ HTMLListBulletAccessible::Name(nsString&
 
 role
 HTMLListBulletAccessible::NativeRole() const
 {
   return roles::STATICTEXT;
 }
 
 uint64_t
-HTMLListBulletAccessible::NativeState()
+HTMLListBulletAccessible::NativeState() const
 {
   return LeafAccessible::NativeState() | states::READONLY;
 }
 
 void
 HTMLListBulletAccessible::AppendTextTo(nsAString& aText, uint32_t aStartOffset,
                                        uint32_t aLength)
 {
--- a/accessible/html/HTMLListAccessible.h
+++ b/accessible/html/HTMLListAccessible.h
@@ -25,17 +25,17 @@ public:
     HyperTextAccessibleWrap(aContent, aDoc) { mGenericTypes |= eList; }
 
   // nsISupports
   NS_INLINE_DECL_REFCOUNTING_INHERITED(HTMLListAccessible,
                                        HyperTextAccessibleWrap)
 
   // Accessible
   virtual a11y::role NativeRole() const override;
-  virtual uint64_t NativeState() override;
+  virtual uint64_t NativeState() const override;
 
 protected:
   virtual ~HTMLListAccessible() { }
 };
 
 
 /**
  * Used for HTML list item (e.g. HTML li).
@@ -48,17 +48,17 @@ public:
   // nsISupports
   NS_INLINE_DECL_REFCOUNTING_INHERITED(HTMLLIAccessible,
                                        HyperTextAccessibleWrap)
 
   // Accessible
   virtual void Shutdown() override;
   virtual nsRect BoundsInAppUnits() const override;
   virtual a11y::role NativeRole() const override;
-  virtual uint64_t NativeState() override;
+  virtual uint64_t NativeState() const override;
 
   virtual bool InsertChildAt(uint32_t aIndex, Accessible* aChild) override;
 
   // HTMLLIAccessible
   HTMLListBulletAccessible* Bullet() const { return mBullet; }
   void UpdateBullet(bool aHasBullet);
 
 protected:
@@ -77,17 +77,17 @@ class HTMLListBulletAccessible : public 
 public:
   HTMLListBulletAccessible(nsIContent* aContent, DocAccessible* aDoc);
   virtual ~HTMLListBulletAccessible() { }
 
   // Accessible
   virtual nsIFrame* GetFrame() const override;
   virtual ENameValueFlag Name(nsString& aName) const override;
   virtual a11y::role NativeRole() const override;
-  virtual uint64_t NativeState() override;
+  virtual uint64_t NativeState() const 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
@@ -34,17 +34,17 @@ HTMLSelectListAccessible::
 {
   mGenericTypes |= eListControl | eSelect;
 }
 
 ////////////////////////////////////////////////////////////////////////////////
 // HTMLSelectListAccessible: Accessible public
 
 uint64_t
-HTMLSelectListAccessible::NativeState()
+HTMLSelectListAccessible::NativeState() const
 {
   uint64_t state = AccessibleWrap::NativeState();
   if (mContent->AsElement()->HasAttr(kNameSpaceID_None, nsGkAtoms::multiple))
     state |= states::MULTISELECTABLE | states::EXTSELECTABLE;
 
   return state;
 }
 
@@ -164,17 +164,17 @@ HTMLSelectOptionAccessible::NativeName(n
     aName.CompressWhitespace();
     return aName.IsEmpty() ? eNameOK : eNameFromSubtree;
   }
 
   return eNameOK;
 }
 
 uint64_t
-HTMLSelectOptionAccessible::NativeState()
+HTMLSelectOptionAccessible::NativeState() const
 {
   // As a HTMLSelectOptionAccessible we can have the following states:
   // SELECTABLE, SELECTED, FOCUSED, FOCUSABLE, OFFSCREEN
   // Upcall to Accessible, but skip HyperTextAccessible impl
   // because we don't want EDITABLE or SELECTABLE_TEXT
   uint64_t state = Accessible::NativeState();
 
   Accessible* select = GetSelect();
@@ -392,17 +392,17 @@ HTMLComboboxAccessible::Shutdown()
     mListAccessible->Shutdown();
     mListAccessible = nullptr;
   }
 
   AccessibleWrap::Shutdown();
 }
 
 uint64_t
-HTMLComboboxAccessible::NativeState()
+HTMLComboboxAccessible::NativeState() const
 {
   // As a HTMLComboboxAccessible we can have the following states:
   // FOCUSED, FOCUSABLE, HASPOPUP, EXPANDED, COLLAPSED
   // Get focus status from base class
   uint64_t state = Accessible::NativeState();
 
   nsIComboboxControlFrame* comboFrame = do_QueryFrame(GetFrame());
   if (comboFrame && comboFrame->IsDroppedDown())
@@ -563,17 +563,17 @@ HTMLComboboxListAccessible::GetFrame() c
 
 role
 HTMLComboboxListAccessible::NativeRole() const
 {
   return roles::COMBOBOX_LIST;
 }
 
 uint64_t
-HTMLComboboxListAccessible::NativeState()
+HTMLComboboxListAccessible::NativeState() const
 {
   // As a HTMLComboboxListAccessible we can have the following states:
   // FOCUSED, FOCUSABLE, FLOATING, INVISIBLE
   // Get focus status from base class
   uint64_t state = Accessible::NativeState();
 
   nsIComboboxControlFrame* comboFrame = do_QueryFrame(mParent->GetFrame());
   if (comboFrame && comboFrame->IsDroppedDown())
--- a/accessible/html/HTMLSelectAccessible.h
+++ b/accessible/html/HTMLSelectAccessible.h
@@ -33,17 +33,17 @@ class HTMLSelectListAccessible : public 
 {
 public:
 
   HTMLSelectListAccessible(nsIContent* aContent, DocAccessible* aDoc);
   virtual ~HTMLSelectListAccessible() {}
 
   // Accessible
   virtual a11y::role NativeRole() const override;
-  virtual uint64_t NativeState() override;
+  virtual uint64_t NativeState() const override;
   virtual bool IsAcceptableChild(nsIContent* aEl) const override;
 
   // SelectAccessible
   virtual bool SelectAll() override;
   virtual bool UnselectAll() override;
 
   // Widgets
   virtual bool IsWidget() const override;
@@ -61,17 +61,17 @@ class HTMLSelectOptionAccessible : publi
 public:
   enum { eAction_Select = 0 };
 
   HTMLSelectOptionAccessible(nsIContent* aContent, DocAccessible* aDoc);
   virtual ~HTMLSelectOptionAccessible() {}
 
   // Accessible
   virtual a11y::role NativeRole() const override;
-  virtual uint64_t NativeState() override;
+  virtual uint64_t NativeState() const 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() const override;
@@ -162,17 +162,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) const override;
   virtual a11y::role NativeRole() const override;
-  virtual uint64_t NativeState() override;
+  virtual uint64_t NativeState() const override;
   virtual bool RemoveChild(Accessible* aChild) override;
   virtual bool IsAcceptableChild(nsIContent* aEl) const override;
 
   // ActionAccessible
   virtual uint8_t ActionCount() const override;
   virtual void ActionNameAt(uint8_t aIndex, nsAString& aName) override;
   virtual bool DoAction(uint8_t aIndex) const override;
 
@@ -204,17 +204,17 @@ public:
 
   HTMLComboboxListAccessible(Accessible* aParent, nsIContent* aContent,
                              DocAccessible* aDoc);
   virtual ~HTMLComboboxListAccessible() {}
 
   // Accessible
   virtual nsIFrame* GetFrame() const override;
   virtual a11y::role NativeRole() const override;
-  virtual uint64_t NativeState() override;
+  virtual uint64_t NativeState() const 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
@@ -57,17 +57,17 @@ HTMLTableCellAccessible::NativeRole() co
 {
   if (mContent->IsMathMLElement(nsGkAtoms::mtd_)) {
     return roles::MATHML_CELL;
   }
   return roles::CELL;
 }
 
 uint64_t
-HTMLTableCellAccessible::NativeState()
+HTMLTableCellAccessible::NativeState() const
 {
   uint64_t state = HyperTextAccessibleWrap::NativeState();
 
   nsIFrame *frame = mContent->GetPrimaryFrame();
   NS_ASSERTION(frame, "No frame for valid cell accessible!");
 
   if (frame && frame->IsSelected())
     state |= states::SELECTED;
@@ -399,17 +399,17 @@ HTMLTableAccessible::NativeRole() const
 {
   if (mContent->IsMathMLElement(nsGkAtoms::mtable_)) {
     return roles::MATHML_TABLE;
   }
   return roles::TABLE;
 }
 
 uint64_t
-HTMLTableAccessible::NativeState()
+HTMLTableAccessible::NativeState() const
 {
   return Accessible::NativeState() | states::READONLY;
 }
 
 ENameValueFlag
 HTMLTableAccessible::NativeName(nsString& aName) const
 {
   ENameValueFlag nameFlag = Accessible::NativeName(aName);
--- a/accessible/html/HTMLTableAccessible.h
+++ b/accessible/html/HTMLTableAccessible.h
@@ -30,17 +30,17 @@ public:
 
   // nsISupports
   NS_INLINE_DECL_REFCOUNTING_INHERITED(HTMLTableCellAccessible,
                                        HyperTextAccessibleWrap)
 
   // Accessible
   virtual TableCellAccessible* AsTableCell() override { return this; }
   virtual a11y::role NativeRole() const override;
-  virtual uint64_t NativeState() override;
+  virtual uint64_t NativeState() const 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;
   virtual uint32_t RowIdx() const override;
@@ -158,17 +158,17 @@ public:
   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() const override;
-  virtual uint64_t NativeState() override;
+  virtual uint64_t NativeState() const override;
   virtual already_AddRefed<nsIPersistentProperties> NativeAttributes() override;
   virtual Relation RelationByType(RelationType aRelationType) const override;
 
   virtual bool InsertChildAt(uint32_t aIndex, Accessible* aChild) override;
 
 protected:
   virtual ~HTMLTableAccessible() {}
 
--- a/accessible/xul/XULAlertAccessible.cpp
+++ b/accessible/xul/XULAlertAccessible.cpp
@@ -28,17 +28,17 @@ XULAlertAccessible::~XULAlertAccessible(
 
 role
 XULAlertAccessible::NativeRole() const
 {
   return roles::ALERT;
 }
 
 uint64_t
-XULAlertAccessible::NativeState()
+XULAlertAccessible::NativeState() const
 {
   return Accessible::NativeState() | states::ALERT;
 }
 
 ENameValueFlag
 XULAlertAccessible::Name(nsString& aName) const
 {
   // Screen readers need to read contents of alert, not the accessible name.
--- a/accessible/xul/XULAlertAccessible.h
+++ b/accessible/xul/XULAlertAccessible.h
@@ -20,17 +20,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) const override;
   virtual a11y::role NativeRole() const override;
-  virtual uint64_t NativeState() override;
+  virtual uint64_t NativeState() const override;
 
   // Widgets
   virtual bool IsWidget() const override;
   virtual Accessible* ContainerWidget() const override;
 
 protected:
   ~XULAlertAccessible();
 };
--- a/accessible/xul/XULColorPickerAccessible.cpp
+++ b/accessible/xul/XULColorPickerAccessible.cpp
@@ -38,17 +38,17 @@ XULColorPickerTileAccessible::Value(nsSt
 
 role
 XULColorPickerTileAccessible::NativeRole() const
 {
   return roles::PUSHBUTTON;
 }
 
 uint64_t
-XULColorPickerTileAccessible::NativeState()
+XULColorPickerTileAccessible::NativeState() const
 {
   uint64_t state = AccessibleWrap::NativeState();
   if (mContent->AsElement()->HasAttr(kNameSpaceID_None, nsGkAtoms::selected))
     state |= states::SELECTED;
 
   return state;
 }
 
@@ -84,17 +84,17 @@ XULColorPickerAccessible::
 {
   mGenericTypes |= eMenuButton;
 }
 
 ////////////////////////////////////////////////////////////////////////////////
 // XULColorPickerAccessible: Accessible
 
 uint64_t
-XULColorPickerAccessible::NativeState()
+XULColorPickerAccessible::NativeState() const
 {
   uint64_t state = AccessibleWrap::NativeState();
   return state | states::HASPOPUP;
 }
 
 role
 XULColorPickerAccessible::NativeRole() const
 {
--- a/accessible/xul/XULColorPickerAccessible.h
+++ b/accessible/xul/XULColorPickerAccessible.h
@@ -18,17 +18,17 @@ class XULColorPickerTileAccessible : pub
 {
 public:
   XULColorPickerTileAccessible(nsIContent* aContent,
                                DocAccessible* aDoc);
 
   // Accessible
   virtual void Value(nsString& aValue) const override;
   virtual a11y::role NativeRole() const override;
-  virtual uint64_t NativeState() override;
+  virtual uint64_t NativeState() const override;
   virtual uint64_t NativeInteractiveState() const override;
 
   // Widgets
   virtual Accessible* ContainerWidget() const override;
 };
 
 
 /**
@@ -36,17 +36,17 @@ public:
  */
 class XULColorPickerAccessible : public XULColorPickerTileAccessible
 {
 public:
   XULColorPickerAccessible(nsIContent* aContent, DocAccessible* aDoc);
 
   // Accessible
   virtual a11y::role NativeRole() const override;
-  virtual uint64_t NativeState() override;
+  virtual uint64_t NativeState() const 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
@@ -45,17 +45,17 @@ XULComboboxAccessible::
 
 role
 XULComboboxAccessible::NativeRole() const
 {
   return IsAutoComplete() ? roles::AUTOCOMPLETE : roles::COMBOBOX;
 }
 
 uint64_t
-XULComboboxAccessible::NativeState()
+XULComboboxAccessible::NativeState() const
 {
   // As a nsComboboxAccessible we can have the following states:
   //     STATE_FOCUSED
   //     STATE_FOCUSABLE
   //     STATE_HASPOPUP
   //     STATE_EXPANDED
   //     STATE_COLLAPSED
 
--- a/accessible/xul/XULComboboxAccessible.h
+++ b/accessible/xul/XULComboboxAccessible.h
@@ -20,17 +20,17 @@ public:
   enum { eAction_Click = 0 };
 
   XULComboboxAccessible(nsIContent* aContent, DocAccessible* aDoc);
 
   // 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;
+  virtual uint64_t NativeState() const override;
 
   // ActionAccessible
   virtual uint8_t ActionCount() const override;
   virtual void ActionNameAt(uint8_t aIndex, nsAString& aName) override;
   virtual bool DoAction(uint8_t aIndex) const override;
 
   // Widgets
   virtual bool IsActiveWidget() const override;
--- a/accessible/xul/XULElementAccessibles.cpp
+++ b/accessible/xul/XULElementAccessibles.cpp
@@ -74,17 +74,17 @@ XULLabelAccessible::NativeName(nsString&
 
 role
 XULLabelAccessible::NativeRole() const
 {
   return roles::LABEL;
 }
 
 uint64_t
-XULLabelAccessible::NativeState()
+XULLabelAccessible::NativeState() const
 {
   // Labels and description have read only state
   // They are not focusable or selectable
   return HyperTextAccessibleWrap::NativeState() | states::READONLY;
 }
 
 Relation
 XULLabelAccessible::RelationByType(RelationType aType) const
@@ -128,34 +128,34 @@ XULLabelAccessible::UpdateLabelValue(con
 
 role
 XULLabelTextLeafAccessible::NativeRole() const
 {
   return roles::TEXT_LEAF;
 }
 
 uint64_t
-XULLabelTextLeafAccessible::NativeState()
+XULLabelTextLeafAccessible::NativeState() const
 {
   return TextLeafAccessibleWrap::NativeState() | states::READONLY;
 }
 
 
 ////////////////////////////////////////////////////////////////////////////////
 // XULTooltipAccessible
 ////////////////////////////////////////////////////////////////////////////////
 
 XULTooltipAccessible::
   XULTooltipAccessible(nsIContent* aContent, DocAccessible* aDoc) :
   LeafAccessible(aContent, aDoc)
 {
 }
 
 uint64_t
-XULTooltipAccessible::NativeState()
+XULTooltipAccessible::NativeState() const
 {
   return LeafAccessible::NativeState() | states::READONLY;
 }
 
 role
 XULTooltipAccessible::NativeRole() const
 {
   return roles::TOOLTIP;
--- a/accessible/xul/XULElementAccessibles.h
+++ b/accessible/xul/XULElementAccessibles.h
@@ -20,17 +20,17 @@ class XULLabelTextLeafAccessible;
 class XULLabelAccessible : public HyperTextAccessibleWrap
 {
 public:
   XULLabelAccessible(nsIContent* aContent, DocAccessible* aDoc);
 
   // Accessible
   virtual void Shutdown() override;
   virtual a11y::role NativeRole() const override;
-  virtual uint64_t NativeState() override;
+  virtual uint64_t NativeState() const override;
   virtual Relation RelationByType(RelationType aType) const override;
 
   void UpdateLabelValue(const nsString& aValue);
 
 protected:
   // Accessible
   virtual ENameValueFlag NativeName(nsString& aName) const override;
 
@@ -55,32 +55,32 @@ public:
   XULLabelTextLeafAccessible(nsIContent* aContent, DocAccessible* aDoc) :
     TextLeafAccessibleWrap(aContent, aDoc)
   { mStateFlags |= eSharedNode; }
 
   virtual ~XULLabelTextLeafAccessible() { }
 
   // Accessible
   virtual a11y::role NativeRole() const override;
-  virtual uint64_t NativeState() override;
+  virtual uint64_t NativeState() const override;
 };
 
 
 /**
  * Used for XUL tooltip element.
  */
 class XULTooltipAccessible : public LeafAccessible
 {
 
 public:
   XULTooltipAccessible(nsIContent* aContent, DocAccessible* aDoc);
 
   // Accessible
   virtual a11y::role NativeRole() const override;
-  virtual uint64_t NativeState() override;
+  virtual uint64_t NativeState() const override;
 };
 
 class XULLinkAccessible : public XULLabelAccessible
 {
 
 public:
   XULLinkAccessible(nsIContent* aContent, DocAccessible* aDoc);
 
--- a/accessible/xul/XULFormControlAccessible.cpp
+++ b/accessible/xul/XULFormControlAccessible.cpp
@@ -83,17 +83,17 @@ XULButtonAccessible::DoAction(uint8_t aI
 
 role
 XULButtonAccessible::NativeRole() const
 {
   return roles::PUSHBUTTON;
 }
 
 uint64_t
-XULButtonAccessible::NativeState()
+XULButtonAccessible::NativeState() const
 {
   // Possible states: focused, focusable, unavailable(disabled).
 
   // get focus and disable status from base class
   uint64_t state = Accessible::NativeState();
 
   // Buttons can be checked -- they simply appear pressed in rather than checked
   nsCOMPtr<nsIDOMXULButtonElement> xulButtonElement(do_QueryInterface(mContent));
@@ -265,17 +265,17 @@ XULDropmarkerAccessible::DoAction(uint8_
 
 role
 XULDropmarkerAccessible::NativeRole() const
 {
   return roles::PUSHBUTTON;
 }
 
 uint64_t
-XULDropmarkerAccessible::NativeState()
+XULDropmarkerAccessible::NativeState() const
 {
   return DropmarkerOpen(false) ? states::PRESSED : 0;
 }
 
 ////////////////////////////////////////////////////////////////////////////////
 // XULCheckboxAccessible
 ////////////////////////////////////////////////////////////////////////////////
 
@@ -314,17 +314,17 @@ XULCheckboxAccessible::DoAction(uint8_t 
   if (aIndex != eAction_Click)
     return false;
 
   DoCommand();
   return true;
 }
 
 uint64_t
-XULCheckboxAccessible::NativeState()
+XULCheckboxAccessible::NativeState() const
 {
   // Possible states: focused, focusable, unavailable(disabled), checked
   // Get focus and disable status from base class
   uint64_t state = LeafAccessible::NativeState();
 
   state |= states::CHECKABLE;
 
   // Determine Checked state
@@ -403,17 +403,17 @@ XULGroupboxAccessible::RelationByType(Re
 
 XULRadioButtonAccessible::
   XULRadioButtonAccessible(nsIContent* aContent, DocAccessible* aDoc) :
   RadioButtonAccessible(aContent, aDoc)
 {
 }
 
 uint64_t
-XULRadioButtonAccessible::NativeState()
+XULRadioButtonAccessible::NativeState() const
 {
   uint64_t state = LeafAccessible::NativeState();
   state |= states::CHECKABLE;
 
   nsCOMPtr<nsIDOMXULSelectControlItemElement> radioButton =
     do_QueryInterface(mContent);
   if (radioButton) {
     bool selected = false;   // Radio buttons can be selected
@@ -605,12 +605,12 @@ XULToolbarSeparatorAccessible::
 
 role
 XULToolbarSeparatorAccessible::NativeRole() const
 {
   return roles::SEPARATOR;
 }
 
 uint64_t
-XULToolbarSeparatorAccessible::NativeState()
+XULToolbarSeparatorAccessible::NativeState() const
 {
   return 0;
 }
--- a/accessible/xul/XULFormControlAccessible.h
+++ b/accessible/xul/XULFormControlAccessible.h
@@ -32,17 +32,17 @@ public:
   enum { eAction_Click = 0 };
   XULButtonAccessible(nsIContent* aContent, DocAccessible* aDoc);
 
   // nsISupports
   NS_INLINE_DECL_REFCOUNTING_INHERITED(XULButtonAccessible, AccessibleWrap)
 
   // Accessible
   virtual mozilla::a11y::role NativeRole() const override;
-  virtual uint64_t NativeState() override;
+  virtual uint64_t NativeState() const override;
 
   // ActionAccessible
   virtual uint8_t ActionCount() const override;
   virtual void ActionNameAt(uint8_t aIndex, nsAString& aName) override;
   virtual bool DoAction(uint8_t aIndex) const override;
 
   // Widgets
   virtual bool IsWidget() const override;
@@ -66,17 +66,17 @@ protected:
 class XULCheckboxAccessible : public LeafAccessible
 {
 public:
   enum { eAction_Click = 0 };
   XULCheckboxAccessible(nsIContent* aContent, DocAccessible* aDoc);
 
   // Accessible
   virtual mozilla::a11y::role NativeRole() const override;
-  virtual uint64_t NativeState() override;
+  virtual uint64_t NativeState() const override;
 
   // ActionAccessible
   virtual uint8_t ActionCount() const override;
   virtual void ActionNameAt(uint8_t aIndex, nsAString& aName) override;
   virtual bool DoAction(uint8_t aIndex) const override;
 };
 
 /**
@@ -85,17 +85,17 @@ public:
 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;
+  virtual uint64_t NativeState() const override;
 
   // ActionAccessible
   virtual uint8_t ActionCount() const override;
   virtual void ActionNameAt(uint8_t aIndex, nsAString& aName) override;
   virtual bool DoAction(uint8_t aIndex) const override;
 
 private:
   bool DropmarkerOpen(bool aToggleOpen) const;
@@ -123,17 +123,17 @@ protected:
  */
 class XULRadioButtonAccessible : public RadioButtonAccessible
 {
 
 public:
   XULRadioButtonAccessible(nsIContent* aContent, DocAccessible* aDoc);
 
   // Accessible
-  virtual uint64_t NativeState() override;
+  virtual uint64_t NativeState() const override;
   virtual uint64_t NativeInteractiveState() const override;
 
   // Widgets
   virtual Accessible* ContainerWidget() const override;
 };
 
 /**
  * Used for XUL radiogroup element.
@@ -203,16 +203,16 @@ protected:
 class XULToolbarSeparatorAccessible : public LeafAccessible
 {
 public:
   XULToolbarSeparatorAccessible(nsIContent* aContent,
                                 DocAccessible* aDoc);
 
   // Accessible
   virtual mozilla::a11y::role NativeRole() const override;
-  virtual uint64_t NativeState() override;
+  virtual uint64_t NativeState() const override;
 };
 
 } // namespace a11y
 } // namespace mozilla
 
 #endif
 
--- a/accessible/xul/XULListboxAccessible.cpp
+++ b/accessible/xul/XULListboxAccessible.cpp
@@ -36,17 +36,17 @@ XULColumAccessible::
 
 role
 XULColumAccessible::NativeRole() const
 {
   return roles::LIST;
 }
 
 uint64_t
-XULColumAccessible::NativeState()
+XULColumAccessible::NativeState() const
 {
   return states::READONLY;
 }
 
 
 ////////////////////////////////////////////////////////////////////////////////
 // XULColumnItemAccessible
 ////////////////////////////////////////////////////////////////////////////////
@@ -59,17 +59,17 @@ XULColumnItemAccessible::
 
 role
 XULColumnItemAccessible::NativeRole() const
 {
   return roles::COLUMNHEADER;
 }
 
 uint64_t
-XULColumnItemAccessible::NativeState()
+XULColumnItemAccessible::NativeState() const
 {
   return states::READONLY;
 }
 
 uint8_t
 XULColumnItemAccessible::ActionCount() const
 {
   return 1;
@@ -111,17 +111,17 @@ XULListboxAccessible::
   if (IsMulticolumn())
     mGenericTypes |= eTable;
 }
 
 ////////////////////////////////////////////////////////////////////////////////
 // XULListboxAccessible: Accessible
 
 uint64_t
-XULListboxAccessible::NativeState()
+XULListboxAccessible::NativeState() const
 {
   // As a XULListboxAccessible we can have the following states:
   //   FOCUSED, READONLY, FOCUSABLE
 
   // Get focus status from base class
   uint64_t states = Accessible::NativeState();
 
   // see if we are multiple select if so set ourselves as such
@@ -608,17 +608,17 @@ XULListitemAccessible::NativeRole() cons
 
   if (mParent && mParent->Role() == roles::COMBOBOX_LIST)
     return roles::COMBOBOX_OPTION;
 
   return roles::RICH_OPTION;
 }
 
 uint64_t
-XULListitemAccessible::NativeState()
+XULListitemAccessible::NativeState() const
 {
   if (mIsCheckbox)
     return XULMenuitemAccessible::NativeState();
 
   uint64_t states = NativeInteractiveState();
 
   nsCOMPtr<nsIDOMXULSelectControlItemElement> listItem =
     do_QueryInterface(mContent);
--- a/accessible/xul/XULListboxAccessible.h
+++ b/accessible/xul/XULListboxAccessible.h
@@ -23,31 +23,31 @@ namespace a11y {
  */
 class XULColumAccessible : public AccessibleWrap
 {
 public:
   XULColumAccessible(nsIContent* aContent, DocAccessible* aDoc);
 
   // Accessible
   virtual a11y::role NativeRole() const override;
-  virtual uint64_t NativeState() override;
+  virtual uint64_t NativeState() const 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() const override;
-  virtual uint64_t NativeState() override;
+  virtual uint64_t NativeState() const override;
 
   // ActionAccessible
   virtual uint8_t ActionCount() const override;
   virtual void ActionNameAt(uint8_t aIndex, nsAString& aName) override;
   virtual bool DoAction(uint8_t aIndex) const override;
 
   enum { eAction_Click = 0 };
 };
@@ -78,17 +78,17 @@ public:
   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) const override;
   virtual TableAccessible* AsTable() override { return this; }
   virtual a11y::role NativeRole() const override;
-  virtual uint64_t NativeState() override;
+  virtual uint64_t NativeState() const override;
 
   // Widgets
   virtual bool IsWidget() const override;
   virtual bool IsActiveWidget() const override;
   virtual bool AreItemsOperable() const override;
 
   virtual Accessible* ContainerWidget() const override;
 
@@ -109,17 +109,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() const override;
-  virtual uint64_t NativeState() override;
+  virtual uint64_t NativeState() const override;
   virtual uint64_t NativeInteractiveState() const override;
 
   // Actions
   virtual void ActionNameAt(uint8_t index, nsAString& aName) override;
 
   // Widgets
   virtual Accessible* ContainerWidget() const override;
 
--- a/accessible/xul/XULMenuAccessible.cpp
+++ b/accessible/xul/XULMenuAccessible.cpp
@@ -38,17 +38,17 @@ using namespace mozilla::a11y;
 XULMenuitemAccessible::
   XULMenuitemAccessible(nsIContent* aContent, DocAccessible* aDoc) :
   AccessibleWrap(aContent, aDoc)
 {
   mStateFlags |= eNoXBLKids;
 }
 
 uint64_t
-XULMenuitemAccessible::NativeState()
+XULMenuitemAccessible::NativeState() const
 {
   uint64_t state = Accessible::NativeState();
 
   // Has Popup?
   if (mContent->NodeInfo()->Equals(nsGkAtoms::menu, kNameSpaceID_XUL)) {
     state |= states::HASPOPUP;
     if (mContent->AsElement()->HasAttr(kNameSpaceID_None, nsGkAtoms::open))
       state |= states::EXPANDED;
@@ -349,17 +349,17 @@ XULMenuitemAccessible::ContainerWidget()
 
 XULMenuSeparatorAccessible::
   XULMenuSeparatorAccessible(nsIContent* aContent, DocAccessible* aDoc) :
   XULMenuitemAccessible(aContent, aDoc)
 {
 }
 
 uint64_t
-XULMenuSeparatorAccessible::NativeState()
+XULMenuSeparatorAccessible::NativeState() const
 {
   // Isn't focusable, but can be offscreen/invisible -- only copy those states
   return XULMenuitemAccessible::NativeState() &
     (states::OFFSCREEN | states::INVISIBLE);
 }
 
 ENameValueFlag
 XULMenuSeparatorAccessible::NativeName(nsString& aName) const
@@ -407,17 +407,17 @@ XULMenupopupAccessible::
   mSelectControl = do_QueryInterface(mContent->GetFlattenedTreeParent());
   if (!mSelectControl)
     mGenericTypes &= ~eSelect;
 
   mStateFlags |= eNoXBLKids;
 }
 
 uint64_t
-XULMenupopupAccessible::NativeState()
+XULMenupopupAccessible::NativeState() const
 {
   uint64_t state = Accessible::NativeState();
 
 #ifdef DEBUG
   // We are onscreen if our parent is active
   bool isActive =
     mContent->AsElement()->HasAttr(kNameSpaceID_None, nsGkAtoms::menuactive);
   if (!isActive) {
--- a/accessible/xul/XULMenuAccessible.h
+++ b/accessible/xul/XULMenuAccessible.h
@@ -21,17 +21,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() const override;
-  virtual uint64_t NativeState() override;
+  virtual uint64_t NativeState() const override;
   virtual uint64_t NativeInteractiveState() const override;
   virtual int32_t GetLevelInternal() override;
 
   // ActionAccessible
   virtual uint8_t ActionCount() const override;
   virtual void ActionNameAt(uint8_t aIndex, nsAString& aName) override;
   virtual bool DoAction(uint8_t aIndex) const override;
   virtual KeyBinding AccessKey() const override;
@@ -52,17 +52,17 @@ protected:
  */
 class XULMenuSeparatorAccessible : public XULMenuitemAccessible
 {
 public:
   XULMenuSeparatorAccessible(nsIContent* aContent, DocAccessible* aDoc);
 
   // Accessible
   virtual a11y::role NativeRole() const override;
-  virtual uint64_t NativeState() override;
+  virtual uint64_t NativeState() const override;
 
   // ActionAccessible
   virtual uint8_t ActionCount() const override;
   virtual void ActionNameAt(uint8_t aIndex, nsAString& aName) override;
   virtual bool DoAction(uint8_t aIndex) const override;
 
 protected:
   // Accessible
@@ -75,17 +75,17 @@ protected:
  */
 class XULMenupopupAccessible : public XULSelectControlAccessible
 {
 public:
   XULMenupopupAccessible(nsIContent* aContent, DocAccessible* aDoc);
 
   // Accessible
   virtual a11y::role NativeRole() const override;
-  virtual uint64_t NativeState() override;
+  virtual uint64_t NativeState() const override;
 
   // Widgets
   virtual bool IsWidget() const override;
   virtual bool IsActiveWidget() const override;
   virtual bool AreItemsOperable() const override;
 
   virtual Accessible* ContainerWidget() const override;
 
--- a/accessible/xul/XULTabAccessible.cpp
+++ b/accessible/xul/XULTabAccessible.cpp
@@ -66,17 +66,17 @@ XULTabAccessible::DoAction(uint8_t index
 
 role
 XULTabAccessible::NativeRole() const
 {
   return roles::PAGETAB;
 }
 
 uint64_t
-XULTabAccessible::NativeState()
+XULTabAccessible::NativeState() const
 {
   // Possible states: focused, focusable, unavailable(disabled), offscreen.
 
   // get focus and disable status from base class
   uint64_t state = AccessibleWrap::NativeState();
 
   // Check whether the tab is selected and/or pinned
   nsCOMPtr<nsIDOMXULSelectControlItemElement> tab(do_QueryInterface(mContent));
--- a/accessible/xul/XULTabAccessible.h
+++ b/accessible/xul/XULTabAccessible.h
@@ -21,17 +21,17 @@ class XULTabAccessible : public HyperTex
 {
 public:
   enum { eAction_Switch = 0 };
 
   XULTabAccessible(nsIContent* aContent, DocAccessible* aDoc);
 
   // Accessible
   virtual a11y::role NativeRole() const override;
-  virtual uint64_t NativeState() override;
+  virtual uint64_t NativeState() const override;
   virtual uint64_t NativeInteractiveState() const override;
   virtual Relation RelationByType(RelationType aType) const override;
 
   // ActionAccessible
   virtual uint8_t ActionCount() const override;
   virtual void ActionNameAt(uint8_t aIndex, nsAString& aName) override;
   virtual bool DoAction(uint8_t aIndex) const override;
 };
--- a/accessible/xul/XULTreeAccessible.cpp
+++ b/accessible/xul/XULTreeAccessible.cpp
@@ -77,17 +77,17 @@ NS_INTERFACE_MAP_END_INHERITING(Accessib
 
 NS_IMPL_ADDREF_INHERITED(XULTreeAccessible, Accessible)
 NS_IMPL_RELEASE_INHERITED(XULTreeAccessible, Accessible)
 
 ////////////////////////////////////////////////////////////////////////////////
 // XULTreeAccessible: Accessible implementation
 
 uint64_t
-XULTreeAccessible::NativeState()
+XULTreeAccessible::NativeState() const
 {
   // Get focus status from base class.
   uint64_t state = Accessible::NativeState();
 
   // readonly state
   state |= states::READONLY;
 
   // multiselectable state.
@@ -914,17 +914,17 @@ XULTreeItemAccessibleBase::GroupPosition
   groupPos.level = level + 1;
   groupPos.setSize = topCount + bottomCount;
   groupPos.posInSet = topCount;
 
   return groupPos;
 }
 
 uint64_t
-XULTreeItemAccessibleBase::NativeState()
+XULTreeItemAccessibleBase::NativeState() const
 {
 
   // focusable and selectable states
   uint64_t state = NativeInteractiveState();
 
   // expanded/collapsed state
   if (IsExpandable()) {
     bool isContainerOpen;
--- a/accessible/xul/XULTreeAccessible.h
+++ b/accessible/xul/XULTreeAccessible.h
@@ -37,17 +37,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) const override;
   virtual a11y::role NativeRole() const override;
-  virtual uint64_t NativeState() override;
+  virtual uint64_t NativeState() const 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) const override;
 
   // SelectAccessible
@@ -144,17 +144,17 @@ public:
   NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED(XULTreeItemAccessibleBase,
                                            AccessibleWrap)
 
   // Accessible
   virtual void Shutdown() override;
   virtual nsRect BoundsInAppUnits() const override;
   virtual nsIntRect BoundsInCSSPixels() const override;
   virtual GroupPos GroupPosition() override;
-  virtual uint64_t NativeState() override;
+  virtual uint64_t NativeState() const override;
   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
--- a/accessible/xul/XULTreeGridAccessible.cpp
+++ b/accessible/xul/XULTreeGridAccessible.cpp
@@ -683,17 +683,17 @@ XULTreeGridCellAccessible::NativeAttribu
 
 role
 XULTreeGridCellAccessible::NativeRole() const
 {
   return roles::GRID_CELL;
 }
 
 uint64_t
-XULTreeGridCellAccessible::NativeState()
+XULTreeGridCellAccessible::NativeState() const
 {
   if (!mTreeView)
     return states::DEFUNCT;
 
   // selectable/selected state
   uint64_t states = states::SELECTABLE; // keep in sync with NativeInteractiveState
 
   nsCOMPtr<nsITreeSelection> selection;
--- a/accessible/xul/XULTreeGridAccessible.h
+++ b/accessible/xul/XULTreeGridAccessible.h
@@ -129,17 +129,17 @@ public:
   virtual nsRect BoundsInAppUnits() const override;
   virtual nsIntRect BoundsInCSSPixels() const override;
   virtual ENameValueFlag Name(nsString& aName) const override;
   virtual Accessible* FocusedChild() override;
   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 NativeState() const override;
   virtual uint64_t NativeInteractiveState() const override;
 
   // ActionAccessible
   virtual uint8_t ActionCount() const override;
   virtual void ActionNameAt(uint8_t aIndex, nsAString& aName) override;
   virtual bool DoAction(uint8_t aIndex) const override;
 
   // TableCellAccessible