Bug 1123760 - make autocomplete dropmarker in the urlbar actually work when activated through a11y APIs, r=surkov

This commit is contained in:
Gijs Kruitbosch 2015-10-13 17:19:41 +01:00
parent 6b555a2f4c
commit b98ad74d18

View File

@ -224,22 +224,28 @@ XULDropmarkerAccessible::DropmarkerOpen(bool aToggleOpen) const
{
bool isOpen = false;
nsCOMPtr<nsIDOMXULButtonElement> parentButtonElement =
do_QueryInterface(mContent->GetFlattenedTreeParent());
nsIContent* parent = mContent->GetFlattenedTreeParent();
bool foundRightElement = false;
while (parent) {
nsCOMPtr<nsIDOMXULButtonElement> parentButtonElement =
do_QueryInterface(parent);
if (parentButtonElement) {
parentButtonElement->GetOpen(&isOpen);
if (aToggleOpen)
parentButtonElement->SetOpen(!isOpen);
return isOpen;
}
if (parentButtonElement) {
parentButtonElement->GetOpen(&isOpen);
if (aToggleOpen)
parentButtonElement->SetOpen(!isOpen);
}
else {
nsCOMPtr<nsIDOMXULMenuListElement> parentMenuListElement =
do_QueryInterface(parentButtonElement);
do_QueryInterface(parent);
if (parentMenuListElement) {
parentMenuListElement->GetOpen(&isOpen);
if (aToggleOpen)
parentMenuListElement->SetOpen(!isOpen);
return isOpen;
}
parent = parent->GetFlattenedTreeParent();
}
return isOpen;