-
Notifications
You must be signed in to change notification settings - Fork 6.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Ensures that text positions are at a grapheme boundary and not at a l…
…ow surrogate pair This patch changes the way that CreateNext/PreviousCharacterPosition work so that they don't move by a single UTF16 code point but, similar to how the left / right cursor keys work, by a grapheme cluster. A grapheme cluster is what a person familiar with a particular language would call a single character. For example, it could include a UTF16 code point for a letter and more UTF16 code points for diacritics, or it could include a surrogate pair for characters outside the basic multilingual plain. This patch also disallows creating text positions that are not at a grapheme cluster boundary, so that text positions can never point in the middle of a character such as at a low surrogate pair. To avoid introducing performance regressions, this patch caches the inner text of the position's anchor node, after it has been retrieved for the first time. The break iterator is also cached. An upcoming patch will ensure that AXPositions are invalidated when the AXTree changes. This has always been the case, but the upcoming patch will ensure that this is captured and enforced in code too, especially now that AXPosition includes a handful of cached members. Furthermore, I took the opportunity to correct the copy constructors which cannot be defaulted since AXTreeID is non-copiable and improve the assignment operator using the copy and swap idiom. R=dmazzoni@chromium.org, kbabbitt@microsoft.com Change-Id: Iba12e0d214cd0d4a604597f9bb17a1a78992584f Bug: 720370 Change-Id: Iba12e0d214cd0d4a604597f9bb17a1a78992584f Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1796047 Reviewed-by: Nektarios Paisios <nektar@chromium.org> Reviewed-by: Kevin Babbitt <kbabbitt@microsoft.com> Reviewed-by: Kurt Catti-Schmidt <kschmi@microsoft.com> Commit-Queue: Nektarios Paisios <nektar@chromium.org> Cr-Commit-Position: refs/heads/master@{#711983}
- Loading branch information
Nektarios Paisios
authored and
Commit Bot
committed
Nov 2, 2019
1 parent
e4ff718
commit 376c84c
Showing
10 changed files
with
866 additions
and
260 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.