@@ -54,7 +54,7 @@ uint64_t XULComboboxAccessible::NativeState() const {
5454 // Get focus status from base class
5555 uint64_t state = Accessible::NativeState ();
5656
57- nsCOMPtr<nsIDOMXULMenuListElement> menuList ( do_QueryInterface ( mContent ) );
57+ nsCOMPtr<nsIDOMXULMenuListElement> menuList = Elm ()-> AsXULMenuList ( );
5858 if (menuList) {
5959 bool isOpen = false ;
6060 menuList->GetOpen (&isOpen);
@@ -70,15 +70,13 @@ uint64_t XULComboboxAccessible::NativeState() const {
7070void XULComboboxAccessible::Description (nsString& aDescription) {
7171 aDescription.Truncate ();
7272 // Use description of currently focused option
73- nsCOMPtr<nsIDOMXULMenuListElement> menuListElm ( do_QueryInterface ( mContent ) );
73+ nsCOMPtr<nsIDOMXULMenuListElement> menuListElm = Elm ()-> AsXULMenuList ( );
7474 if (!menuListElm) return ;
7575
76- nsCOMPtr<nsIDOMXULSelectControlItemElement > focusedOptionItem;
76+ nsCOMPtr<Element > focusedOptionItem;
7777 menuListElm->GetSelectedItem (getter_AddRefs (focusedOptionItem));
78- nsCOMPtr<nsIContent> focusedOptionContent =
79- do_QueryInterface (focusedOptionItem);
80- if (focusedOptionContent && mDoc ) {
81- Accessible* focusedOptionAcc = mDoc ->GetAccessible (focusedOptionContent);
78+ if (focusedOptionItem && mDoc ) {
79+ Accessible* focusedOptionAcc = mDoc ->GetAccessible (focusedOptionItem);
8280 if (focusedOptionAcc) focusedOptionAcc->Description (aDescription);
8381 }
8482}
@@ -87,7 +85,7 @@ void XULComboboxAccessible::Value(nsString& aValue) const {
8785 aValue.Truncate ();
8886
8987 // The value is the option or text shown entered in the combobox.
90- nsCOMPtr<nsIDOMXULMenuListElement> menuList ( do_QueryInterface ( mContent ) );
88+ nsCOMPtr<nsIDOMXULMenuListElement> menuList = Elm ()-> AsXULMenuList ( );
9189 if (menuList) menuList->GetLabel (aValue);
9290}
9391
@@ -100,7 +98,7 @@ bool XULComboboxAccessible::DoAction(uint8_t aIndex) const {
10098 if (aIndex != XULComboboxAccessible::eAction_Click) return false ;
10199
102100 // Programmaticaly toggle the combo box.
103- nsCOMPtr<nsIDOMXULMenuListElement> menuList ( do_QueryInterface ( mContent ) );
101+ nsCOMPtr<nsIDOMXULMenuListElement> menuList = Elm ()-> AsXULMenuList ( );
104102 if (!menuList) return false ;
105103
106104 bool isDroppedDown = false ;
@@ -113,7 +111,7 @@ void XULComboboxAccessible::ActionNameAt(uint8_t aIndex, nsAString& aName) {
113111 aName.Truncate ();
114112 if (aIndex != XULComboboxAccessible::eAction_Click) return ;
115113
116- nsCOMPtr<nsIDOMXULMenuListElement> menuList ( do_QueryInterface ( mContent ) );
114+ nsCOMPtr<nsIDOMXULMenuListElement> menuList = Elm ()-> AsXULMenuList ( );
117115 if (!menuList) return ;
118116
119117 bool isDroppedDown = false ;
@@ -155,7 +153,7 @@ bool XULComboboxAccessible::AreItemsOperable() const {
155153 return false ;
156154 }
157155
158- nsCOMPtr<nsIDOMXULMenuListElement> menuListElm = do_QueryInterface ( mContent );
156+ nsCOMPtr<nsIDOMXULMenuListElement> menuListElm = Elm ()-> AsXULMenuList ( );
159157 if (menuListElm) {
160158 bool isOpen = false ;
161159 menuListElm->GetOpen (&isOpen);
0 commit comments