Commit 29ca3623 authored by Xiaocheng Hu's avatar Xiaocheng Hu Committed by Commit Bot

Make fast/dom/Range/range-expand.html match its intention

The layout test has a "multiline" test case which isn't really multiline,
as the linebreak characters in HTML are turned into whitespaces.

This patch changes the <p> element into <pre> so that the linebreak
characters are really breaking text into lines, and the test case is a
multiline test case.

This patch is a preparation for changing StartOfSentence() to use
TextOffsetMapping (crrev.com/c/1335959).

Bug: 778507
Change-Id: I77cd48eb13a1ff442e7ecbe1c71819055bccf078
Reviewed-on: https://chromium-review.googlesource.com/c/1336785
Commit-Queue: Xiaocheng Hu <xiaochengh@chromium.org>
Reviewed-by: default avatarYoichi Osato <yoichio@chromium.org>
Reviewed-by: default avatarYoshifumi Inoue <yosin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#608263}
parent ed9d8ec7
...@@ -64,20 +64,20 @@ function runTests() { ...@@ -64,20 +64,20 @@ function runTests() {
assert_equals(actual, 'Roll the mouse around the page. The coordinates\x0Aof the mouse pointer are currently atop an element'); assert_equals(actual, 'Roll the mouse around the page. The coordinates\x0Aof the mouse pointer are currently atop an element');
}, 'sentence7'); }, 'sentence7');
// test 8 - Sentence does not go upstream? // test 8
test(() => { test(() => {
const actual = expandRangeString('multilineSentence', 0, 'multilineSentence', 0, 'sentence', false); const actual = expandRangeString('multilineSentence', 0, 'multilineSentence', 0, 'sentence', false);
assert_equals(actual, 'Now, a sentence\x0Ais divided into\x0Amultiple lines.'); assert_equals(actual, 'Now, a sentence\n');
}, 'sentence8'); }, 'sentence8');
test(() => { test(() => {
const actual = expandRangeString('multilineSentence', 1, 'multilineSentence', 5, 'sentence', true); const actual = expandRangeString('multilineSentence', 1, 'multilineSentence', 5, 'sentence', true);
assert_equals(actual, 'Now, a sentence\x0Ais divided into\x0Amultiple lines.'); assert_equals(actual, 'Now, a sentence\n');
}, 'sentence9'); }, 'sentence9');
test(() => { test(() => {
const actual = expandRangeString('multilineSentence', 20, 'multilineSentence', 20, 'sentence', true); const actual = expandRangeString('multilineSentence', 20, 'multilineSentence', 20, 'sentence', true);
assert_equals(actual, 'is divided into\x0Amultiple lines.'); assert_equals(actual, 'is divided into\n');
}, 'sentence10'); }, 'sentence10');
test(() => { test(() => {
...@@ -221,10 +221,10 @@ function runTests() { ...@@ -221,10 +221,10 @@ function runTests() {
<p>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. letter and ends with a punctuation.
</p> </p>
<p id="multilineSentence">Now, a sentence <pre id="multilineSentence">Now, a sentence
is divided into is divided into
multiple lines. multiple lines.
</p> </pre>
<p id="instructions">Roll the mouse around the page. The coordinates <p id="instructions">Roll the mouse around the page. The coordinates
of the mouse pointer are currently atop an element<br id="mybr">whose ID of the mouse pointer are currently atop an element<br id="mybr">whose ID
is:"<span id="myspan" style="font-weight:bold"></span>".</p> is:"<span id="myspan" style="font-weight:bold"></span>".</p>
......
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