зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1566299: Update XULListBoxAccessible now that autocomplete-richlistbox-popup is a Custom Element. r=surkov
In bug 1525101, autocomplete-richlistbox-popup was converted to a Custom Element. This means we can no longer use do_QueryInterface to get nsIAutoCompletePopup. Instead, we must use Element::AsAutoCompletePopup. This fixes accessibility focus for these autocompletes. Differential Revision: https://phabricator.services.mozilla.com/D38158 --HG-- extra : moz-landing-system : lando
This commit is contained in:
Родитель
9916bc6b41
Коммит
52d863a910
|
@ -73,7 +73,7 @@ XULListboxAccessible::XULListboxAccessible(nsIContent* aContent,
|
|||
nsIContent* parentContent = mContent->GetFlattenedTreeParent();
|
||||
if (parentContent) {
|
||||
nsCOMPtr<nsIAutoCompletePopup> autoCompletePopupElm =
|
||||
do_QueryInterface(parentContent);
|
||||
parentContent->AsElement()->AsAutoCompletePopup();
|
||||
if (autoCompletePopupElm) mGenericTypes |= eAutoCompletePopup;
|
||||
}
|
||||
|
||||
|
@ -377,13 +377,15 @@ bool XULListboxAccessible::IsWidget() const { return true; }
|
|||
|
||||
bool XULListboxAccessible::IsActiveWidget() const {
|
||||
if (IsAutoCompletePopup()) {
|
||||
nsCOMPtr<nsIAutoCompletePopup> autoCompletePopupElm =
|
||||
do_QueryInterface(mContent->GetParent());
|
||||
|
||||
if (autoCompletePopupElm) {
|
||||
bool isOpen = false;
|
||||
autoCompletePopupElm->GetPopupOpen(&isOpen);
|
||||
return isOpen;
|
||||
nsIContent* parentContent = mContent->GetParent();
|
||||
if (parentContent) {
|
||||
nsCOMPtr<nsIAutoCompletePopup> autoCompletePopupElm =
|
||||
parentContent->AsElement()->AsAutoCompletePopup();
|
||||
if (autoCompletePopupElm) {
|
||||
bool isOpen = false;
|
||||
autoCompletePopupElm->GetPopupOpen(&isOpen);
|
||||
return isOpen;
|
||||
}
|
||||
}
|
||||
}
|
||||
return FocusMgr()->HasDOMFocus(mContent);
|
||||
|
@ -391,13 +393,15 @@ bool XULListboxAccessible::IsActiveWidget() const {
|
|||
|
||||
bool XULListboxAccessible::AreItemsOperable() const {
|
||||
if (IsAutoCompletePopup()) {
|
||||
nsCOMPtr<nsIAutoCompletePopup> autoCompletePopupElm =
|
||||
do_QueryInterface(mContent->GetParent());
|
||||
|
||||
if (autoCompletePopupElm) {
|
||||
bool isOpen = false;
|
||||
autoCompletePopupElm->GetPopupOpen(&isOpen);
|
||||
return isOpen;
|
||||
nsIContent* parentContent = mContent->GetParent();
|
||||
if (parentContent) {
|
||||
nsCOMPtr<nsIAutoCompletePopup> autoCompletePopupElm =
|
||||
parentContent->AsElement()->AsAutoCompletePopup();
|
||||
if (autoCompletePopupElm) {
|
||||
bool isOpen = false;
|
||||
autoCompletePopupElm->GetPopupOpen(&isOpen);
|
||||
return isOpen;
|
||||
}
|
||||
}
|
||||
}
|
||||
return true;
|
||||
|
|
Загрузка…
Ссылка в новой задаче