Bug 1260187 - remove recaching version of DocAccessible::UpdateTreeOnInsertion, r=yzen
authorAlexander Surkov <surkov.alexander@gmail.com>
Thu, 31 Mar 2016 20:46:45 -0400
changeset 291163 7a2b0755a6bacd831ea28e0bc3499a11a0acac63
parent 291162 e8c2eecfac918a8e0c0e8f9e0bb396d7d1502948
child 291164 18963f8a2c46048c8c45f330799af71b118e34c6
push id19656
push usergwagner@mozilla.com
push dateMon, 04 Apr 2016 13:43:23 +0000
treeherderb2g-inbound@e99061fde28a [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersyzen
bugs1260187
milestone48.0a1
Bug 1260187 - remove recaching version of DocAccessible::UpdateTreeOnInsertion, r=yzen
accessible/generic/DocAccessible.cpp
accessible/generic/DocAccessible.h
--- a/accessible/generic/DocAccessible.cpp
+++ b/accessible/generic/DocAccessible.cpp
@@ -1874,74 +1874,16 @@ DocAccessible::FireEventsOnInsertion(Acc
     while ((ancestor = ancestor->Parent()));
   }
 
   MaybeNotifyOfValueChange(aContainer);
   FireDelayedEvent(aReorderEvent);
 }
 
 void
-DocAccessible::UpdateTreeOnInsertion(Accessible* aContainer)
-{
-  for (uint32_t idx = 0; idx < aContainer->ContentChildCount(); idx++) {
-    Accessible* child = aContainer->ContentChildAt(idx);
-    child->SetSurvivingInUpdate(true);
-   }
-
-  AutoTreeMutation mut(aContainer);
-  aContainer->InvalidateChildren();
-  aContainer->EnsureChildren();
-
-  RefPtr<AccReorderEvent> reorderEvent = new AccReorderEvent(aContainer);
-
-  uint32_t updateFlags = eNoAccessible;
-  for (uint32_t idx = 0; idx < aContainer->ContentChildCount(); idx++) {
-    Accessible* child = aContainer->ContentChildAt(idx);
-    if (child->IsSurvivingInUpdate()) {
-      child->SetSurvivingInUpdate(false);
-      continue;
-    }
-
-    // A new child has been created, update its tree.
-#ifdef A11Y_LOG
-    if (logging::IsEnabled(logging::eTree)) {
-      logging::MsgBegin("TREE", "process content insertion");
-      logging::Node("container", aContainer->GetNode());
-      logging::Node("child", child->GetContent());
-      logging::Address("child", child);
-      logging::MsgEnd();
-    }
-#endif
-
-    updateFlags |= UpdateTreeInternal(child, true, reorderEvent);
-  }
-
-  // Content insertion/removal is not cause of accessible tree change.
-  if (updateFlags == eNoAccessible)
-    return;
-
-  // Check to see if change occurred inside an alert, and fire an EVENT_ALERT
-  // if it did.
-  if (!(updateFlags & eAlertAccessible) &&
-      (aContainer->IsAlert() || aContainer->IsInsideAlert())) {
-    Accessible* ancestor = aContainer;
-    do {
-      if (ancestor->IsAlert()) {
-        FireDelayedEvent(nsIAccessibleEvent::EVENT_ALERT, ancestor);
-        break;
-      }
-    }
-    while ((ancestor = ancestor->Parent()));
-  }
-
-  MaybeNotifyOfValueChange(aContainer);
-  FireDelayedEvent(reorderEvent);
-}
-
-void
 DocAccessible::UpdateTreeOnRemoval(Accessible* aContainer, nsIContent* aChildNode)
 {
   // If child node is not accessible then look for its accessible children.
   Accessible* child = GetAccessible(aChildNode);
 #ifdef A11Y_LOG
   if (logging::IsEnabled(logging::eTree)) {
     logging::MsgBegin("TREE", "process content removal");
     logging::Node("container", aContainer->GetNode());
--- a/accessible/generic/DocAccessible.h
+++ b/accessible/generic/DocAccessible.h
@@ -492,21 +492,16 @@ protected:
    *
    * While children are cached we may encounter the case there's no accessible
    * for referred content by related accessible. Store these related nodes to
    * invalidate their containers later.
    */
   void ProcessInvalidationList();
 
   /**
-   * Update the tree on content insertion.
-   */
-  void UpdateTreeOnInsertion(Accessible* aContainer);
-
-  /**
    * Update the accessible tree for content removal.
    */
   void UpdateTreeOnRemoval(Accessible* aContainer, nsIContent* aChildNode);
 
   /**
    * Helper for UpdateTreeOn methods. Go down to DOM subtree and updates
    * accessible tree. Return one of these flags.
    */