commit | 0f0b880b548f7deb2c05e47f61f9881c3c0f51cd | [log] [tgz] |
---|---|---|
author | Alison Maher <almaher@microsoft.com> | Tue May 21 03:50:02 2019 |
committer | Commit Bot <commit-bot@chromium.org> | Tue May 21 03:50:02 2019 |
tree | f3f89b0ae7959b1f6fabd1840aa980270823b87b | |
parent | d257e720ba02396078fd479383d6d05d76a409e7 [diff] |
Fix MoveEndpointByUnit (TextUnit_Word/Line) degenerate range creation ITextRangeProvider::MoveEndpointByUnit for TextUnit_Word and TextUnit_Line will not create a degenerate range in certain cases when at the beginning or end of a document. The problem can be found in CreateNextWordStartPosition(), CreatePreviousWordEndPosition(), CreateNextWordStartPosition(), and CreatePreviousWordEndPosition(). The problem can be illustrated by the case below: Text ^ ^ start end When the above case is at the beginning of the document, and you try to create a degenerate range by moving end to the start, CreatePrevious[Word/Line]Position() will call CreatePreviousTextAnchorPosition(). This will return a null position because there is no previous text anchor. This causes CreatePrevious[Word/Line]Position() to think that end is at the beginning of the document, and as a result will leave end where it is. However, end is still at the end of the first anchor and not at the beginning of the document. This change fixes the above issue by checking the text offset to see if the position is truly at the beginning/end of the document, or if there is actually more text to traverse. This change is related to the bug fix found here: https://chromium-review.googlesource.com/c/chromium/src/+/1604407 Bug: 961884 Change-Id: I60b2baa56fe1437b66e12e1c0884631edfb77686 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1612255 Commit-Queue: Alison Maher <almaher@microsoft.com> Reviewed-by: Nektarios Paisios <nektar@chromium.org> Reviewed-by: Kurt Catti-Schmidt <kschmi@microsoft.com> Cr-Commit-Position: refs/heads/master@{#661607}
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 .