Commit 148c3506 authored by Maxim Kolosovskiy's avatar Maxim Kolosovskiy Committed by Commit Bot

Revert "Make EndOfSentence stop at block boundaries"

This reverts commit aee1ee31.

Reason for revert: Suspect this CL caused https://bugs.chromium.org/p/monorail/issues/detail?id=4576

Original change's description:
> Make EndOfSentence stop at block boundaries
> 
> This patch stops EndOfSentence from crossing block boundaries, since
> block boundaries are also sentence boundaries.
> 
> Bug: 778507
> Change-Id: I19ec97de1bbaac50db4c55b38ffb158339003993
> Reviewed-on: https://chromium-review.googlesource.com/c/1337432
> Reviewed-by: Yoichi Osato <yoichio@chromium.org>
> Reviewed-by: Yoshifumi Inoue <yosin@chromium.org>
> Commit-Queue: Xiaocheng Hu <xiaochengh@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#608850}

TBR=yosin@chromium.org,yoichio@chromium.org,xiaochengh@chromium.org

# Not skipping CQ checks because original CL landed > 1 day ago.

Bug: 778507
Change-Id: I7d48146bd7fb27c34427f543ad3b54443ae63715
Reviewed-on: https://chromium-review.googlesource.com/c/1340815Reviewed-by: default avatarMaxim Kolosovskiy <kolos@chromium.org>
Commit-Queue: Maxim Kolosovskiy <kolos@chromium.org>
Cr-Commit-Position: refs/heads/master@{#609224}
parent b10a7b7f
......@@ -85,14 +85,6 @@ function runTests() {
assert_equals(actual, 'multiple lines.');
}, 'sentence11');
// Sentence end expansion should not cross block boundaries.
test(() => {
const id = 'begin';
const length = document.getElementById(id).firstChild.length;
const actual = expandRangeString(id, length, id, length, 'sentence', true);
assert_equals(actual, 'Each sentence begins with capital\nletter and ends with a punctuation.');
}, 'sentence12');
// Expand word.
// Same range start and end, both at the begin of word.
test(() => {
......@@ -226,7 +218,7 @@ function runTests() {
}
</script>
<body>
<p id="begin">This is the begin of a block. A block is a collection of sentences. Each sentence begins with capital
<p>This is the begin of a block. A block is a collection of sentences. Each sentence begins with capital
letter and ends with a punctuation.
</p>
<pre id="multilineSentence">Now, a sentence
......
......@@ -103,13 +103,8 @@ PositionInFlatTree EndOfSentenceInternal(const PositionInFlatTree& position) {
// between sentences.
const unsigned offset = FindNonSpaceCharacter(text, passed_offset);
const int result = iterator->following(offset);
if (result == kTextBreakDone) {
if (text.length()) {
// Block boundaries are also sentence boundaries.
return Position::After(text.length());
}
if (result == kTextBreakDone)
return Position();
}
return result == 0 ? Position::Before(0) : Position::After(result - 1);
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment