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

Unified Diff: third_party/WebKit/LayoutTests/fast/text/international/cjk-segmentation.html

Issue 1987983002: Remove Range.expand() method Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/LayoutTests/fast/text/international/cjk-segmentation.html
diff --git a/third_party/WebKit/LayoutTests/fast/text/international/cjk-segmentation.html b/third_party/WebKit/LayoutTests/fast/text/international/cjk-segmentation.html
index 6110cbcf5a36c7d55e012c8e6b3c48a517be299d..78b3a60258d22e230263c5e753f38390b8e990c9 100644
--- a/third_party/WebKit/LayoutTests/fast/text/international/cjk-segmentation.html
+++ b/third_party/WebKit/LayoutTests/fast/text/international/cjk-segmentation.html
@@ -27,7 +27,7 @@ function test()
if (window.testRunner)
testRunner.dumpAsText();
- var range = document.createRange();
+ var selection = getSelection();
var divs = document.getElementsByClassName("zh-CN-div");
var pass = true;
for (var j = 0; j < divs.length; ++j) {
@@ -35,10 +35,10 @@ function test()
var length = div.innerText.length;
var title = div.title.split(' ');
for (var i = 0; i < length; ++i) {
- range.setStart(div.firstChild, i);
- range.setEnd(div.firstChild, i);
- range.expand('word');
- var actual = range.toString();
+ selection.collapse(div.firstChild, i);
+ selection.modify("move","forward","word");
+ selection.modify("extend", "backward", "word");
+ var actual = selection.getRangeAt(0).toString();
assertEqual(" ", actual, title[i]);
if (actual != title[i])
pass = false;

Powered by Google App Engine
This is Rietveld 408576698