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

Issue 2913673004: Change how iteration range is passed to TextIteratorTextNodeHandler (Closed)

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

Description

Change how iteration range is passed to TextIteratorTextNodeHandler TextIteratorTextNodeHandler used to store the full iteration range, and have comparisons between |text_node_| and |start/end_container_| scattered in the class to decide the offset range on |text_node_| from which text should be emitted. This patch changes it that: - TextIterator, when calling HandleTextNode(), compares the current text node with the start and end containers to decide the offset range on it, and pass the offset range to TextNodeHandler - TextNodeHandler no longer stores the full iteration, but only the offset range passed from TextIterator. - TextNodeHandler no longer decides the offset range by itself, but uses the passed-in offset range directly. BUG=721957 TEST=n/a; no behavioral change Review-Url: https://codereview.chromium.org/2913673004 Cr-Commit-Position: refs/heads/master@{#476336} Committed: https://chromium.googlesource.com/chromium/src/+/3c26208e98b83e8c698a213e63a0ac3e5f1e3b42

Patch Set 1 #

Total comments: 12

Patch Set 2 : Pass the offset range in the verbose way #

Patch Set 3 : Rebased #

Patch Set 4 : Wed May 31 12:57:22 PDT 2017 #

Total comments: 6

Patch Set 5 : Wed May 31 20:34:43 PDT 2017 #

Patch Set 6 : Wed May 31 21:59:32 PDT 2017 #

Total comments: 1

Patch Set 7 : Thu Jun 1 08:33:52 PDT 2017 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+62 lines, -50 lines) Patch
M third_party/WebKit/Source/core/editing/iterators/TextIterator.cpp View 1 2 3 4 2 chunks +17 lines, -5 lines 0 comments Download
M third_party/WebKit/Source/core/editing/iterators/TextIteratorTextNodeHandler.h View 1 2 3 4 3 chunks +9 lines, -17 lines 0 comments Download
M third_party/WebKit/Source/core/editing/iterators/TextIteratorTextNodeHandler.cpp View 1 2 3 4 5 6 7 chunks +36 lines, -28 lines 0 comments Download

Dependent Patchsets:

Messages

