Low-hanging optimization for AXPosition navigation
|LowestCommonAnchor| is always cheaper than |LowestCommonAncestor| when the ancestor position data is not needed. I made some low-hanging optimizations to AXPosition after adding |CreateAncestorPosition|, since in many cases the position was being discarded after calling |LowestCommonAncestor|. Note that |LowestCommonAncestor| is equivalent to calling |CreateAncestorPosition| with the result of |LowestCommonAnchor|, so this is an improvement whenever |LowestCommonAnchor| is not the same as the anchor of the initial position. In any other case, there will be no difference in performance. The methods that took this optimization are : * CreateNextWordStartPosition * CreatePreviousWordStartPosition * CreateNextWordEndPosition * CreatePreviousWordEndPosition * CreatePreviousFormatStartPosition * CreateNextFormatEndPosition * CreateBoundaryStartPosition * CreateBoundaryEndPosition Bug: 928948 Change-Id: Ie25f5dfb293c604e0c34f348d276edac14d35ad3 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1814670 Commit-Queue: Adam Ettenberger <adettenb@microsoft.com> Reviewed-by:Nektarios Paisios <nektar@chromium.org> Reviewed-by:
Kurt Catti-Schmidt <kschmi@microsoft.com> Cr-Commit-Position: refs/heads/master@{#699468}
Showing
Please register or sign in to comment