bug 1189277 - Only coalesce reorder events when a previous one for the same target is obsolete. r=surkov, a=sledru
authorTrevor Saunders <tbsaunde@tbsaunde.org>
Fri, 14 Aug 2015 14:07:06 -0400
changeset 289012 6209bf0c49e594e8e5b857abb9043dd3ef172229
parent 289011 ccc605b24364c5e0803418883ed48e78d8f5a7c6
child 289013 87a060ffcaa819ed7a0d09fe3d51bcd178d8d8aa
push id5067
push userraliiev@mozilla.com
push dateMon, 21 Sep 2015 14:04:52 +0000
treeherdermozilla-beta@14221ffe5b2f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssurkov, sledru
bugs1189277
milestone42.0a2
bug 1189277 - Only coalesce reorder events when a previous one for the same target is obsolete. r=surkov, a=sledru Having one reorder event that superseeds another does not mean that the dependant mutation events for the first reorder are obsolete. So we if we coalesce a reorder event away we should leave its subordinate mutation events alone.
accessible/base/EventQueue.cpp
accessible/tests/mochitest/treeupdate/a11y.ini
accessible/tests/mochitest/treeupdate/test_bug1189277.html
--- a/accessible/base/EventQueue.cpp
+++ b/accessible/base/EventQueue.cpp
@@ -243,22 +243,17 @@ EventQueue::CoalesceReorderEvents(AccEve
     if (!thisEvent->mAccessible->IsDoc() &&
         !thisEvent->mAccessible->IsInDocument()) {
       thisEvent->mEventRule = AccEvent::eDoNotEmit;
       continue;
     }
 
     // Coalesce earlier event of the same target.
     if (thisEvent->mAccessible == aTailEvent->mAccessible) {
-      if (thisEvent->mEventRule == AccEvent::eDoNotEmit) {
-        AccReorderEvent* tailReorder = downcast_accEvent(aTailEvent);
-        tailReorder->DoNotEmitAll();
-      } else {
-        thisEvent->mEventRule = AccEvent::eDoNotEmit;
-      }
+      thisEvent->mEventRule = AccEvent::eDoNotEmit;
 
       return;
     }
 
     // If tailEvent contains thisEvent
     // then
     //   if show or hide of tailEvent contains a grand parent of thisEvent
     //   then ignore thisEvent and its show and hide events
--- a/accessible/tests/mochitest/treeupdate/a11y.ini
+++ b/accessible/tests/mochitest/treeupdate/a11y.ini
@@ -3,16 +3,17 @@
 [test_ariadialog.html]
 [test_bug852150.xhtml]
 [test_bug883708.xhtml]
 [test_bug884251.xhtml]
 [test_bug895082.html]
 [test_bug1040735.html]
 [test_bug1100602.html]
 [test_bug1175913.html]
+[test_bug1189277.html]
 [test_canvas.html]
 [test_colorpicker.xul]
 [test_contextmenu.xul]
 [test_cssoverflow.html]
 [test_deck.xul]
 [test_doc.html]
 [test_gencontent.html]
 [test_hidden.html]
new file mode 100644
--- /dev/null
+++ b/accessible/tests/mochitest/treeupdate/test_bug1189277.html
@@ -0,0 +1,85 @@
+<html>
+
+<head>
+  <title>Test hide/show events for HTMLListBulletAccessibles on list restyle</title>
+  <link rel="stylesheet" type="text/css"
+        href="chrome://mochikit/content/tests/SimpleTest/test.css" />
+
+  <script type="application/javascript"
+          src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
+
+  <script type="application/javascript"
+          src="../common.js"></script>
+  <script type="application/javascript"
+          src="../name.js"></script>
+  <script type="application/javascript"
+          src="../events.js"></script>
+
+  <script type="application/javascript">
+    function runTest()
+    {
+      this.containerNode = getNode("outerDiv");
+
+      this.eventSeq = [
+        new invokerChecker(EVENT_HIDE, getNode("child")),
+        new invokerChecker(EVENT_REORDER, this.containerNode),
+        new invokerChecker(EVENT_HIDE, getNode("childDoc")),
+        new invokerChecker(EVENT_SHOW, "newChildDoc")
+      ];
+
+      this.invoke = function runTest_invoke()
+      {
+        this.containerNode.removeChild(getNode("child"));
+
+        var docContainer = getNode("docContainer");
+        var iframe = document.createElement("iframe");
+        iframe.setAttribute("src", "http://example.com");
+        iframe.setAttribute("id", "newChildDoc");
+
+        docContainer.removeChild(getNode("childDoc"));
+        docContainer.appendChild(iframe);
+      }
+
+      this.getID = function runTest_getID()
+      {
+        return "check show events are not incorrectly coalesced";
+      }
+    }
+
+    gA11yEventDumpToConsole = true;
+    var gQueue = null;
+    function doTest()
+    {
+      gQueue = new eventQueue();
+      gQueue.push(new runTest());
+      gQueue.invoke(); // SimpleTest.finish();
+    }
+
+    SimpleTest.waitForExplicitFinish();
+    addA11yLoadEvent(doTest);
+  </script>
+
+</head>
+
+<body>
+
+  <a target="_blank"
+     href="https://bugzilla.mozilla.org/show_bug.cgi?id=1189277"
+     title="content process crash caused by missing show event">
+    Mozilla Bug 1189277
+  </a>
+  <p id="display"></p>
+  <div id="content" style="display: none"></div>
+  <pre id="test">
+  </pre>
+
+  <div id="outerDiv">
+    <div id="child">foo</div>
+    <div id="docContainer">
+      <iframe id="childDoc" src="about:blank">
+      </iframe>
+    </div>
+  </div>
+
+</body>
+</html>