Total messages: 61 (36 generated)
Xiaocheng
PTAL.
3 years, 6 months ago (2017-05-31 01:27:35 UTC) #5
yosin_UTC9
https://codereview.chromium.org/2913673004/diff/1/third_party/WebKit/Source/core/editing/iterators/TextIteratorTextNodeHandler.h File third_party/WebKit/Source/core/editing/iterators/TextIteratorTextNodeHandler.h (right): https://codereview.chromium.org/2913673004/diff/1/third_party/WebKit/Source/core/editing/iterators/TextIteratorTextNodeHandler.h#newcode44 third_party/WebKit/Source/core/editing/iterators/TextIteratorTextNodeHandler.h:44: bool HandleTextNode(Text*, It is nice that s/Text*/const Text&/ in ...
3 years, 6 months ago (2017-05-31 03:47:52 UTC) #10
yosin_UTC9
https://codereview.chromium.org/2913673004/diff/1/third_party/WebKit/Source/core/editing/iterators/TextIteratorTextNodeHandler.h File third_party/WebKit/Source/core/editing/iterators/TextIteratorTextNodeHandler.h (right): https://codereview.chromium.org/2913673004/diff/1/third_party/WebKit/Source/core/editing/iterators/TextIteratorTextNodeHandler.h#newcode45 third_party/WebKit/Source/core/editing/iterators/TextIteratorTextNodeHandler.h:45: const int* opt_start_offset, On 2017/05/31 at 03:47:52, yosin_UTC9 wrote: ...
3 years, 6 months ago (2017-05-31 03:49:21 UTC) #11
Xiaocheng
https://codereview.chromium.org/2913673004/diff/1/third_party/WebKit/Source/core/editing/iterators/TextIteratorTextNodeHandler.h File third_party/WebKit/Source/core/editing/iterators/TextIteratorTextNodeHandler.h (right): https://codereview.chromium.org/2913673004/diff/1/third_party/WebKit/Source/core/editing/iterators/TextIteratorTextNodeHandler.h#newcode44 third_party/WebKit/Source/core/editing/iterators/TextIteratorTextNodeHandler.h:44: bool HandleTextNode(Text*, On 2017/05/31 at 03:47:52, yosin_UTC9 wrote: > ...
3 years, 6 months ago (2017-05-31 04:03:45 UTC) #12
yosin_UTC9
https://codereview.chromium.org/2913673004/diff/1/third_party/WebKit/Source/core/editing/iterators/TextIteratorTextNodeHandler.h File third_party/WebKit/Source/core/editing/iterators/TextIteratorTextNodeHandler.h (right): https://codereview.chromium.org/2913673004/diff/1/third_party/WebKit/Source/core/editing/iterators/TextIteratorTextNodeHandler.h#newcode45 third_party/WebKit/Source/core/editing/iterators/TextIteratorTextNodeHandler.h:45: const int* opt_start_offset, On 2017/05/31 at 04:03:44, Xiaocheng wrote: ...
3 years, 6 months ago (2017-05-31 05:29:53 UTC) #13
Xiaocheng
https://codereview.chromium.org/2913673004/diff/1/third_party/WebKit/Source/core/editing/iterators/TextIteratorTextNodeHandler.h File third_party/WebKit/Source/core/editing/iterators/TextIteratorTextNodeHandler.h (right): https://codereview.chromium.org/2913673004/diff/1/third_party/WebKit/Source/core/editing/iterators/TextIteratorTextNodeHandler.h#newcode45 third_party/WebKit/Source/core/editing/iterators/TextIteratorTextNodeHandler.h:45: const int* opt_start_offset, On 2017/05/31 at 05:29:52, yosin_UTC9 wrote: ...
3 years, 6 months ago (2017-05-31 05:35:33 UTC) #14
yoichio
https://codereview.chromium.org/2913673004/diff/1/third_party/WebKit/Source/core/editing/iterators/TextIteratorTextNodeHandler.cpp File third_party/WebKit/Source/core/editing/iterators/TextIteratorTextNodeHandler.cpp (right): https://codereview.chromium.org/2913673004/diff/1/third_party/WebKit/Source/core/editing/iterators/TextIteratorTextNodeHandler.cpp#newcode129 third_party/WebKit/Source/core/editing/iterators/TextIteratorTextNodeHandler.cpp:129: : static_cast<int>(layout_object->TextStartOffset() + str.length()); Why don't you calculate them ...
3 years, 6 months ago (2017-05-31 05:36:42 UTC) #15
yosin_UTC9
https://codereview.chromium.org/2913673004/diff/1/third_party/WebKit/Source/core/editing/iterators/TextIteratorTextNodeHandler.h File third_party/WebKit/Source/core/editing/iterators/TextIteratorTextNodeHandler.h (right): https://codereview.chromium.org/2913673004/diff/1/third_party/WebKit/Source/core/editing/iterators/TextIteratorTextNodeHandler.h#newcode45 third_party/WebKit/Source/core/editing/iterators/TextIteratorTextNodeHandler.h:45: const int* opt_start_offset, On 2017/05/31 at 05:29:52, yosin_UTC9 wrote: ...
3 years, 6 months ago (2017-05-31 05:41:31 UTC) #16
Xiaocheng
https://codereview.chromium.org/2913673004/diff/1/third_party/WebKit/Source/core/editing/iterators/TextIteratorTextNodeHandler.cpp File third_party/WebKit/Source/core/editing/iterators/TextIteratorTextNodeHandler.cpp (right): https://codereview.chromium.org/2913673004/diff/1/third_party/WebKit/Source/core/editing/iterators/TextIteratorTextNodeHandler.cpp#newcode129 third_party/WebKit/Source/core/editing/iterators/TextIteratorTextNodeHandler.cpp:129: : static_cast<int>(layout_object->TextStartOffset() + str.length()); On 2017/05/31 at 05:36:42, yoichio ...
3 years, 6 months ago (2017-05-31 05:44:27 UTC) #17
yoichio
https://codereview.chromium.org/2913673004/diff/1/third_party/WebKit/Source/core/editing/iterators/TextIterator.cpp File third_party/WebKit/Source/core/editing/iterators/TextIterator.cpp (right): https://codereview.chromium.org/2913673004/diff/1/third_party/WebKit/Source/core/editing/iterators/TextIterator.cpp#newcode479 third_party/WebKit/Source/core/editing/iterators/TextIterator.cpp:479: ToText(node_), node_ == start_container_ ? &start_offset_ : nullptr, I ...
3 years, 6 months ago (2017-05-31 05:59:15 UTC) #18
yoichio
On 2017/05/31 05:59:15, yoichio wrote: > https://codereview.chromium.org/2913673004/diff/1/third_party/WebKit/Source/core/editing/iterators/TextIterator.cpp > File third_party/WebKit/Source/core/editing/iterators/TextIterator.cpp (right): > > https://codereview.chromium.org/2913673004/diff/1/third_party/WebKit/Source/core/editing/iterators/TextIterator.cpp#newcode479 > ...
3 years, 6 months ago (2017-05-31 06:03:24 UTC) #19
yosin_UTC9
https://codereview.chromium.org/2913673004/diff/1/third_party/WebKit/Source/core/editing/iterators/TextIterator.cpp File third_party/WebKit/Source/core/editing/iterators/TextIterator.cpp (right): https://codereview.chromium.org/2913673004/diff/1/third_party/WebKit/Source/core/editing/iterators/TextIterator.cpp#newcode479 third_party/WebKit/Source/core/editing/iterators/TextIterator.cpp:479: ToText(node_), node_ == start_container_ ? &start_offset_ : nullptr, On ...
3 years, 6 months ago (2017-05-31 06:21:18 UTC) #20
Xiaocheng
On 2017/05/31 at 06:21:18, yosin wrote: > https://codereview.chromium.org/2913673004/diff/1/third_party/WebKit/Source/core/editing/iterators/TextIterator.cpp > File third_party/WebKit/Source/core/editing/iterators/TextIterator.cpp (right): > > https://codereview.chromium.org/2913673004/diff/1/third_party/WebKit/Source/core/editing/iterators/TextIterator.cpp#newcode479 ...
3 years, 6 months ago (2017-05-31 06:40:55 UTC) #21
Xiaocheng
Updated. PTAL.
3 years, 6 months ago (2017-05-31 21:55:11 UTC) #32
yosin_UTC9
lgtm w/ nits https://codereview.chromium.org/2913673004/diff/60001/third_party/WebKit/Source/core/editing/iterators/TextIterator.cpp File third_party/WebKit/Source/core/editing/iterators/TextIterator.cpp (right): https://codereview.chromium.org/2913673004/diff/60001/third_party/WebKit/Source/core/editing/iterators/TextIterator.cpp#newcode488 third_party/WebKit/Source/core/editing/iterators/TextIterator.cpp:488: if (node_ != start_container_ && node_ ...
3 years, 6 months ago (2017-06-01 01:24:22 UTC) #39
Xiaocheng
Thanks for reviewing! Committing with updated patch. https://codereview.chromium.org/2913673004/diff/60001/third_party/WebKit/Source/core/editing/iterators/TextIterator.cpp File third_party/WebKit/Source/core/editing/iterators/TextIterator.cpp (right): https://codereview.chromium.org/2913673004/diff/60001/third_party/WebKit/Source/core/editing/iterators/TextIterator.cpp#newcode488 third_party/WebKit/Source/core/editing/iterators/TextIterator.cpp:488: if (node_ ...
3 years, 6 months ago (2017-06-01 04:01:39 UTC) #41
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/2913673004/80001
3 years, 6 months ago (2017-06-01 04:01:53 UTC) #43
commit-bot: I haz the power
Try jobs failed on following builders: linux_chromium_chromeos_ozone_rel_ng on master.tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_chromeos_ozone_rel_ng/builds/397605)
3 years, 6 months ago (2017-06-01 04:36:38 UTC) #45
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/2913673004/100001
3 years, 6 months ago (2017-06-01 05:00:48 UTC) #48
commit-bot: I haz the power
Try jobs failed on following builders: win_chromium_rel_ng on master.tryserver.chromium.win (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.win/builders/win_chromium_rel_ng/builds/458806)
3 years, 6 months ago (2017-06-01 06:54:48 UTC) #50
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/2913673004/100001
3 years, 6 months ago (2017-06-01 07:25:06 UTC) #52
commit-bot: I haz the power
Try jobs failed on following builders: linux_chromium_rel_ng on master.tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_rel_ng/builds/469413)
3 years, 6 months ago (2017-06-01 09:14:21 UTC) #54
Xiaocheng
https://codereview.chromium.org/2913673004/diff/100001/third_party/WebKit/Source/core/editing/iterators/TextIteratorTextNodeHandler.cpp File third_party/WebKit/Source/core/editing/iterators/TextIteratorTextNodeHandler.cpp (right): https://codereview.chromium.org/2913673004/diff/100001/third_party/WebKit/Source/core/editing/iterators/TextIteratorTextNodeHandler.cpp#newcode123 third_party/WebKit/Source/core/editing/iterators/TextIteratorTextNodeHandler.cpp:123: DCHECK_LE(end_offset, static_cast<int>(node->data().length())); Unfortunately we can't even have this check... ...
3 years, 6 months ago (2017-06-01 15:24:47 UTC) #55
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/2913673004/120001
3 years, 6 months ago (2017-06-01 15:35:12 UTC) #58
commit-bot: I haz the power
3 years, 6 months ago (2017-06-01 17:20:16 UTC) #61
Message was sent while issue was closed.
Committed patchset #7 (id:120001) as
https://chromium.googlesource.com/chromium/src/+/3c26208e98b83e8c698a213e63a0...

Powered by Google App Engine
This is Rietveld 408576698