From 322fee727abb5d9f2347f4252bdfdfbfc9792ccc Mon Sep 17 00:00:00 2001 From: Alexander Surkov Date: Sat, 27 Feb 2016 07:55:30 -0500 Subject: [PATCH] Bug 1250878 - add acceptable child check for HTML select, r=marcoz --- accessible/generic/DocAccessible.cpp | 11 ++++++----- .../tests/mochitest/treeupdate/test_optgroup.html | 2 +- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/accessible/generic/DocAccessible.cpp b/accessible/generic/DocAccessible.cpp index ae610e353db..5109492e9a4 100644 --- a/accessible/generic/DocAccessible.cpp +++ b/accessible/generic/DocAccessible.cpp @@ -1248,6 +1248,12 @@ 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; } @@ -1706,11 +1712,6 @@ DocAccessible::ProcessContentInserted(Accessible* aContainer, // there is no HTML body element. } - // HTML comboboxes have no-content list accessible as an intermidiate - // containing all options. - if (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/treeupdate/test_optgroup.html b/accessible/tests/mochitest/treeupdate/test_optgroup.html index 999a253ddec..27323bbc38d 100644 --- a/accessible/tests/mochitest/treeupdate/test_optgroup.html +++ b/accessible/tests/mochitest/treeupdate/test_optgroup.html @@ -102,7 +102,7 @@ } } -// gA11yEventDumpToConsole = true; + //gA11yEventDumpToConsole = true; function doTest() {