diff --git a/accessible/generic/DocAccessible.cpp b/accessible/generic/DocAccessible.cpp index 1cf1ff952cc..29dd9d518ed 100644 --- a/accessible/generic/DocAccessible.cpp +++ b/accessible/generic/DocAccessible.cpp @@ -1247,12 +1247,6 @@ DocAccessible::GetAccessibleOrContainer(nsINode* aNode) const if (!(currNode = parent)) break; } - // HTML comboboxes have no-content list accessible as an intermediate - // containing all options. - if (accessible && accessible->IsHTMLCombobox()) { - return accessible->FirstChild(); - } - return accessible; } @@ -1701,6 +1695,12 @@ DocAccessible::ProcessContentInserted(Accessible* aContainer, // there is no HTML body element. } + // HTML comboboxes have no-content list accessible as an intermediate + // containing all options. + if (container && container->IsHTMLCombobox()) { + container = container->FirstChild(); + } + // We have a DOM/layout change under the container accessible, and its tree // might need an update. Since DOM/layout change of the element may affect // on the accessibleness of adjacent elements (for example, insertion of diff --git a/accessible/tests/mochitest/events/test_valuechange.html b/accessible/tests/mochitest/events/test_valuechange.html index 11ff63a7129..3464ffdeb49 100644 --- a/accessible/tests/mochitest/events/test_valuechange.html +++ b/accessible/tests/mochitest/events/test_valuechange.html @@ -132,7 +132,8 @@ function changeSelectValue(aID, aKey, aValue) { - this.eventSeq = [new invokerChecker(EVENT_TEXT_VALUE_CHANGE, aID)]; + this.eventSeq = + [ new invokerChecker(EVENT_TEXT_VALUE_CHANGE, getAccessible(aID)) ]; this.invoke = function changeSelectValue_invoke() {