Bug 1252857 - value change events for HTML:select have wrong target, r=marcoz
authorAlexander Surkov <surkov.alexander@gmail.com>
Fri, 18 Mar 2016 16:22:17 -0400
changeset 289407 d0d3f2d377e702022baa964cc58415270b421959
parent 289406 8bfe5bd9b1c71f2cb9f4054686684d36391e0a20
child 289408 7a6646425f6264bdeb96a5d593c90c134c3a4177
push id30102
push userryanvm@gmail.com
push dateSat, 19 Mar 2016 15:23:17 +0000
treeherdermozilla-central@720fb3d55e28 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmarcoz
bugs1252857
milestone48.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 1252857 - value change events for HTML:select have wrong target, r=marcoz
accessible/generic/DocAccessible.cpp
accessible/tests/mochitest/events/test_valuechange.html
--- a/accessible/generic/DocAccessible.cpp
+++ b/accessible/generic/DocAccessible.cpp
@@ -1247,22 +1247,16 @@ 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,16 +1695,22 @@ DocAccessible::ProcessContentInserted(Ac
       // If new root content has been inserted then update it.
       UpdateRootElIfNeeded();
 
       // 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 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
     // 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/events/test_valuechange.html
+++ b/accessible/tests/mochitest/events/test_valuechange.html
@@ -127,17 +127,18 @@
       this.getID = function changeRangeValue_getID()
       {
         return prettyName(aID) + " range value changed";
       }
     }
 
     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()
       {
         getNode(aID).focus();
         synthesizeKey(aKey, {}, window);
       }
 
       this.finalCheck = function changeSelectValue_finalCheck()