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

Issue 2131103002: Ensure that TextIterator::m_pastEndNode is not skipped in advance() (Closed)

Created:
4 years, 5 months ago by Xiaocheng
Modified:
4 years, 4 months ago
Reviewers:
yosin_UTC9
CC:
blink-reviews, chromium-reviews
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Ensure that TextIterator::m_pastEndNode is not skipped in advance() In the current implemetation of |TextIterator::advance()|, when facing a node that is neither a shadow root nor a laid-out node, the node and its entire subtree are directly skipped, which is incorrect if the ending position is in the subtree. This CL fixes the issue by setting |m_pastEndNode| as the first non-skippable node after the ending position. It also ensures that |m_pastEndNode| is only used for checking loop ending condition, and replaces the other usage with an equivalent implementation. BUG=630921 TEST=webkit_unit_tests --gtest_filter=TextIteratorTest.EndingConditionWithDisplayNone* Committed: https://crrev.com/32dad58c08112ed4a04505675aca27d37d2ce755 Cr-Commit-Position: refs/heads/master@{#408071}

Patch Set 1 #

Total comments: 2

Patch Set 2 : Make sure m_pastEndNode is not skipped #

Total comments: 10

Patch Set 3 : comments addressed #

Total comments: 6

Patch Set 4 : Check offsetInCharacters #

Total comments: 2

Patch Set 5 : revise unit test #

Unified diffs Side-by-side diffs Delta from patch set Stats (+53 lines, -9 lines) Patch
M third_party/WebKit/Source/core/editing/iterators/TextIterator.h View 1 2 1 chunk +3 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/core/editing/iterators/TextIterator.cpp View 1 2 3 3 chunks +23 lines, -9 lines 0 comments Download
M third_party/WebKit/Source/core/editing/iterators/TextIteratorTest.cpp View 1 2 3 4 1 chunk +27 lines, -0 lines 0 comments Download

Messages

Total messages: 34 (21 generated)
Xiaocheng
PTAL. I hope the extra check is not going to introduce performance regression. Btw, SimplifiedBackwardsTextIterator ...
4 years, 5 months ago (2016-07-08 04:32:22 UTC) #2
yosin_UTC9
https://codereview.chromium.org/2131103002/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/2131103002/diff/1/third_party/WebKit/Source/core/editing/iterators/TextIterator.cpp#newcode287 third_party/WebKit/Source/core/editing/iterators/TextIterator.cpp:287: return; Discuss off line. Summary: - return in else-clause ...
4 years, 5 months ago (2016-07-08 05:33:18 UTC) #3
Xiaocheng
PTAL at patch 2, whose idea is to set |m_pastEndNode| to the first past-end node ...
4 years, 5 months ago (2016-07-25 13:29:47 UTC) #10
yosin_UTC9
https://codereview.chromium.org/2131103002/diff/20001/third_party/WebKit/Source/core/editing/iterators/TextIterator.cpp File third_party/WebKit/Source/core/editing/iterators/TextIterator.cpp (right): https://codereview.chromium.org/2131103002/diff/20001/third_party/WebKit/Source/core/editing/iterators/TextIterator.cpp#newcode89 third_party/WebKit/Source/core/editing/iterators/TextIterator.cpp:89: return (node.layoutObject() || (node.isShadowRoot() && node.shadowHost()->layoutObject())); nit: We don't ...
4 years, 5 months ago (2016-07-26 02:04:12 UTC) #11
Xiaocheng
Thanks for the review. An updated patch will be uploaded after the landing of crrev.com/2178243002 ...
4 years, 4 months ago (2016-07-26 04:34:41 UTC) #12
yosin_UTC9
https://codereview.chromium.org/2131103002/diff/40001/third_party/WebKit/Source/core/editing/iterators/TextIterator.cpp File third_party/WebKit/Source/core/editing/iterators/TextIterator.cpp (right): https://codereview.chromium.org/2131103002/diff/40001/third_party/WebKit/Source/core/editing/iterators/TextIterator.cpp#newcode208 third_party/WebKit/Source/core/editing/iterators/TextIterator.cpp:208: m_endNode = endContainer && endOffset > 0 ? Strategy::childAt(*endContainer, ...
4 years, 4 months ago (2016-07-26 08:40:44 UTC) #17
Xiaocheng
PTAL. https://codereview.chromium.org/2131103002/diff/40001/third_party/WebKit/Source/core/editing/iterators/TextIterator.cpp File third_party/WebKit/Source/core/editing/iterators/TextIterator.cpp (right): https://codereview.chromium.org/2131103002/diff/40001/third_party/WebKit/Source/core/editing/iterators/TextIterator.cpp#newcode208 third_party/WebKit/Source/core/editing/iterators/TextIterator.cpp:208: m_endNode = endContainer && endOffset > 0 ? ...
4 years, 4 months ago (2016-07-27 02:07:33 UTC) #22
yosin_UTC9
https://codereview.chromium.org/2131103002/diff/40001/third_party/WebKit/Source/core/editing/iterators/TextIteratorTest.cpp File third_party/WebKit/Source/core/editing/iterators/TextIteratorTest.cpp (right): https://codereview.chromium.org/2131103002/diff/40001/third_party/WebKit/Source/core/editing/iterators/TextIteratorTest.cpp#newcode526 third_party/WebKit/Source/core/editing/iterators/TextIteratorTest.cpp:526: On 2016/07/27 at 02:07:33, Xiaocheng wrote: > On 2016/07/26 ...
4 years, 4 months ago (2016-07-27 02:17:23 UTC) #23
Xiaocheng
PTAL. https://codereview.chromium.org/2131103002/diff/40001/third_party/WebKit/Source/core/editing/iterators/TextIteratorTest.cpp File third_party/WebKit/Source/core/editing/iterators/TextIteratorTest.cpp (right): https://codereview.chromium.org/2131103002/diff/40001/third_party/WebKit/Source/core/editing/iterators/TextIteratorTest.cpp#newcode526 third_party/WebKit/Source/core/editing/iterators/TextIteratorTest.cpp:526: On 2016/07/27 at 02:17:23, Yosi_UTC9 wrote: > On ...
4 years, 4 months ago (2016-07-27 04:06:51 UTC) #26
yosin_UTC9
lgtm
4 years, 4 months ago (2016-07-27 04:11:49 UTC) #27
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/2131103002/80001
4 years, 4 months ago (2016-07-27 07:15:30 UTC) #31
commit-bot: I haz the power
Committed patchset #5 (id:80001)
4 years, 4 months ago (2016-07-27 07:19:56 UTC) #32
commit-bot: I haz the power
4 years, 4 months ago (2016-07-27 07:22:22 UTC) #34
Message was sent while issue was closed.
Patchset 5 (id:??) landed as
https://crrev.com/32dad58c08112ed4a04505675aca27d37d2ce755
Cr-Commit-Position: refs/heads/master@{#408071}

Powered by Google App Engine
This is Rietveld 408576698