Backed out changeset 067d47e20a94 (bug 1572811) for causing failures in CharacterData.cpp CLOSED TREE
authorNoemi Erli <nerli@mozilla.com>
Thu, 15 Aug 2019 20:30:45 +0300
changeset 488290 7f41e2dd2f998cbb4f533a8fec9046e7b8aeb147
parent 488289 8b8878633443587a44118fad8f247c6b9cd6adb9
child 488291 43d96432677f15bb68ebc9edebdcf83ec59be7ec
push id113906
push userncsoregi@mozilla.com
push dateFri, 16 Aug 2019 04:07:24 +0000
treeherdermozilla-inbound@d887276421d3 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1572811
milestone70.0a1
backs out067d47e20a9439ad81d0b119b1b660c9638ff08e
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
Backed out changeset 067d47e20a94 (bug 1572811) for causing failures in CharacterData.cpp CLOSED TREE
accessible/generic/DocAccessible.cpp
--- a/accessible/generic/DocAccessible.cpp
+++ b/accessible/generic/DocAccessible.cpp
@@ -668,20 +668,30 @@ void DocAccessible::AttributeWillChange(
     return;
   }
 
   if (aAttribute == nsGkAtoms::aria_disabled ||
       aAttribute == nsGkAtoms::disabled)
     mStateBitWasOn = accessible->Unavailable();
 }
 
-// We don't use this for insertions or removals because the frame tree
-// may be in a transitional state.
 void DocAccessible::NativeAnonymousChildListChange(nsIContent* aContent,
-                                                   bool aIsRemove) {}
+                                                   bool aIsRemove) {
+  if (aIsRemove) {
+#ifdef A11Y_LOG
+    if (logging::IsEnabled(logging::eTree)) {
+      logging::MsgBegin("TREE", "Anonymous content removed; doc: %p", this);
+      logging::Node("node", aContent);
+      logging::MsgEnd();
+    }
+#endif
+
+    ContentRemoved(aContent);
+  }
+}
 
 void DocAccessible::AttributeChanged(dom::Element* aElement,
                                      int32_t aNameSpaceID, nsAtom* aAttribute,
                                      int32_t aModType,
                                      const nsAttrValue* aOldValue) {
   NS_ASSERTION(!IsDefunct(),
                "Attribute changed called on defunct document accessible!");
 
@@ -1319,32 +1329,16 @@ bool DocAccessible::PruneOrInsertSubtree
     }
 
     // It is a broken image that is being reframed because it either got
     // or lost an `alt` tag that would rerender this node as text.
     if (frame && (acc->IsImage() != (frame->AccessibleType() == eImageType))) {
       ContentRemoved(aRoot);
       return true;
     }
-
-    // Content may have, or may previously have had, anonymous items
-    // that were removed during frame reconstruction. We check here
-    // for any dangling anonymous content and remove their accessibles.
-    if (aRoot->MayHaveAnonymousChildren()) {
-      auto child = acc->FirstChild();
-      while (child) {
-        auto nextChild = child->NextSibling();
-        auto childContent = child->GetContent();
-        if (childContent && childContent->IsInAnonymousSubtree() &&
-            !childContent->GetPrimaryFrame()) {
-          ContentRemoved(child);
-        }
-        child = nextChild;
-      }
-    }
   } else {
     // If there is no current accessible, and the node has a frame, or is
     // display:contents, schedule it for insertion.
     if (aRoot->GetPrimaryFrame() || nsCoreUtils::IsDisplayContents(aRoot)) {
       // This may be a new subtree, the insertion process will recurse through
       // its descendants.
       if (!GetAccessibleOrDescendant(aRoot)) {
         return true;