Make TextOffsetMapping not cross text control boundaries
This patch solves the issue of crossing text control boundaries when
using TextOffsetMapping. The changes include:
1. Change TextOffsetMapping::FindForward/BackwardInlineContents() not to
cross text control boundaries:
- If the initial position is in text control, keep traversal inside
the text control
- If the initial position is outside text control, all descendants of
text control elements are skipped
2. Change flat tree TextIterator to respect the EntersTextControls flag,
so that it doesn't dump the internal text of text controls elements
to TextOffsetMapping, so that TextOffsetMapping won't give a result
boundary inside text control.
Many test cases are also added to TextIterator, TextOffsetMapping and
word/sentence boundary algorithms.
Bug: 901492
Change-Id: I61aa3d3679eb77b975b50fd52dc8f79e049d8e47
Reviewed-on: https://chromium-review.googlesource.com/c/1327962
Commit-Queue: Xiaocheng Hu <xiaochengh@chromium.org>
Reviewed-by:
Kent Tamura <tkent@chromium.org>
Reviewed-by:
Yoichi Osato <yoichio@chromium.org>
Reviewed-by:
Yoshifumi Inoue <yosin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#607787}
Showing
Please register or sign in to comment