commit | 376c84c4582bf324d4e7a6ec2eff49604a2ceb07 | [log] [tgz] |
---|---|---|
author | Nektarios Paisios <[email protected]> | Sat Nov 02 09:56:02 2019 |
committer | Commit Bot <[email protected]> | Sat Nov 02 09:56:02 2019 |
tree | 3c49ecdf2b59a85024521258e24b55246bb35cfb | |
parent | e4ff71817fbe8f986ffe0dbedbb6e6b1c6915e9c [diff] |
Ensures that text positions are at a grapheme boundary and not at a low 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. [email protected], [email protected] Change-Id: Iba12e0d214cd0d4a604597f9bb17a1a78992584f Bug: 720370 Change-Id: Iba12e0d214cd0d4a604597f9bb17a1a78992584f Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1796047 Reviewed-by: Nektarios Paisios <[email protected]> Reviewed-by: Kevin Babbitt <[email protected]> Reviewed-by: Kurt Catti-Schmidt <[email protected]> Commit-Queue: Nektarios Paisios <[email protected]> Cr-Commit-Position: refs/heads/master@{#711983}
Chromium is an open-source browser project that aims to build a safer, faster, and more stable way for all users to experience the web.
The project's web site is https://www.chromium.org.
Documentation in the source is rooted in docs/README.md.
Learn how to Get Around the Chromium Source Code Directory Structure .