Fix crash caused by invalid position in windows TextRangeProvider
Users of Narrator experience a consistent crash caused by an endpoint in AXPlatformNodeTextRangeProvider being on a position that isn't null but had no associated anchor. This position is likely a product of the implementation of TextRangeEndpoints::OnNodeWillBeDeleted, where we move the position to its parent that might have been deleted previously. The crash was caused by an observer not being removed. It was not removed because of the use of !IsNullPosition(), in which we return true if GetAnchor() returns a nullptr. Eventually, when bug:1152939 is fixed at the source, it will be safe to go back with IsNullPosition(). Bug: 1152939 Change-Id: I633d403d8182adca807fde61563a343ce7ee78e4 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2561648 Commit-Queue: Benjamin Beaudry <benjamin.beaudry@microsoft.com> Reviewed-by:Daniel Libby <dlibby@microsoft.com> Reviewed-by:
Ian Prest <iapres@microsoft.com> Cr-Commit-Position: refs/heads/master@{#831993}
Showing
Please register or sign in to comment