• Benjamin Beaudry's avatar
    Make AXPlatformNodeTextRangeProviderWin keep its positions valid. · eef7f43d
    Benjamin Beaudry authored
    This change makes the AXPlatformNodeTextRangeProviderWin endpoints
    helper class a tree observer, allowing it to keep its stored |start_|
    and |end_| position valid.
    
    By observing the trees that the |start_| and |end_| position are in,
    the AXPlatformNodeTextRangeProviderWin::TextRangeEndpoints can adjust
    its endpoints if the node they are on is deleted. When this is the case,
    the position is then moved to the parent node.
    
    Known issue:
    In some cases, a node can get deleted alongside its parent. When this is
    the case, moving the position to its parent wouldn't solve the issue of
    the invalid position as the parent, itself deleted, wouldn't be a
    valid anchor. I have not observed this issue in practice, but I think it
    could be a good idea to keep that in mind.
    
    Change-Id: Ib0fd7bef9040b8744a0b1e0d7ea2d6b58c7477d8
    Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2432805
    Commit-Queue: Benjamin Beaudry <benjamin.beaudry@microsoft.com>
    Reviewed-by: default avatarDominic Mazzoni <dmazzoni@chromium.org>
    Reviewed-by: default avatarKurt Catti-Schmidt <kschmi@microsoft.com>
    Reviewed-by: default avatarJacques Newman <janewman@microsoft.com>
    Cr-Commit-Position: refs/heads/master@{#815656}
    eef7f43d
browser_accessibility_manager.cc 58.8 KB