Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(82)

Issue 2914313002: Manage DOM and string offsets separately in TextIteratorTextState (Closed)

Created:
3 years, 6 months ago by Xiaocheng
Modified:
3 years, 6 months ago
Reviewers:
yosin_UTC9
CC:
blink-reviews, chromium-reviews
Target Ref:
refs/heads/master
Project:
chromium
Visibility:
Public.

Description

Manage DOM and string offsets separately in TextIteratorTextState TextIteratorTextState stores only one offset range as both DOM offset and string offset, which is incorrect (e.g., when with text-transform). This patch changes TextIteratorTextState to store DOM and string offsets separately, so that the above issue no longer exist in the class (it still widely exists in many other components, though). This patch also makes it possible to stop using LayoutText in the class, so that TextIteratorTextState can also work with Layout NG. Note: The class originally has a member |text_start_offet_| as a hack when there is :first-letter, which is removed by the patch. A new member for string offset is added back, which has the same name by pure coincidence. BUG=721957 TEST=n/a; no behavioral change Review-Url: https://codereview.chromium.org/2914313002 Cr-Commit-Position: refs/heads/master@{#476759} Committed: https://chromium.googlesource.com/chromium/src/+/b31e3ce881bd72c860c563cbcf74ff16e3bfbe84

Patch Set 1 #

Patch Set 2 : Thu Jun 1 18:08:24 PDT 2017 #

Total comments: 2

Patch Set 3 : Fri Jun 2 10:34:55 PDT 2017 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+33 lines, -36 lines) Patch
M third_party/WebKit/Source/core/editing/iterators/TextIterator.cpp View 2 chunks +2 lines, -2 lines 0 comments Download
M third_party/WebKit/Source/core/editing/iterators/TextIteratorTextNodeHandler.cpp View 1 chunk +1 line, -1 line 0 comments Download
M third_party/WebKit/Source/core/editing/iterators/TextIteratorTextState.h View 1 2 3 chunks +14 lines, -13 lines 0 comments Download
M third_party/WebKit/Source/core/editing/iterators/TextIteratorTextState.cpp View 7 chunks +16 lines, -20 lines 0 comments Download

Dependent Patchsets:

Messages

Total messages: 24 (19 generated)
Xiaocheng
PTAL.
3 years, 6 months ago (2017-06-02 05:25:03 UTC) #13
yosin_UTC9
lgtm w/ nits https://codereview.chromium.org/2914313002/diff/20001/third_party/WebKit/Source/core/editing/iterators/TextIteratorTextState.h File third_party/WebKit/Source/core/editing/iterators/TextIteratorTextState.h (right): https://codereview.chromium.org/2914313002/diff/20001/third_party/WebKit/Source/core/editing/iterators/TextIteratorTextState.h#newcode96 third_party/WebKit/Source/core/editing/iterators/TextIteratorTextState.h:96: int text_start_offset_; nit: It is better ...
3 years, 6 months ago (2017-06-02 08:38:57 UTC) #16
Xiaocheng
Thanks for reviewing! https://codereview.chromium.org/2914313002/diff/20001/third_party/WebKit/Source/core/editing/iterators/TextIteratorTextState.h File third_party/WebKit/Source/core/editing/iterators/TextIteratorTextState.h (right): https://codereview.chromium.org/2914313002/diff/20001/third_party/WebKit/Source/core/editing/iterators/TextIteratorTextState.h#newcode96 third_party/WebKit/Source/core/editing/iterators/TextIteratorTextState.h:96: int text_start_offset_; On 2017/06/02 at 08:38:56, ...
3 years, 6 months ago (2017-06-02 17:35:38 UTC) #19
commit-bot: I haz the power
CQ is trying da patch. Follow status at: https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2914313002/40001
3 years, 6 months ago (2017-06-02 17:35:42 UTC) #20
commit-bot: I haz the power
3 years, 6 months ago (2017-06-02 19:46:08 UTC) #24
Message was sent while issue was closed.
Committed patchset #3 (id:40001) as
https://chromium.googlesource.com/chromium/src/+/b31e3ce881bd72c860c563cbcf74...

Powered by Google App Engine
This is Rietveld 408576698