Bug 1251680 - get container accessible computation should take into account the HTML select, r=marcoz
authorAlexander Surkov <surkov.alexander@gmail.com>
Mon, 29 Feb 2016 10:05:29 -0500
changeset 324345 e6977e56333235951c15448a0c7cb4aa044514c6
parent 324344 788fe2501a34c536caa5d572a9183e4e7304423f
child 324346 5ff87fac5346cecc9118046c39418feca73e4cce
push id1128
push userjlund@mozilla.com
push dateWed, 01 Jun 2016 01:31:59 +0000
treeherdermozilla-release@fe0d30de989d [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmarcoz
bugs1251680
milestone47.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1251680 - get container accessible computation should take into account the HTML select, r=marcoz
accessible/generic/DocAccessible.cpp
accessible/tests/mochitest/treeupdate/test_optgroup.html
--- a/accessible/generic/DocAccessible.cpp
+++ b/accessible/generic/DocAccessible.cpp
@@ -1243,16 +1243,22 @@ DocAccessible::GetAccessibleOrContainer(
     // Fallback to just get parent node, in case there is no parent content
     // node. Or current node is not a content node.
     if (!parent)
       parent = currNode->GetParentNode();
 
     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;
 }
 
 Accessible*
 DocAccessible::GetAccessibleOrDescendant(nsINode* aNode) const
 {
   Accessible* acc = GetAccessible(aNode);
   if (acc)
@@ -1701,21 +1707,16 @@ DocAccessible::ProcessContentInserted(Ac
         SetRoleMapEntry(aria::GetRoleMap(mContent));
       }
 
       // Continue to update the tree even if we don't have root content.
       // For example, elements may be inserted under the document element while
       // 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
     // extra HTML:body make the old body accessible) then we have to recache
     // children of the container, and then fire show/hide events for a change.
     UpdateTreeOnInsertion(container);
     break;
   }
--- a/accessible/tests/mochitest/treeupdate/test_optgroup.html
+++ b/accessible/tests/mochitest/treeupdate/test_optgroup.html
@@ -97,17 +97,17 @@
       }
 
       this.getID = function removeOptGroup_getID()
       {
         return "test optgroup's removal from a select";
       }
     }
 
-//    gA11yEventDumpToConsole = true;
+    //gA11yEventDumpToConsole = true;
 
     function doTest()
     {
       gQueue = new eventQueue();
 
       gQueue.push(new addOptGroup("select"));
       gQueue.push(new removeOptGroup("select"));