[Editing] Fix perf regression from r814053
Before r814053, VisiblePosition::Create had a fast path for positions with downstream affinity, always returning the backward canonical position with downstream affinity. But since r814053, that case chooses between the backward canonical position with downstream affinity and the forward canonical position. The code calls InSameLine() in order to decide, but this is slow. So it caused a perf regression in modify-selection.html This patch adds back a fast path for downstream affinity in case the backward and forward canonical positions are equal, which is usual. This fixes the perf regression in modify-selection.html Bug: 1135577 Change-Id: Icb07c25efe8d21c04eb3659292c880af258cf97e Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2453291Reviewed-by:Xiaocheng Hu <xiaochengh@chromium.org> Commit-Queue: Oriol Brufau <obrufau@igalia.com> Cr-Commit-Position: refs/heads/master@{#815212}
Showing
Please register or sign in to comment