• Lucas Radaelli's avatar
    [fuchsia][a11y] Accessibility Bridge forwards valid updates. · d952f8e9
    Lucas Radaelli authored
    This change refactors parts of the Accessibility Bridge to solve the
    following bugs: * Previously, it was deleting nodes that were marked as
    reparented or a subtree that was reparented. This assumed that nodes
    marked this way would appear in the list of updates sent by the
    AxTreeObserver in the final atomic update, but this assumption is not
    correct. This fixes the problem where parents were pointing to children
    no longer in the tree.
    
    * Allow trees of size 1 to be sent. Previously, the loop that dealt with
      sending updates started from the second item, which would not send
      anything if the tree had only one element.
    
    * Simplifies the order of updates: first deletions and then
      updates. Because atomic updates always finish with the list of nodes
      added / changed, we can use this property to simplify the code to
      always follow this order.
    
    Todos: There are some todos left in the code which I opted to follow-up
    in a future cl so that I can split work among people and parallelize.
    
    Test: AccessibilityBridgeTest.*
    Bug: 1134384,fuchsia:58989,fuchsia:50187,fuchsia:61155
    Change-Id: I6ec09a5d6fa5d5ad37fb42a059d0d0f122d39d97
    Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2446358
    Commit-Queue: Lucas Radaelli <lucasradaelli@google.com>
    Reviewed-by: default avatarSergey Ulanov <sergeyu@chromium.org>
    Reviewed-by: default avatarSharon Yang <yangsharon@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#815346}
    d952f8e9
accessibility_bridge.h 4.89 KB