• Dominic Mazzoni's avatar
    Reland: Fix issue with accessibility events on hidden nodes · 96826da4
    Dominic Mazzoni authored
    Original CL: http://crrev.com/c/2134848
    Revert: http://crrev.com/c/2138415
    
    Landed at the same time as another change that affected test
    expectations, just needed to be rebaselined and landed again.
    
    This is an issue with AXObjects that are ignored and not
    included in the accessibility tree. When we fire an event
    on such a node, the serializer owned by
    RenderAccessibilityImpl first walks up to find a common
    ancestor that is in the tree, and then serializes that
    node, even if it was already serialized. It breaks the
    mechanism that avoids re-serializing nodes that were
    already just serialized.
    
    In extreme circumstances, this led to a bug where the
    size of the AXTreeUpdate for a large table grew to 200MB
    for one particular website, even though the resulting
    AXTree had only around 2MB worth of data.
    
    The fix is simple: when a node changes, only fire a
    notification on the nearest ancestor that's in the tree.
    That way the serializer can avoid redundantly processing
    the same node more than once.
    
    Covered by a new test and a DCHECK that asserts that we
    should never get an AXTreeUpdate with more nodes than the
    size of the resulting tree. Without the new fix, the test
    fails with an AXTreeUpdate containing 1000 nodes with a
    tree of size 10.
    
    Bug: 1066880
    Tbr: Adam Ettenberger <Adam.Ettenberger@microsoft.com>
    Tbr: Aaron Leventhal <aleventhal@chromium.org>
    Relnotes: N/A
    Change-Id: I485e8d98d8fe9638706e26ceff642664a3fa6e3e
    Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2140033Reviewed-by: default avatarDominic Mazzoni <dmazzoni@chromium.org>
    Reviewed-by: default avatarAdam Ettenberger <Adam.Ettenberger@microsoft.com>
    Commit-Queue: Dominic Mazzoni <dmazzoni@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#757221}
    96826da4
dump_accessibility_tree_browsertest.cc 83 KB