editing/selection/move-by-word-visually* tests timing out
https://bugs.webkit.org/show_bug.cgi?id=65241

Split the 2 tests into 4 tests. But need to find a way to improve
performance eventually.

* editing/selection/move-by-word-visually-multi-line-expected.txt: Copied from LayoutTests/editing/selection/move-by-word-visually-others-expected.txt.
* editing/selection/move-by-word-visually-multi-line.html: Copied from LayoutTests/editing/selection/move-by-word-visually-others.html.
* editing/selection/move-by-word-visually-multi-space-expected.txt: Copied from LayoutTests/editing/selection/move-by-word-visually-others-expected.txt.
* editing/selection/move-by-word-visually-multi-space.html: Copied from LayoutTests/editing/selection/move-by-word-visually-others.html.
* editing/selection/move-by-word-visually-others-expected.txt: Removed.
* editing/selection/move-by-word-visually-others.html: Removed.
* editing/selection/move-by-word-visually-single-space-inline-element-expected.txt: Copied from LayoutTests/editing/selection/move-by-word-visually-single-space-sigle-line-expected.txt.
* editing/selection/move-by-word-visually-single-space-inline-element.html: Copied from LayoutTests/editing/selection/move-by-word-visually-single-space-sigle-line.html.
* editing/selection/move-by-word-visually-single-space-one-element-expected.txt: Copied from LayoutTests/editing/selection/move-by-word-visually-single-space-sigle-line-expected.txt.
* editing/selection/move-by-word-visually-single-space-one-element.html: Copied from LayoutTests/editing/selection/move-by-word-visually-single-space-sigle-line.html.
* editing/selection/move-by-word-visually-single-space-sigle-line-expected.txt: Removed.
* editing/selection/move-by-word-visually-single-space-sigle-line.html: Removed.
* platform/chromium/test_expectations.txt:
* platform/qt/Skipped:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@91864 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog
index ff44b75..d85838a 100644
--- a/LayoutTests/ChangeLog
+++ b/LayoutTests/ChangeLog
@@ -1,3 +1,26 @@
+2011-07-27  Xiaomei Ji  <xji@chromium.org>
+
+        editing/selection/move-by-word-visually* tests timing out
+        https://bugs.webkit.org/show_bug.cgi?id=65241
+
+        Split the 2 tests into 4 tests. But need to find a way to improve
+        performance eventually.
+
+        * editing/selection/move-by-word-visually-multi-line-expected.txt: Copied from LayoutTests/editing/selection/move-by-word-visually-others-expected.txt.
+        * editing/selection/move-by-word-visually-multi-line.html: Copied from LayoutTests/editing/selection/move-by-word-visually-others.html.
+        * editing/selection/move-by-word-visually-multi-space-expected.txt: Copied from LayoutTests/editing/selection/move-by-word-visually-others-expected.txt.
+        * editing/selection/move-by-word-visually-multi-space.html: Copied from LayoutTests/editing/selection/move-by-word-visually-others.html.
+        * editing/selection/move-by-word-visually-others-expected.txt: Removed.
+        * editing/selection/move-by-word-visually-others.html: Removed.
+        * editing/selection/move-by-word-visually-single-space-inline-element-expected.txt: Copied from LayoutTests/editing/selection/move-by-word-visually-single-space-sigle-line-expected.txt.
+        * editing/selection/move-by-word-visually-single-space-inline-element.html: Copied from LayoutTests/editing/selection/move-by-word-visually-single-space-sigle-line.html.
+        * editing/selection/move-by-word-visually-single-space-one-element-expected.txt: Copied from LayoutTests/editing/selection/move-by-word-visually-single-space-sigle-line-expected.txt.
+        * editing/selection/move-by-word-visually-single-space-one-element.html: Copied from LayoutTests/editing/selection/move-by-word-visually-single-space-sigle-line.html.
+        * editing/selection/move-by-word-visually-single-space-sigle-line-expected.txt: Removed.
+        * editing/selection/move-by-word-visually-single-space-sigle-line.html: Removed.
+        * platform/chromium/test_expectations.txt:
+        * platform/qt/Skipped:
+
 2011-07-27  Ryosuke Niwa  <rniwa@webkit.org>
 
         Wrong image height in absolutely positioned div in relatively positioned parent with bottom padding
diff --git a/LayoutTests/editing/selection/move-by-word-visually-multi-line-expected.txt b/LayoutTests/editing/selection/move-by-word-visually-multi-line-expected.txt
new file mode 100644
index 0000000..90d2501
--- /dev/null
+++ b/LayoutTests/editing/selection/move-by-word-visually-multi-line-expected.txt
@@ -0,0 +1,78 @@
+
+======== Move By Word ====
+Test 1, LTR:
+Move right by one word
+"abc def ghi jkl mn "[0, 4, 8, 12, 16], "opq rst uvw xyz"[0, 4, 8, 12]
+Move left by one word
+"opq rst uvw xyz"[15, 12, 8, 4, 0], "abc def ghi jkl mn "[16, 12, 8, 4, 0]
+Test 2, LTR:
+Move right by one word
+"abc def ghi jkl mn "[0, 4, 8, 12, 16], "opq rst uvw xyz"[0, 4, 8, 12]
+Move left by one word
+"opq rst uvw xyz"[15, 12, 8, 4, 0], "abc def ghi jkl mn "[16, 12, 8, 4, 0]
+Test 3, LTR:
+Move right by one word
+"AAA AAA AAA AAA "[0, 3, 8, 11], "AAA AAA AAA AAA"[0, 3, 8, 11]
+Move left by one word
+"AAA AAA AAA AAA"[15, 11, 8, 3, 0], "AAA AAA AAA AAA "[11, 8, 3, 0]
+Test 4, LTR:
+Move right by one word
+"AAA AAA AAA AAA "[0, 3, 8, 11], "AAA AAA AAA AAA"[0, 3, 8, 11]
+Move left by one word
+"AAA AAA AAA AAA"[15, 11, 8, 3, 0], "AAA AAA AAA AAA "[11, 8, 3, 0]
+Test 5, LTR:
+Move right by one word
+" abc def AAA AAA hij AAA AAA uvw xyz "[1, 5, 9, 12, 17, 21, 25, 29, 33], "AAA kj AAA mn opq AAA AAA"[0, 4, 7, 11, 14, 18, 22, 25]
+Move left by one word
+"AAA kj AAA mn opq AAA AAA"[25, 22, 18, 14, 11, 7, 4, 0], " abc def AAA AAA hij AAA AAA uvw xyz "[33, 29, 25, 21, 17, 12, 9, 5, 1]
+Test 6, LTR:
+Move right by one word
+" abc def AAA AAA hij AAA AAA uvw xyz "[1, 5, 9, 12, 17, 21, 25, 29, 33], "AAA kj AAA mn opq AAA AAA"[0, 4, 7, 11, 14, 18, 22, 25]
+Move left by one word
+"AAA kj AAA mn opq AAA AAA"[25, 22, 18, 14, 11, 7, 4, 0], " abc def AAA AAA hij AAA AAA uvw xyz "[33, 29, 25, 21, 17, 12, 9, 5, 1]
+Test 7, RTL:
+Move left by one word
+"abc def ghi jkl mn "[0, 3, 8, 11, 16], "opq rst uvw xyz"[0, 3, 8, 11]
+Move right by one word
+"opq rst uvw xyz"[15, 11, 8, 3, 0], "abc def ghi jkl mn "[16, 11, 8, 3, 0]
+Test 8, RTL:
+Move left by one word
+"abc def ghi jkl mn "[0, 3, 8, 11, 16, 18], "opq rst uvw xyz"[0, 3, 8, 11]
+Move right by one word
+"opq rst uvw xyz"[15, 11, 8, 3, 0], "abc def ghi jkl mn "[18, 16, 11, 8, 3, 0]
+Test 9, RTL:
+Move left by one word
+"AAA AAA AAA AAA "[0, 4, 8, 12], "AAA AAA AAA AAA"[0, 4, 8, 12]
+Move right by one word
+"AAA AAA AAA AAA"[15, 12, 8, 4, 0], "AAA AAA AAA AAA "[12, 8, 4, 0]
+Test 10, RTL:
+Move left by one word
+"AAA AAA AAA AAA "[0, 4, 8, 12], "AAA AAA AAA AAA"[0, 4, 8, 12]
+Move right by one word
+"AAA AAA AAA AAA"[15, 12, 8, 4, 0], "AAA AAA AAA AAA "[12, 8, 4, 0]
+Test 11, RTL:
+Move left by one word
+" abc def AAA AAA hij AAA AAA uvw xyz "[1, 4, 9, 13, 17, 21, 25, 29, 33], "AAA kj AAA mn opq AAA AAA"[0, 4, 7, 11, 14, 18, 22]
+Move right by one word
+"AAA kj AAA mn opq AAA AAA"[25, 22, 18, 14, 11, 7, 4, 0], " abc def AAA AAA hij AAA AAA uvw xyz "[33, 29, 25, 21, 17, 13, 9, 4, 1]
+Test 12, RTL:
+Move left by one word
+" abc def AAA AAA hij AAA AAA uvw xyz "[1, 4, 9, 13, 17, 21, 25, 29, 33, 36], "AAA kj AAA mn opq AAA AAA"[0, 4, 7, 11, 14, 18, 22]
+Move right by one word
+"AAA kj AAA mn opq AAA AAA"[25, 22, 18, 14, 11, 7, 4, 0], " abc def AAA AAA hij AAA AAA uvw xyz "[36, 33, 29, 25, 21, 17, 13, 9, 4, 1]
+Test 13, LTR:
+Move right by one word
+"abc def "[0, 4]
+Move left by one word
+" hij opq"[8, 5, 1]
+Test 14, LTR:
+Move right by one word
+<DIV>[0]
+Move left by one word
+<DIV>[0]
+Test 15, LTR:
+Move right by one word
+"\n00"[3]
+Move left by one word
+"\n00"[3, 1]
+
diff --git a/LayoutTests/editing/selection/move-by-word-visually-multi-line.html b/LayoutTests/editing/selection/move-by-word-visually-multi-line.html
new file mode 100644
index 0000000..501c8e5
--- /dev/null
+++ b/LayoutTests/editing/selection/move-by-word-visually-multi-line.html
@@ -0,0 +1,81 @@
+<!DOCTYPE HTML>
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<link rel="stylesheet" type="text/css" href="resources/extend-selection.css" />
+<style>
+.fix_width {font-size: 10px; font-family: sans-serif;}
+</style>
+<script src="resources/move-by-word-visually.js"></script>
+<script>
+
+onload = function() {
+    try {
+        runTest();
+    } finally {
+        flushLog();
+    }
+};
+
+if (window.layoutTestController) 
+    layoutTestController.dumpAsText();
+</script>
+</head>
+<body>
+<div id="testMoveByWord">
+<!-- 
+Title saves the word breaks.
+The format of title is "xxx|xxxx".
+
+The sequence on the left of "|" is word boundaries when moving caret from left to right.
+The sequence on the right of "|" is word boundaries when moving caret from right to left.
+
+If there is a single node in the line, the sequence are offsets.
+If there are multiple nodes in the line, the sequence is array of [anchor_node_id, offset, child_node_index], 
+where child_node_index is optional, default is the first child of the anchor node.
+-->
+
+<!-- test multi-line -->
+<div><span class="fix_width" id="span_size">אאא אאא</span></div>
+<div contenteditable dir=ltr id="ml_1" class="test_move_by_word fix_width" title="[ml_1, 0][ml_1, 4][ml_1, 8][ml_1, 12][ml_1, 16][ml_1, 0, 5][ml_1, 4, 5][ml_1, 8, 5][ml_1, 12, 5]|[ml_1, 15, 5][ml_1, 12, 5][ml_1, 8, 5][ml_1, 4, 5][ml_1, 0, 5][ml_1, 16][ml_1, 12][ml_1, 8][ml_1, 4][ml_1, 0]">abc def ghi jkl mn <br/><br/><br/>opq rst uvw xyz</div>
+
+<div contenteditable dir=ltr id="ml_2" class="test_move_by_word fix_width" title="[ml_2, 0][ml_2, 4][ml_2, 8][ml_2, 12][ml_2, 16][ml_2, 0, 5][ml_2, 4, 5][ml_2, 8, 5][ml_2, 12, 5]|[ml_2, 15, 5][ml_2, 12, 5][ml_2, 8, 5][ml_2, 4, 5][ml_2, 0, 5][ml_2, 16][ml_2, 12][ml_2, 8][ml_2, 4][ml_2, 0]">abc def ghi jkl mn <div><br/></div><div><br/></div><div><br/></div>opq rst uvw xyz</div>
+
+<div contenteditable dir=ltr id="ml_3" class="test_move_by_word fix_width" title="[ml_3, 0][ml_3, 3][ml_3, 8][ml_3, 11]][ml_3, 0, 5][ml_3, 3, 5][ml_3, 8, 5][ml_3, 11, 5]|[ml_3, 15, 5][ml_3, 11, 5][ml_3, 8, 5][ml_3, 3, 5][ml_3, 0, 5][ml_3, 11][ml_3, 8][ml_3, 3][ml_3, 0]">אאא אאא אאא אאא <br/><br/><br/>אאא אאא אאא אאא</div>
+
+<div contenteditable dir=ltr id="ml_4" class="test_move_by_word fix_width" title="[ml_4, 0][ml_4, 3][ml_4, 8][ml_4, 11][ml_4, 0, 5][ml_4, 3, 5][ml_4, 8, 5][ml_4, 11, 5]|[ml_4, 15, 5][ml_4, 11, 5][ml_4, 8, 5][ml_4, 3, 5][ml_4, 0, 5][ml_4, 11][ml_4, 8][ml_4, 3][ml_4, 0]">אאא אאא אאא אאא <div><br/></div><div><br/></div><div><br/></div>אאא אאא אאא אאא</div>
+
+<div contenteditable dir=ltr id="ml_5" class="test_move_by_word fix_width" title="[ml_5, 1][ml_5, 5][ml_5, 9][ml_5, 12][ml_5, 17][ml_5, 21][ml_5, 25][ml_5, 29][ml_5, 33][ml_5, 0, 5][ml_5, 4, 5][ml_5, 7, 5][ml_5, 11, 5][ml_5, 14, 5][ml_5, 18, 5][ml_5, 22, 5][ml_5, 25, 5]|[ml_5, 25, 5][ml_5, 22, 5][ml_5, 18, 5][ml_5, 14, 5][ml_5, 11, 5][ml_5, 7, 5][ml_5, 4, 5][ml_5, 0, 5][ml_5, 33][ml_5, 29][ml_5, 25][ml_5, 21][ml_5, 17][ml_5, 12][ml_5, 9][ml_5, 5][ml_5, 1]"> abc def אאא אאא hij אאא אאא uvw xyz <br/><br/><br/>אאא kj אאא mn opq אאא אאא</div>
+
+<div contenteditable dir=ltr id="ml_6" class="test_move_by_word fix_width" title="[ml_6, 1][ml_6, 5][ml_6, 9][ml_6, 12][ml_6, 17][ml_6, 21][ml_6, 25][ml_6, 29][ml_6, 33][ml_6, 0, 5][ml_6, 4, 5][ml_6, 7, 5][ml_6, 11, 5][ml_6, 14, 5][ml_6, 18, 5][ml_6, 22, 5][ml_6, 25, 5]|[ml_6, 25, 5][ml_6, 22, 5][ml_6, 18, 5][ml_6, 14, 5][ml_6, 11, 5][ml_6, 7, 5][ml_6, 4, 5][ml_6, 0, 5][ml_6, 33][ml_6, 29][ml_6, 25][ml_6, 21][ml_6, 17][ml_6, 12][ml_6, 9][ml_6, 5][ml_6, 1]"> abc def אאא אאא hij אאא אאא uvw xyz <div><br/></div><div><br/></div><div><br/></div>אאא kj אאא mn opq אאא אאא</div>
+
+
+<div contenteditable dir=rtl id="ml_7" class="test_move_by_word fix_width" title="[ml_7, 15, 5][ml_7, 11, 5][ml_7, 8, 5][ml_7, 3, 5][ml_7, 0, 5][ml_7, 16][ml_7, 11][ml_7, 8][ml_7, 3][ml_7, 0]|[ml_7, 0][ml_7, 3][ml_7, 8][ml_7, 11][ml_7, 16][ml_7, 0, 5][ml_7, 3, 5][ml_7, 8, 5][ml_7, 11, 5]">abc def ghi jkl mn <br/><br/><br/>opq rst uvw xyz</div>
+
+<div contenteditable dir=rtl id="ml_8" class="test_move_by_word fix_width" title="[ml_8, 15, 5][ml_8, 11, 5][ml_8, 8, 5][ml_8, 3, 5][ml_8, 0, 5][ml_8, 18][ml_8, 16][ml_8, 11][ml_8, 8][ml_8, 3][ml_8, 0]|[ml_8, 0][ml_8, 3][ml_8, 8][ml_8, 11][ml_8, 16][ml_8, 18][ml_8, 0, 5][ml_8, 3, 5][ml_8, 8, 5][ml_8, 11, 5]">abc def ghi jkl mn <div><br/></div><div><br/></div><div><br/></div>opq rst uvw xyz</div>
+
+<div contenteditable dir=rtl id="ml_9" class="test_move_by_word fix_width" title="[ml_9, 15, 5][ml_9, 12, 5][ml_9, 8, 5][ml_9, 4, 5][ml_9, 0, 5][ml_9, 12][ml_9, 8][ml_9, 4][ml_9, 0]|[ml_9, 0][ml_9, 4][ml_9, 8][ml_9, 12][ml_9, 0, 5][ml_9, 4, 5][ml_9, 8, 5][ml_9, 12, 5]">אאא אאא אאא אאא <br/><br/><br/>אאא אאא אאא אאא</div>
+
+<div contenteditable dir=rtl id="ml_10" class="test_move_by_word fix_width" title="[ml_10, 15, 5][ml_10, 12, 5][ml_10, 8, 5][ml_10, 4, 5][ml_10, 0, 5][ml_10, 12][ml_10, 8][ml_10, 4][ml_10, 0]|[ml_10, 0][ml_10, 4][ml_10, 8][ml_10, 12][ml_10, 0, 5][ml_10, 4, 5][ml_10, 8, 5][ml_10, 12, 5]">אאא אאא אאא אאא <div><br/></div><div><br/></div><div><br/></div>אאא אאא אאא אאא</div>
+
+<div contenteditable dir=rtl id="ml_11" class="test_move_by_word fix_width" title="
+[ml_11, 25, 5][ml_11, 22, 5][ml_11, 18, 5][ml_11, 14, 5][ml_11, 11, 5][ml_11, 7, 5][ml_11, 4, 5][ml_11, 0, 5][ml_11, 33][ml_11, 29][ml_11, 25][ml_11, 21][ml_11, 17][ml_11, 13][ml_11, 9][ml_11, 4][ml_11, 1]|[ml_11, 1][ml_11, 4][ml_11, 9][ml_11, 13][ml_11, 17][ml_11, 21][ml_11, 25][ml_11, 29][ml_11, 33][ml_11, 0, 5][ml_11, 4, 5][ml_11, 7, 5][ml_11, 11, 5][ml_11, 14, 5][ml_11, 18, 5][ml_11, 22, 5]
+"> abc def אאא אאא hij אאא אאא uvw xyz <br/><br/><br/>אאא kj אאא mn opq אאא אאא</div>
+
+<div contenteditable dir=rtl id="ml_12" class="test_move_by_word fix_width" title="
+[ml_12, 25, 5][ml_12, 22, 5][ml_12, 18, 5][ml_12, 14, 5][ml_12, 11, 5][ml_12, 7, 5][ml_12, 4, 5][ml_12, 0, 5][ml_12, 36][ml_12, 33][ml_12, 29][ml_12, 25][ml_12, 21][ml_12, 17][ml_12, 13][ml_12, 9][ml_12, 4][ml_12, 1]|[ml_12, 1][ml_12, 4][ml_12, 9][ml_12, 13][ml_12, 17][ml_12, 21][ml_12, 25][ml_12, 29][ml_12, 33][ml_12, 36][ml_12, 0, 5][ml_12, 4, 5][ml_12, 7, 5][ml_12, 11, 5][ml_12, 14, 5][ml_12, 18, 5][ml_12, 22, 5]
+"> abc def אאא אאא hij אאא אאא uvw xyz <div><br/></div><div><br/></div><div><br/></div>אאא kj אאא mn opq אאא אאא</div>
+
+<!-- mixed editability -->
+<div dir=ltr class="test_move_by_word" title="0 4|8 5 1">abc def <span contenteditable> inside span </span> hij opq</div>
+
+<div class="test_move_by_word" contenteditable dir=ltr title="0|0"></div>
+
+<div contenteditable>
+00<base dir=ltr class="test_move_by_word" title="3|3 1">
+</div>
+
+</div>
+<pre id="console"></pre>
+</body>
+</html>
diff --git a/LayoutTests/editing/selection/move-by-word-visually-others-expected.txt b/LayoutTests/editing/selection/move-by-word-visually-multi-space-expected.txt
similarity index 73%
rename from LayoutTests/editing/selection/move-by-word-visually-others-expected.txt
rename to LayoutTests/editing/selection/move-by-word-visually-multi-space-expected.txt
index b8cbd2e..82e8c57 100644
--- a/LayoutTests/editing/selection/move-by-word-visually-others-expected.txt
+++ b/LayoutTests/editing/selection/move-by-word-visually-multi-space-expected.txt
@@ -221,79 +221,4 @@
 "䤫䡱暘倎厘    疂崝烵     abc def"[0, 1, 2, 3, 4, 9, 10, 11, 17, 21]
 Move left by one word
 "䤫䡱暘倎厘    疂崝烵     abc def"[24, 21, 17, 11, 10, 9, 4, 3, 2, 1, 0]
-Test 44, LTR:
-Move right by one word
-"abc def ghi jkl mn "[0, 4, 8, 12, 16], "opq rst uvw xyz"[0, 4, 8, 12]
-Move left by one word
-"opq rst uvw xyz"[15, 12, 8, 4, 0], "abc def ghi jkl mn "[16, 12, 8, 4, 0]
-Test 45, LTR:
-Move right by one word
-"abc def ghi jkl mn "[0, 4, 8, 12, 16], "opq rst uvw xyz"[0, 4, 8, 12]
-Move left by one word
-"opq rst uvw xyz"[15, 12, 8, 4, 0], "abc def ghi jkl mn "[16, 12, 8, 4, 0]
-Test 46, LTR:
-Move right by one word
-"AAA AAA AAA AAA "[0, 3, 8, 11], "AAA AAA AAA AAA"[0, 3, 8, 11]
-Move left by one word
-"AAA AAA AAA AAA"[15, 11, 8, 3, 0], "AAA AAA AAA AAA "[11, 8, 3, 0]
-Test 47, LTR:
-Move right by one word
-"AAA AAA AAA AAA "[0, 3, 8, 11], "AAA AAA AAA AAA"[0, 3, 8, 11]
-Move left by one word
-"AAA AAA AAA AAA"[15, 11, 8, 3, 0], "AAA AAA AAA AAA "[11, 8, 3, 0]
-Test 48, LTR:
-Move right by one word
-" abc def AAA AAA hij AAA AAA uvw xyz "[1, 5, 9, 12, 17, 21, 25, 29, 33], "AAA kj AAA mn opq AAA AAA"[0, 4, 7, 11, 14, 18, 22, 25]
-Move left by one word
-"AAA kj AAA mn opq AAA AAA"[25, 22, 18, 14, 11, 7, 4, 0], " abc def AAA AAA hij AAA AAA uvw xyz "[33, 29, 25, 21, 17, 12, 9, 5, 1]
-Test 49, LTR:
-Move right by one word
-" abc def AAA AAA hij AAA AAA uvw xyz "[1, 5, 9, 12, 17, 21, 25, 29, 33], "AAA kj AAA mn opq AAA AAA"[0, 4, 7, 11, 14, 18, 22, 25]
-Move left by one word
-"AAA kj AAA mn opq AAA AAA"[25, 22, 18, 14, 11, 7, 4, 0], " abc def AAA AAA hij AAA AAA uvw xyz "[33, 29, 25, 21, 17, 12, 9, 5, 1]
-Test 50, RTL:
-Move left by one word
-"abc def ghi jkl mn "[0, 3, 8, 11, 16], "opq rst uvw xyz"[0, 3, 8, 11]
-Move right by one word
-"opq rst uvw xyz"[15, 11, 8, 3, 0], "abc def ghi jkl mn "[16, 11, 8, 3, 0]
-Test 51, RTL:
-Move left by one word
-"abc def ghi jkl mn "[0, 3, 8, 11, 16, 18], "opq rst uvw xyz"[0, 3, 8, 11]
-Move right by one word
-"opq rst uvw xyz"[15, 11, 8, 3, 0], "abc def ghi jkl mn "[18, 16, 11, 8, 3, 0]
-Test 52, RTL:
-Move left by one word
-"AAA AAA AAA AAA "[0, 4, 8, 12], "AAA AAA AAA AAA"[0, 4, 8, 12]
-Move right by one word
-"AAA AAA AAA AAA"[15, 12, 8, 4, 0], "AAA AAA AAA AAA "[12, 8, 4, 0]
-Test 53, RTL:
-Move left by one word
-"AAA AAA AAA AAA "[0, 4, 8, 12], "AAA AAA AAA AAA"[0, 4, 8, 12]
-Move right by one word
-"AAA AAA AAA AAA"[15, 12, 8, 4, 0], "AAA AAA AAA AAA "[12, 8, 4, 0]
-Test 54, RTL:
-Move left by one word
-" abc def AAA AAA hij AAA AAA uvw xyz "[1, 4, 9, 13, 17, 21, 25, 29, 33], "AAA kj AAA mn opq AAA AAA"[0, 4, 7, 11, 14, 18, 22]
-Move right by one word
-"AAA kj AAA mn opq AAA AAA"[25, 22, 18, 14, 11, 7, 4, 0], " abc def AAA AAA hij AAA AAA uvw xyz "[33, 29, 25, 21, 17, 13, 9, 4, 1]
-Test 55, RTL:
-Move left by one word
-" abc def AAA AAA hij AAA AAA uvw xyz "[1, 4, 9, 13, 17, 21, 25, 29, 33, 36], "AAA kj AAA mn opq AAA AAA"[0, 4, 7, 11, 14, 18, 22]
-Move right by one word
-"AAA kj AAA mn opq AAA AAA"[25, 22, 18, 14, 11, 7, 4, 0], " abc def AAA AAA hij AAA AAA uvw xyz "[36, 33, 29, 25, 21, 17, 13, 9, 4, 1]
-Test 56, LTR:
-Move right by one word
-"abc def "[0, 4]
-Move left by one word
-" hij opq"[8, 5, 1]
-Test 57, LTR:
-Move right by one word
-<DIV>[0]
-Move left by one word
-<DIV>[0]
-Test 58, LTR:
-Move right by one word
-"\n00"[3]
-Move left by one word
-"\n00"[3, 1]
 
diff --git a/LayoutTests/editing/selection/move-by-word-visually-multi-space.html b/LayoutTests/editing/selection/move-by-word-visually-multi-space.html
new file mode 100644
index 0000000..654c700
--- /dev/null
+++ b/LayoutTests/editing/selection/move-by-word-visually-multi-space.html
@@ -0,0 +1,94 @@
+<!DOCTYPE HTML>
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<link rel="stylesheet" type="text/css" href="resources/extend-selection.css" />
+<style>
+.fix_width {font-size: 10px; font-family: sans-serif;}
+</style>
+<script src="resources/move-by-word-visually.js"></script>
+<script>
+
+onload = function() {
+    try {
+        runTest();
+    } finally {
+        flushLog();
+    }
+};
+
+if (window.layoutTestController) 
+    layoutTestController.dumpAsText();
+</script>
+</head>
+<body>
+<div id="testMoveByWord">
+<!-- 
+Title saves the word breaks.
+The format of title is "xxx|xxxx".
+
+The sequence on the left of "|" is word boundaries when moving caret from left to right.
+The sequence on the right of "|" is word boundaries when moving caret from right to left.
+
+If there is a single node in the line, the sequence are offsets.
+If there are multiple nodes in the line, the sequence is array of [anchor_node_id, offset, child_node_index], 
+where child_node_index is optional, default is the first child of the anchor node.
+-->
+
+<!-- test multispaces -->
+<div dir=ltr class="test_move_by_word" title="0 4 8 15|18 15 8 4 0" contenteditable>abc def    hij opq</div>
+<div dir=ltr class="test_move_by_word" title="4 8 15 22|28 22 15 8 4" contenteditable>    abc    def    hij    opq    </div>
+<div dir=ltr class="test_move_by_word" title="4 8 15|21 15 8 4" contenteditable>    abc    אבצ    def    </div>
+<div dir=ltr class="test_move_by_word" title="4 8 15 21 29 36|42 36 29 21 15 8 4" contenteditable>    abc    def    אבצ    דדפ    hij    opq    </div>
+<div dir=ltr class="test_move_by_word" title="4 8 15 22 35 28 43 50 57|63 57 50 43 28 35 22 15 8 4" contenteditable>    abc    def    hij    אבצ    דעפ    היח    opq    rst    uvw    </div>
+<div dir=ltr class="test_move_by_word" title="4 21 14 7|28 7 14 21 4" contenteditable>    אבצ    דעפ    חיח    ופק    </div>
+<div dir=ltr class="test_move_by_word" title="4 8 15|21 15 8 4" contenteditable>    אבצ    abc    דעפ     </div>
+<div dir=ltr class="test_move_by_word" title="4 7 15 22 28 33|40 33 28 22 15 7 4" contenteditable>    אבצ    דעפ    abc   def   חיח    ופק    </div>
+<div dir=ltr class="test_move_by_word" title="4 14 7 22 29 35 41 51 46|58 46 51 41 35 29 22 7 14 4" contenteditable>    אבצ    דעפ    חיח    abc   def   jih   ופק  ופק    רסת     </div>
+
+<div dir=ltr class="test_move_by_word" title="0 14 7 3|18 3 7 14 0" contenteditable>אבצ דעפ    היח ופק</div>
+<div dir=ltr class="test_move_by_word" title="0 7 3 12 19 23|26 23 19 12 3 7 0" contenteditable>אבצ דעפ היח    abc def hij</div>
+<div dir=ltr class="test_move_by_word" title="0 4 8 12 22 18 27 34 38|41 38 34 27 18 22 12 8 4 0" contenteditable>abc def hij    אבצ דעפ היח    opq rst uvw</div>
+
+<div dir=rtl class="test_move_by_word" title="18 3 7 14 0|0 14 7 3" contenteditable>abc def    hij opq</div>
+<div dir=rtl class="test_move_by_word" title="28 7 14 21 4|4 21 14 7" contenteditable>    abc    def    hij    opq    </div>
+<div dir=rtl class="test_move_by_word" title="21 15 8 4|4 8 15" contenteditable>    abc    אבצ    def    </div>
+<div dir=rtl class="test_move_by_word" title="42 35 29 22 15 7 4|4 7 15 22 29 35" contenteditable>    abc    def    אבצ    דדפ    hij    opq    </div>
+<div dir=rtl class="test_move_by_word" title="63 49 56 43 36 29 22 7 14 4|4 14 7 22 29 36 43 56 49" contenteditable>    abc    def    hij    אבצ    דעפ    היח    opq    rst    uvw    </div>
+<div dir=rtl class="test_move_by_word" title="28 22 15 8 4|4 8 15 22" contenteditable>    אבצ    דעפ    חיח    ופק    </div>
+<div dir=rtl class="test_move_by_word" title="21 15 8 4|4 8 15" contenteditable>    אבצ    abc    דעפ     </div>
+<div dir=rtl class="test_move_by_word" title="40 34 28 21 15 8 4|4 8 15 21 28 34" contenteditable>    אבצ    דעפ    abc   def   חיח    ופק    </div>
+<div dir=rtl class="test_move_by_word" title="58 52 47 41 28 34 22 15 8 4|4 8 15 22 34 28 41 47 52" contenteditable>    אבצ    דעפ    חיח    abc   def   jih   ופק  ופק    רסת     </div>
+
+<!-- multispaces while preserving spaces -->
+<div style="white-space:pre" dir=ltr class="test_move_by_word" title="0 4 11 15|18 15 11 4 0" contenteditable>abc def    hij opq</div>
+<div style="white-space:pre" dir=ltr class="test_move_by_word" title="0 4 11 18 25|32 25 18 11 4 0" contenteditable>    abc    def    hij    opq    </div>
+<div style="white-space:pre" dir=ltr class="test_move_by_word" title="0 4 11 18|25 18 11 4 0" contenteditable>    abc    אבצ    def    </div>
+<div style="white-space:pre" dir=ltr class="test_move_by_word" title="0 4 11 18 21 32 39|46 39 32 21 18 11 4 0" contenteditable>    abc    def    אבצ    דדפ    hij    opq    </div>
+<div style="white-space:pre" dir=ltr class="test_move_by_word" title="0 4 11 18 25 35 28 46 53 60|67 60 53 46 28 35 25 18 11 4 0" contenteditable>    abc    def    hij    אבצ    דעפ    היח    opq    rst    uvw    </div>
+<div style="white-space:pre" dir=ltr class="test_move_by_word" title="0 4 21 14 7|32 7 14 21 4 0" contenteditable>    אבצ    דעפ    חיח    ופק    </div>
+<div style="white-space:pre" dir=ltr class="test_move_by_word" title="0 4 11 18|26 18 11 4 0" contenteditable>    אבצ    abc    דעפ     </div>
+<div style="white-space:pre" dir=ltr class="test_move_by_word" title="0 4 7 18 24 30 33|44 33 30 24 18 7 4 0" contenteditable>    אבצ    דעפ    abc   def   חיח    ופק    </div>
+<div style="white-space:pre" dir=ltr class="test_move_by_word" title="0 4 14 7 25 31 37 43 51 46|63 46 51 43 37 31 25 7 14 4 0" contenteditable>    אבצ    דעפ    חיח    abc   def   jih   ופק  ופק    רסת     </div>
+
+<div style="white-space:pre" dir=ltr class="test_move_by_word" title="0 14 7 3|18 3 7 14 0" contenteditable>אבצ דעפ    היח ופק</div>
+<div style="white-space:pre" dir=ltr class="test_move_by_word" title="0 7 3 15 19 23|26 23 19 15 3 7 0" contenteditable>אבצ דעפ היח    abc def hij</div>
+<div style="white-space:pre" dir=ltr class="test_move_by_word" title="0 4 8 15 22 18 30 34 38|41 38 34 30 18 22 15 8 4 0" contenteditable>abc def hij    אבצ דעפ היח    opq rst uvw</div>
+
+<div style="white-space:pre" dir=rtl class="test_move_by_word" title="18 3 7 14 0|0 14 7 3" contenteditable>abc def    hij opq</div>
+<div style="white-space:pre" dir=rtl class="test_move_by_word" title="32 7 14 21 4 0|0 4 21 14 7" contenteditable>    abc    def    hij    opq    </div>
+<div style="white-space:pre" dir=rtl class="test_move_by_word" title="25 18 11 4 0|0 4 11 18" contenteditable>    abc    אבצ    def    </div>
+<div style="white-space:pre" dir=rtl class="test_move_by_word" title="46 35 32 25 18 7 4 0|0 4 7 18 25 32 35" contenteditable>    abc    def    אבצ    דדפ    hij    opq    </div>
+<div style="white-space:pre" dir=rtl class="test_move_by_word" title="67 49 56 46 39 32 25 7 14 4 0|0 4 14 7 25 32 39 46 56 49" contenteditable>    abc    def    hij    אבצ    דעפ    היח    opq    rst    uvw    </div>
+<div style="white-space:pre" dir=rtl class="test_move_by_word" title="32 25 18 11 4 0|0 4 11 18 25" contenteditable>    אבצ    דעפ    חיח    ופק    </div>
+<div style="white-space:pre" dir=rtl class="test_move_by_word" title="26 18 11 4 0|0 4 11 18" contenteditable>    אבצ    abc    דעפ     </div>
+<div style="white-space:pre" dir=rtl class="test_move_by_word" title="44 37 30 21 18 11 4 0|0 4 11 18 21 30 37" contenteditable>    אבצ    דעפ    abc   def   חיח    ופק    </div>
+<div style="white-space:pre" dir=rtl class="test_move_by_word" title="63 55 48 43 28 34 25 18 11 4 0|0 4 11 18 25 34 28 43 48 55" contenteditable>    אבצ    דעפ    חיח    abc   def   jih   ופק  ופק    רסת     </div>
+
+<!-- test words not separated by spaces -->
+<div style="white-space:pre" contenteditable dir=ltr class="test_move_by_word" title="0 1 2 3 4 9 10 11 17 21|24 21 17 11 10 9 4 3 2 1 0">人一氧喝大    笑抬的     abc def</div>
+
+</div>
+<pre id="console"></pre>
+</body>
+</html>
diff --git a/LayoutTests/editing/selection/move-by-word-visually-others.html b/LayoutTests/editing/selection/move-by-word-visually-others.html
deleted file mode 100644
index abc4d64..0000000
--- a/LayoutTests/editing/selection/move-by-word-visually-others.html
+++ /dev/null
@@ -1,134 +0,0 @@
-<!DOCTYPE HTML>
-<html>
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
-<link rel="stylesheet" type="text/css" href="resources/extend-selection.css" />
-<style>
-.fix_width {font-size: 10px; font-family: sans-serif;}
-</style>
-<script src="resources/move-by-word-visually.js"></script>
-<script>
-
-onload = function() {
-    try {
-        runTest();
-    } finally {
-        flushLog();
-    }
-};
-
-if (window.layoutTestController) 
-    layoutTestController.dumpAsText();
-</script>
-</head>
-<body>
-<div id="testMoveByWord">
-<!-- 
-Title saves the word breaks.
-The format of title is "xxx|xxxx".
-
-The sequence on the left of "|" is word boundaries when moving caret from left to right.
-The sequence on the right of "|" is word boundaries when moving caret from right to left.
-
-If there is a single node in the line, the sequence are offsets.
-If there are multiple nodes in the line, the sequence is array of [anchor_node_id, offset, child_node_index], 
-where child_node_index is optional, default is the first child of the anchor node.
--->
-
-<!-- test multispaces -->
-<div dir=ltr class="test_move_by_word" title="0 4 8 15|18 15 8 4 0" contenteditable>abc def    hij opq</div>
-<div dir=ltr class="test_move_by_word" title="4 8 15 22|28 22 15 8 4" contenteditable>    abc    def    hij    opq    </div>
-<div dir=ltr class="test_move_by_word" title="4 8 15|21 15 8 4" contenteditable>    abc    אבצ    def    </div>
-<div dir=ltr class="test_move_by_word" title="4 8 15 21 29 36|42 36 29 21 15 8 4" contenteditable>    abc    def    אבצ    דדפ    hij    opq    </div>
-<div dir=ltr class="test_move_by_word" title="4 8 15 22 35 28 43 50 57|63 57 50 43 28 35 22 15 8 4" contenteditable>    abc    def    hij    אבצ    דעפ    היח    opq    rst    uvw    </div>
-<div dir=ltr class="test_move_by_word" title="4 21 14 7|28 7 14 21 4" contenteditable>    אבצ    דעפ    חיח    ופק    </div>
-<div dir=ltr class="test_move_by_word" title="4 8 15|21 15 8 4" contenteditable>    אבצ    abc    דעפ     </div>
-<div dir=ltr class="test_move_by_word" title="4 7 15 22 28 33|40 33 28 22 15 7 4" contenteditable>    אבצ    דעפ    abc   def   חיח    ופק    </div>
-<div dir=ltr class="test_move_by_word" title="4 14 7 22 29 35 41 51 46|58 46 51 41 35 29 22 7 14 4" contenteditable>    אבצ    דעפ    חיח    abc   def   jih   ופק  ופק    רסת     </div>
-
-<div dir=ltr class="test_move_by_word" title="0 14 7 3|18 3 7 14 0" contenteditable>אבצ דעפ    היח ופק</div>
-<div dir=ltr class="test_move_by_word" title="0 7 3 12 19 23|26 23 19 12 3 7 0" contenteditable>אבצ דעפ היח    abc def hij</div>
-<div dir=ltr class="test_move_by_word" title="0 4 8 12 22 18 27 34 38|41 38 34 27 18 22 12 8 4 0" contenteditable>abc def hij    אבצ דעפ היח    opq rst uvw</div>
-
-<div dir=rtl class="test_move_by_word" title="18 3 7 14 0|0 14 7 3" contenteditable>abc def    hij opq</div>
-<div dir=rtl class="test_move_by_word" title="28 7 14 21 4|4 21 14 7" contenteditable>    abc    def    hij    opq    </div>
-<div dir=rtl class="test_move_by_word" title="21 15 8 4|4 8 15" contenteditable>    abc    אבצ    def    </div>
-<div dir=rtl class="test_move_by_word" title="42 35 29 22 15 7 4|4 7 15 22 29 35" contenteditable>    abc    def    אבצ    דדפ    hij    opq    </div>
-<div dir=rtl class="test_move_by_word" title="63 49 56 43 36 29 22 7 14 4|4 14 7 22 29 36 43 56 49" contenteditable>    abc    def    hij    אבצ    דעפ    היח    opq    rst    uvw    </div>
-<div dir=rtl class="test_move_by_word" title="28 22 15 8 4|4 8 15 22" contenteditable>    אבצ    דעפ    חיח    ופק    </div>
-<div dir=rtl class="test_move_by_word" title="21 15 8 4|4 8 15" contenteditable>    אבצ    abc    דעפ     </div>
-<div dir=rtl class="test_move_by_word" title="40 34 28 21 15 8 4|4 8 15 21 28 34" contenteditable>    אבצ    דעפ    abc   def   חיח    ופק    </div>
-<div dir=rtl class="test_move_by_word" title="58 52 47 41 28 34 22 15 8 4|4 8 15 22 34 28 41 47 52" contenteditable>    אבצ    דעפ    חיח    abc   def   jih   ופק  ופק    רסת     </div>
-
-<!-- multispaces while preserving spaces -->
-<div style="white-space:pre" dir=ltr class="test_move_by_word" title="0 4 11 15|18 15 11 4 0" contenteditable>abc def    hij opq</div>
-<div style="white-space:pre" dir=ltr class="test_move_by_word" title="0 4 11 18 25|32 25 18 11 4 0" contenteditable>    abc    def    hij    opq    </div>
-<div style="white-space:pre" dir=ltr class="test_move_by_word" title="0 4 11 18|25 18 11 4 0" contenteditable>    abc    אבצ    def    </div>
-<div style="white-space:pre" dir=ltr class="test_move_by_word" title="0 4 11 18 21 32 39|46 39 32 21 18 11 4 0" contenteditable>    abc    def    אבצ    דדפ    hij    opq    </div>
-<div style="white-space:pre" dir=ltr class="test_move_by_word" title="0 4 11 18 25 35 28 46 53 60|67 60 53 46 28 35 25 18 11 4 0" contenteditable>    abc    def    hij    אבצ    דעפ    היח    opq    rst    uvw    </div>
-<div style="white-space:pre" dir=ltr class="test_move_by_word" title="0 4 21 14 7|32 7 14 21 4 0" contenteditable>    אבצ    דעפ    חיח    ופק    </div>
-<div style="white-space:pre" dir=ltr class="test_move_by_word" title="0 4 11 18|26 18 11 4 0" contenteditable>    אבצ    abc    דעפ     </div>
-<div style="white-space:pre" dir=ltr class="test_move_by_word" title="0 4 7 18 24 30 33|44 33 30 24 18 7 4 0" contenteditable>    אבצ    דעפ    abc   def   חיח    ופק    </div>
-<div style="white-space:pre" dir=ltr class="test_move_by_word" title="0 4 14 7 25 31 37 43 51 46|63 46 51 43 37 31 25 7 14 4 0" contenteditable>    אבצ    דעפ    חיח    abc   def   jih   ופק  ופק    רסת     </div>
-
-<div style="white-space:pre" dir=ltr class="test_move_by_word" title="0 14 7 3|18 3 7 14 0" contenteditable>אבצ דעפ    היח ופק</div>
-<div style="white-space:pre" dir=ltr class="test_move_by_word" title="0 7 3 15 19 23|26 23 19 15 3 7 0" contenteditable>אבצ דעפ היח    abc def hij</div>
-<div style="white-space:pre" dir=ltr class="test_move_by_word" title="0 4 8 15 22 18 30 34 38|41 38 34 30 18 22 15 8 4 0" contenteditable>abc def hij    אבצ דעפ היח    opq rst uvw</div>
-
-<div style="white-space:pre" dir=rtl class="test_move_by_word" title="18 3 7 14 0|0 14 7 3" contenteditable>abc def    hij opq</div>
-<div style="white-space:pre" dir=rtl class="test_move_by_word" title="32 7 14 21 4 0|0 4 21 14 7" contenteditable>    abc    def    hij    opq    </div>
-<div style="white-space:pre" dir=rtl class="test_move_by_word" title="25 18 11 4 0|0 4 11 18" contenteditable>    abc    אבצ    def    </div>
-<div style="white-space:pre" dir=rtl class="test_move_by_word" title="46 35 32 25 18 7 4 0|0 4 7 18 25 32 35" contenteditable>    abc    def    אבצ    דדפ    hij    opq    </div>
-<div style="white-space:pre" dir=rtl class="test_move_by_word" title="67 49 56 46 39 32 25 7 14 4 0|0 4 14 7 25 32 39 46 56 49" contenteditable>    abc    def    hij    אבצ    דעפ    היח    opq    rst    uvw    </div>
-<div style="white-space:pre" dir=rtl class="test_move_by_word" title="32 25 18 11 4 0|0 4 11 18 25" contenteditable>    אבצ    דעפ    חיח    ופק    </div>
-<div style="white-space:pre" dir=rtl class="test_move_by_word" title="26 18 11 4 0|0 4 11 18" contenteditable>    אבצ    abc    דעפ     </div>
-<div style="white-space:pre" dir=rtl class="test_move_by_word" title="44 37 30 21 18 11 4 0|0 4 11 18 21 30 37" contenteditable>    אבצ    דעפ    abc   def   חיח    ופק    </div>
-<div style="white-space:pre" dir=rtl class="test_move_by_word" title="63 55 48 43 28 34 25 18 11 4 0|0 4 11 18 25 34 28 43 48 55" contenteditable>    אבצ    דעפ    חיח    abc   def   jih   ופק  ופק    רסת     </div>
-
-<!-- test words not separated by spaces -->
-<div style="white-space:pre" contenteditable dir=ltr class="test_move_by_word" title="0 1 2 3 4 9 10 11 17 21|24 21 17 11 10 9 4 3 2 1 0">人一氧喝大    笑抬的     abc def</div>
-
-<!-- test multi-line -->
-<div><span class="fix_width" id="span_size">אאא אאא</span></div>
-<div contenteditable dir=ltr id="ml_1" class="test_move_by_word fix_width" title="[ml_1, 0][ml_1, 4][ml_1, 8][ml_1, 12][ml_1, 16][ml_1, 0, 5][ml_1, 4, 5][ml_1, 8, 5][ml_1, 12, 5]|[ml_1, 15, 5][ml_1, 12, 5][ml_1, 8, 5][ml_1, 4, 5][ml_1, 0, 5][ml_1, 16][ml_1, 12][ml_1, 8][ml_1, 4][ml_1, 0]">abc def ghi jkl mn <br/><br/><br/>opq rst uvw xyz</div>
-
-<div contenteditable dir=ltr id="ml_2" class="test_move_by_word fix_width" title="[ml_2, 0][ml_2, 4][ml_2, 8][ml_2, 12][ml_2, 16][ml_2, 0, 5][ml_2, 4, 5][ml_2, 8, 5][ml_2, 12, 5]|[ml_2, 15, 5][ml_2, 12, 5][ml_2, 8, 5][ml_2, 4, 5][ml_2, 0, 5][ml_2, 16][ml_2, 12][ml_2, 8][ml_2, 4][ml_2, 0]">abc def ghi jkl mn <div><br/></div><div><br/></div><div><br/></div>opq rst uvw xyz</div>
-
-<div contenteditable dir=ltr id="ml_3" class="test_move_by_word fix_width" title="[ml_3, 0][ml_3, 3][ml_3, 8][ml_3, 11]][ml_3, 0, 5][ml_3, 3, 5][ml_3, 8, 5][ml_3, 11, 5]|[ml_3, 15, 5][ml_3, 11, 5][ml_3, 8, 5][ml_3, 3, 5][ml_3, 0, 5][ml_3, 11][ml_3, 8][ml_3, 3][ml_3, 0]">אאא אאא אאא אאא <br/><br/><br/>אאא אאא אאא אאא</div>
-
-<div contenteditable dir=ltr id="ml_4" class="test_move_by_word fix_width" title="[ml_4, 0][ml_4, 3][ml_4, 8][ml_4, 11][ml_4, 0, 5][ml_4, 3, 5][ml_4, 8, 5][ml_4, 11, 5]|[ml_4, 15, 5][ml_4, 11, 5][ml_4, 8, 5][ml_4, 3, 5][ml_4, 0, 5][ml_4, 11][ml_4, 8][ml_4, 3][ml_4, 0]">אאא אאא אאא אאא <div><br/></div><div><br/></div><div><br/></div>אאא אאא אאא אאא</div>
-
-<div contenteditable dir=ltr id="ml_5" class="test_move_by_word fix_width" title="[ml_5, 1][ml_5, 5][ml_5, 9][ml_5, 12][ml_5, 17][ml_5, 21][ml_5, 25][ml_5, 29][ml_5, 33][ml_5, 0, 5][ml_5, 4, 5][ml_5, 7, 5][ml_5, 11, 5][ml_5, 14, 5][ml_5, 18, 5][ml_5, 22, 5][ml_5, 25, 5]|[ml_5, 25, 5][ml_5, 22, 5][ml_5, 18, 5][ml_5, 14, 5][ml_5, 11, 5][ml_5, 7, 5][ml_5, 4, 5][ml_5, 0, 5][ml_5, 33][ml_5, 29][ml_5, 25][ml_5, 21][ml_5, 17][ml_5, 12][ml_5, 9][ml_5, 5][ml_5, 1]"> abc def אאא אאא hij אאא אאא uvw xyz <br/><br/><br/>אאא kj אאא mn opq אאא אאא</div>
-
-<div contenteditable dir=ltr id="ml_6" class="test_move_by_word fix_width" title="[ml_6, 1][ml_6, 5][ml_6, 9][ml_6, 12][ml_6, 17][ml_6, 21][ml_6, 25][ml_6, 29][ml_6, 33][ml_6, 0, 5][ml_6, 4, 5][ml_6, 7, 5][ml_6, 11, 5][ml_6, 14, 5][ml_6, 18, 5][ml_6, 22, 5][ml_6, 25, 5]|[ml_6, 25, 5][ml_6, 22, 5][ml_6, 18, 5][ml_6, 14, 5][ml_6, 11, 5][ml_6, 7, 5][ml_6, 4, 5][ml_6, 0, 5][ml_6, 33][ml_6, 29][ml_6, 25][ml_6, 21][ml_6, 17][ml_6, 12][ml_6, 9][ml_6, 5][ml_6, 1]"> abc def אאא אאא hij אאא אאא uvw xyz <div><br/></div><div><br/></div><div><br/></div>אאא kj אאא mn opq אאא אאא</div>
-
-
-<div contenteditable dir=rtl id="ml_7" class="test_move_by_word fix_width" title="[ml_7, 15, 5][ml_7, 11, 5][ml_7, 8, 5][ml_7, 3, 5][ml_7, 0, 5][ml_7, 16][ml_7, 11][ml_7, 8][ml_7, 3][ml_7, 0]|[ml_7, 0][ml_7, 3][ml_7, 8][ml_7, 11][ml_7, 16][ml_7, 0, 5][ml_7, 3, 5][ml_7, 8, 5][ml_7, 11, 5]">abc def ghi jkl mn <br/><br/><br/>opq rst uvw xyz</div>
-
-<div contenteditable dir=rtl id="ml_8" class="test_move_by_word fix_width" title="[ml_8, 15, 5][ml_8, 11, 5][ml_8, 8, 5][ml_8, 3, 5][ml_8, 0, 5][ml_8, 18][ml_8, 16][ml_8, 11][ml_8, 8][ml_8, 3][ml_8, 0]|[ml_8, 0][ml_8, 3][ml_8, 8][ml_8, 11][ml_8, 16][ml_8, 18][ml_8, 0, 5][ml_8, 3, 5][ml_8, 8, 5][ml_8, 11, 5]">abc def ghi jkl mn <div><br/></div><div><br/></div><div><br/></div>opq rst uvw xyz</div>
-
-<div contenteditable dir=rtl id="ml_9" class="test_move_by_word fix_width" title="[ml_9, 15, 5][ml_9, 12, 5][ml_9, 8, 5][ml_9, 4, 5][ml_9, 0, 5][ml_9, 12][ml_9, 8][ml_9, 4][ml_9, 0]|[ml_9, 0][ml_9, 4][ml_9, 8][ml_9, 12][ml_9, 0, 5][ml_9, 4, 5][ml_9, 8, 5][ml_9, 12, 5]">אאא אאא אאא אאא <br/><br/><br/>אאא אאא אאא אאא</div>
-
-<div contenteditable dir=rtl id="ml_10" class="test_move_by_word fix_width" title="[ml_10, 15, 5][ml_10, 12, 5][ml_10, 8, 5][ml_10, 4, 5][ml_10, 0, 5][ml_10, 12][ml_10, 8][ml_10, 4][ml_10, 0]|[ml_10, 0][ml_10, 4][ml_10, 8][ml_10, 12][ml_10, 0, 5][ml_10, 4, 5][ml_10, 8, 5][ml_10, 12, 5]">אאא אאא אאא אאא <div><br/></div><div><br/></div><div><br/></div>אאא אאא אאא אאא</div>
-
-<div contenteditable dir=rtl id="ml_11" class="test_move_by_word fix_width" title="
-[ml_11, 25, 5][ml_11, 22, 5][ml_11, 18, 5][ml_11, 14, 5][ml_11, 11, 5][ml_11, 7, 5][ml_11, 4, 5][ml_11, 0, 5][ml_11, 33][ml_11, 29][ml_11, 25][ml_11, 21][ml_11, 17][ml_11, 13][ml_11, 9][ml_11, 4][ml_11, 1]|[ml_11, 1][ml_11, 4][ml_11, 9][ml_11, 13][ml_11, 17][ml_11, 21][ml_11, 25][ml_11, 29][ml_11, 33][ml_11, 0, 5][ml_11, 4, 5][ml_11, 7, 5][ml_11, 11, 5][ml_11, 14, 5][ml_11, 18, 5][ml_11, 22, 5]
-"> abc def אאא אאא hij אאא אאא uvw xyz <br/><br/><br/>אאא kj אאא mn opq אאא אאא</div>
-
-<div contenteditable dir=rtl id="ml_12" class="test_move_by_word fix_width" title="
-[ml_12, 25, 5][ml_12, 22, 5][ml_12, 18, 5][ml_12, 14, 5][ml_12, 11, 5][ml_12, 7, 5][ml_12, 4, 5][ml_12, 0, 5][ml_12, 36][ml_12, 33][ml_12, 29][ml_12, 25][ml_12, 21][ml_12, 17][ml_12, 13][ml_12, 9][ml_12, 4][ml_12, 1]|[ml_12, 1][ml_12, 4][ml_12, 9][ml_12, 13][ml_12, 17][ml_12, 21][ml_12, 25][ml_12, 29][ml_12, 33][ml_12, 36][ml_12, 0, 5][ml_12, 4, 5][ml_12, 7, 5][ml_12, 11, 5][ml_12, 14, 5][ml_12, 18, 5][ml_12, 22, 5]
-"> abc def אאא אאא hij אאא אאא uvw xyz <div><br/></div><div><br/></div><div><br/></div>אאא kj אאא mn opq אאא אאא</div>
-
-<!-- mixed editability -->
-<div dir=ltr class="test_move_by_word" title="0 4|8 5 1">abc def <span contenteditable> inside span </span> hij opq</div>
-
-<div class="test_move_by_word" contenteditable dir=ltr title="0|0"></div>
-
-<div contenteditable>
-00<base dir=ltr class="test_move_by_word" title="3|3 1">
-</div>
-
-</div>
-<pre id="console"></pre>
-</body>
-</html>
diff --git a/LayoutTests/editing/selection/move-by-word-visually-single-space-sigle-line-expected.txt b/LayoutTests/editing/selection/move-by-word-visually-single-space-inline-element-expected.txt
similarity index 73%
rename from LayoutTests/editing/selection/move-by-word-visually-single-space-sigle-line-expected.txt
rename to LayoutTests/editing/selection/move-by-word-visually-single-space-inline-element-expected.txt
index 5285cd0..3fe5e18 100644
--- a/LayoutTests/editing/selection/move-by-word-visually-single-space-sigle-line-expected.txt
+++ b/LayoutTests/editing/selection/move-by-word-visually-single-space-inline-element-expected.txt
@@ -2,100 +2,20 @@
 ======== Move By Word ====
 Test 1, LTR:
 Move right by one word
-"abc def hij opq rst"[0, 4, 8, 12, 16]
-Move left by one word
-"abc def hij opq rst"[19, 16, 12, 8, 4, 0]
-Test 2, RTL:
-Move left by one word
-"abc def hij opq rst"[0, 15, 11, 7, 3]
-Move right by one word
-"abc def hij opq rst"[19, 3, 7, 11, 15, 0]
-Test 3, LTR:
-Move right by one word
-"ZZZ QQQ BBB CCC XXX"[0, 15, 11, 7, 3]
-Move left by one word
-"ZZZ QQQ BBB CCC XXX"[19, 3, 7, 11, 15, 0]
-Test 4, RTL:
-Move left by one word
-"ZZZ QQQ BBB CCC XXX"[0, 4, 8, 12, 16]
-Move right by one word
-"ZZZ QQQ BBB CCC XXX"[19, 16, 12, 8, 4, 0]
-Test 5, LTR:
-Move right by one word
-"abc def hij AAA BBB WWW opr uvw xyz"[0, 4, 8, 12, 19, 15, 24, 28, 32]
-Move left by one word
-"abc def hij AAA BBB WWW opr uvw xyz"[35, 32, 28, 24, 15, 19, 12, 8, 4, 0]
-Test 6, RTL:
-Move left by one word
-"abc def hij AAA BBB WWW opr uvw xyz"[0, 7, 3, 12, 16, 20, 24, 31, 27]
-Move right by one word
-"abc def hij AAA BBB WWW opr uvw xyz"[35, 27, 31, 24, 20, 16, 12, 3, 7, 0]
-Test 7, LTR:
-Move right by one word
-"abc def ZQB RIG uvw xyz"[0, 4, 8, 11, 16, 20]
-Move left by one word
-"abc def ZQB RIG uvw xyz"[23, 20, 16, 11, 8, 4, 0]
-Test 8, RTL:
-Move left by one word
-"abc def ZQB RIG uvw xyz"[0, 3, 8, 12, 16, 19]
-Move right by one word
-"abc def ZQB RIG uvw xyz"[23, 19, 16, 12, 8, 3, 0]
-Test 9, LTR:
-Move right by one word
-"aaa AAA bbb"[0, 4, 8]
-Move left by one word
-"aaa AAA bbb"[11, 8, 4, 0]
-Test 10, RTL:
-Move left by one word
-"aaa AAA bbb"[0, 4, 8, 11]
-Move right by one word
-"aaa AAA bbb"[11, 8, 4, 0]
-Test 11, LTR:
-Move right by one word
-"AAA BBB WWW aaa bbb ccc DDD SSS UUU"[0, 7, 3, 12, 16, 20, 24, 31, 27]
-Move left by one word
-"AAA BBB WWW aaa bbb ccc DDD SSS UUU"[35, 27, 31, 24, 20, 16, 12, 3, 7, 0]
-Test 12, RTL:
-Move left by one word
-"AAA BBB WWW aaa bbb ccc DDD SSS UUU"[0, 4, 8, 12, 19, 15, 24, 28, 32]
-Move right by one word
-"AAA BBB WWW aaa bbb ccc DDD SSS UUU"[35, 32, 28, 24, 15, 19, 12, 8, 4, 0]
-Test 13, LTR:
-Move right by one word
-"AAA BBB aaa bbb WWW DDD"[0, 3, 8, 12, 16, 19]
-Move left by one word
-"AAA BBB aaa bbb WWW DDD"[23, 19, 16, 12, 8, 3, 0]
-Test 14, RTL:
-Move left by one word
-"AAA BBB aaa bbb WWW DDD"[0, 4, 8, 11, 16, 20]
-Move right by one word
-"AAA BBB aaa bbb WWW DDD"[23, 20, 16, 11, 8, 4, 0]
-Test 15, LTR:
-Move right by one word
-"ZQB abc RIG"[0, 4, 8, 11]
-Move left by one word
-"ZQB abc RIG"[11, 8, 4, 0]
-Test 16, RTL:
-Move left by one word
-"ZQB abc RIG"[0, 4, 8]
-Move right by one word
-"ZQB abc RIG"[11, 8, 4, 0]
-Test 17, LTR:
-Move right by one word
 "AAA "[0, 3]
 Move left by one word
 "BB"[2], "AAA "[3, 0]
-Test 18, RTL:
+Test 2, RTL:
 Move left by one word
 "AAA "[0, 4]
 Move right by one word
 "BB"[2], "AAA "[4, 0]
-Test 19, LTR:
+Test 3, LTR:
 Move right by one word
 "abc def "[0, 4, 8], "hij opq"[4], " rst uvw"[1, 5]
 Move left by one word
 " rst uvw"[8, 5, 1], "hij opq"[4], "abc def "[8, 4, 0]
-Test 20, RTL:
+Test 4, RTL:
 Move left by one word
 "abc def "[0], " rst uvw"[4], "hij opq"[3], "abc def "[7, 3]    FAIL expected: ["abc def "[ 0, ]" rst uvw"[ 4, ]"hij opq"[ 7,  3, ]"abc def "[ 7,  3]
 " rst uvw"[4], "hij opq"[3]   FAIL expected "hij opq"[ 7]
@@ -108,7 +28,7 @@
 "hij opq"[4], " rst uvw"[4]   FAIL expected "hij opq"[ 7]
 "hij opq"[5], " rst uvw"[4]   FAIL expected "hij opq"[ 7]
 "hij opq"[6], " rst uvw"[4]   FAIL expected "hij opq"[ 7]
-Test 21, RTL:
+Test 5, RTL:
 Move left by one word
 "abc def "[0], " rst uvw"[4], "hij opq"[3], "abc def "[7, 3]    FAIL expected: ["abc def "[ 0, ]" rst uvw"[ 4, ]"hij opq"[ 7,  3, ]"abc def "[ 7,  3]
 " rst uvw"[4], "hij opq"[3]   FAIL expected "hij opq"[ 7]
@@ -121,37 +41,37 @@
 "hij opq"[4], " rst uvw"[4]   FAIL expected "hij opq"[ 7]
 "hij opq"[5], " rst uvw"[4]   FAIL expected "hij opq"[ 7]
 "hij opq"[6], " rst uvw"[4]   FAIL expected "hij opq"[ 7]
-Test 22, LTR:
+Test 6, LTR:
 Move right by one word
 "abc def "[0, 4, 8], "hij opq"[4], " rst uvw"[1, 5]
 Move left by one word
 " rst uvw"[8, 5, 1], "hij opq"[4], "abc def "[8, 4, 0]
-Test 23, RTL:
+Test 7, RTL:
 Move left by one word
 "ABD DSU "[0, 4, 8], "EJH FUX"[4], "FFZ LIG"[4]
 Move right by one word
 "FFZ LIG"[7, 4], "EJH FUX"[4], "ABD DSU "[8, 4, 0]
-Test 24, LTR:
+Test 8, LTR:
 Move right by one word
 "ABD DSU "[0], "FFZ LIG"[3], "EJH FUX"[3], "ABD DSU "[7, 3]
 Move left by one word
 "FFZ LIG"[7], "ABD DSU "[3, 7], "EJH FUX"[3], "FFZ LIG"[3], "ABD DSU "[0]
-Test 25, RTL:
+Test 9, RTL:
 Move left by one word
 "ABD DSU "[0, 4, 8], "EJH FUX"[4], "FFZ LIG"[4]
 Move right by one word
 "FFZ LIG"[7, 4], "EJH FUX"[4], "ABD DSU "[8, 4, 0]
-Test 26, LTR:
+Test 10, LTR:
 Move right by one word
 "ABD DSU "[0], "FFZ LIG"[3], "EJH FUX"[3], "ABD DSU "[7, 3]
 Move left by one word
 "FFZ LIG"[7], "ABD DSU "[3, 7], "EJH FUX"[3], "FFZ LIG"[3], "ABD DSU "[0]
-Test 27, RTL:
+Test 11, RTL:
 Move left by one word
 "ABD DSU "[0, 4, 8], "abc def"[3], "FFZ LIG"[4]
 Move right by one word
 "FFZ LIG"[7, 4], "abc def"[3], "ABD DSU "[8, 4, 0]
-Test 28, LTR:
+Test 12, LTR:
 Move right by one word
 "ABD DSU "[0], "FFZ LIG"[3], "ABD DSU "[8], "abc def"[4], "ABD DSU "[7, 3]
 Move left by one word
@@ -160,17 +80,17 @@
 "FFZ LIG"[4, 4]   FAIL expected "ABD DSU "[ 0]
 "FFZ LIG"[5, 5]   FAIL expected "ABD DSU "[ 0]
 "FFZ LIG"[6, 6]   FAIL expected "ABD DSU "[ 0]
-Test 29, RTL:
+Test 13, RTL:
 Move left by one word
 "ABD DSU "[0, 4, 8], "abc def"[3], "FFZ LIG"[4]
 Move right by one word
 "FFZ LIG"[7, 4], "abc def"[3], "ABD DSU "[8, 4, 0]
-Test 30, LTR:
+Test 14, LTR:
 Move right by one word
 "ABD DSU "[0, 3, 8], "abc def"[4], "FFZ LIG"[3]
 Move left by one word
 "FFZ LIG"[7, 3], "abc def"[4], "ABD DSU "[8, 3, 0]
-Test 31, RTL:
+Test 15, RTL:
 Move left by one word
 "ABD opq DSU "[0, 4, 8, 12], "abc AAA def"[8, 4, 3], "FFZ rst LIG"[4, 8]    FAIL expected: ["ABD opq DSU "[ 0,  4,  8,  12, ]"abc AAA def"[ 4,  3, ]"FFZ rst LIG"[ 4,  8]
 "ABD opq DSU "[12], "abc AAA def"[8]   FAIL expected "abc AAA def"[ 4]
@@ -179,7 +99,7 @@
 Move right by one word
 "FFZ rst LIG"[11, 8, 4], "abc AAA def"[3, 4, 8], "ABD opq DSU "[12, 8, 4, 0]    FAIL expected: ["FFZ rst LIG"[ 11,  8,  4, ]"abc AAA def"[ 3,  4, ]"ABD opq DSU "[ 12,  8,  4,  0]
 "abc AAA def"[4, 8]   FAIL expected "ABD opq DSU "[ 12]
-Test 32, LTR:
+Test 16, LTR:
 Move right by one word
 "ABD opq DSU "[0, 4], "abc AAA def"[8, 4], "ABD opq DSU "[12, 11], "FFZ rst LIG"[4, 8, 11]    FAIL expected: ["ABD opq DSU "[ 0,  4,  8, ]"abc AAA def"[ 8,  7, ]"ABD opq DSU "[ 12,  11, ]"FFZ rst LIG"[ 4,  8,  11]
 "ABD opq DSU "[4], "abc AAA def"[8]   FAIL expected "ABD opq DSU "[ 8]
@@ -198,22 +118,22 @@
 "abc AAA def"[8], "ABD opq DSU "[4]   FAIL expected "ABD opq DSU "[ 8]
 "FFZ rst LIG"[1], "ABD opq DSU "[4]   FAIL expected "ABD opq DSU "[ 8]
 "FFZ rst LIG"[2], "ABD opq DSU "[4]   FAIL expected "ABD opq DSU "[ 8]
-Test 33, RTL:
+Test 17, RTL:
 Move left by one word
 "ABD opq DSU "[0, 4, 8, 12], "abc AAA def"[4, 8], "FFZ rst LIG"[4, 8]
 Move right by one word
 "FFZ rst LIG"[11, 8, 4], "abc AAA def"[8, 4], "ABD opq DSU "[12, 8, 4, 0]
-Test 34, LTR:
+Test 18, LTR:
 Move right by one word
 "ABD opq DSU "[0, 4, 8, 12], "abc AAA def"[4, 8], "FFZ rst LIG"[4, 8, 11]
 Move left by one word
 "FFZ rst LIG"[11, 8, 4], "abc AAA def"[8, 4], "ABD opq DSU "[12, 8, 4, 0]
-Test 35, LTR:
+Test 19, LTR:
 Move right by one word
 "aaa "[0, 4], "bbb AAA "[4, 7]
 Move left by one word
 "FFZ"[3], "bbb AAA "[7, 4], "aaa "[4, 0]
-Test 36, RTL:
+Test 20, RTL:
 Move left by one word
 "ABD opq rst DSU "[0, 4, 7, 12, 16], "abc uvw AAA def lmn"[12, 8, 7, 3], "ABW hij xyz FXX"[4, 7, 12]    FAIL expected: ["ABD opq rst DSU "[ 0,  4,  7,  12,  16, ]"abc uvw AAA def lmn"[ 15,  8,  7,  3, ]"ABW hij xyz FXX"[ 4,  7,  12]
 "ABD opq rst DSU "[16], "abc uvw AAA def lmn"[12]   FAIL expected "abc uvw AAA def lmn"[ 15]
diff --git a/LayoutTests/editing/selection/move-by-word-visually-single-space-sigle-line.html b/LayoutTests/editing/selection/move-by-word-visually-single-space-inline-element.html
similarity index 76%
rename from LayoutTests/editing/selection/move-by-word-visually-single-space-sigle-line.html
rename to LayoutTests/editing/selection/move-by-word-visually-single-space-inline-element.html
index 5b79eec..977605e 100644
--- a/LayoutTests/editing/selection/move-by-word-visually-single-space-sigle-line.html
+++ b/LayoutTests/editing/selection/move-by-word-visually-single-space-inline-element.html
@@ -34,35 +34,6 @@
 If there are multiple nodes in the line, the sequence is array of [anchor_node_id, offset, child_node_index], 
 where child_node_index is optional, default is the first child of the anchor node.
 -->
-<!-- pure English -->
-<div dir=ltr class="test_move_by_word" title="0 4 8 12 16|19 16 12 8 4 0" contenteditable>abc def hij opq rst</div>
-<div dir=rtl class="test_move_by_word" title="19 3 7 11 15 0|0 15 11 7 3" contenteditable>abc def hij opq rst</div>
-
-<!-- pure Hebrew -->
-<div dir=ltr class="test_move_by_word" title="0 15 11 7 3|19 3 7 11 15 0" contenteditable>ששש נננ בבב גגג קקק</div>
-<div dir=rtl class="test_move_by_word" title="19 16 12 8 4 0|0 4 8 12 16" contenteditable>ששש נננ בבב גגג קקק</div>
-
-<!-- bidi text -->
-<!-- English Hebrew English -->
-<div dir=ltr class="test_move_by_word" title="0 4 8 12 19 15 24 28 32|35 32 28 24 15 19 12 8 4 0" contenteditable>abc def hij אאא בבב צצצ opr uvw xyz</div>
-<div dir=rtl class="test_move_by_word" title="35 27 31 24 20 16 12 3 7 0|0 7 3 12 16 20 24 31 27" contenteditable>abc def hij אאא בבב צצצ opr uvw xyz</div>
-
-<div dir=ltr class="test_move_by_word" title="0 4 8 11 16 20|23 20 16 11 8 4 0" contenteditable>abc def שנב סטז uvw xyz</div>
-<div dir=rtl class="test_move_by_word" title="23 19 16 12 8 3 0|0 3 8 12 16 19" contenteditable>abc def שנב סטז uvw xyz</div>
-
-<div dir=ltr class="test_move_by_word" title="0 4 8|11 8 4 0" contenteditable>aaa אאא bbb</div>
-<div dir=rtl class="test_move_by_word" title="11 8 4 0|0 4 8 11" contenteditable>aaa אאא bbb</div>
-
-<!-- Hebrew English Hebrew -->
-<div dir=ltr class="test_move_by_word" title="0 7 3 12 16 20 24 31 27|35 27 31 24 20 16 12 3 7 0" contenteditable>אאא בבב צצצ aaa bbb ccc דדד עעע פפפ</div>
-<div dir=rtl class="test_move_by_word" title="35 32 28 24 15 19 12 8 4 0|0 4 8 12 19 15 24 28 32" contenteditable>אאא בבב צצצ aaa bbb ccc דדד עעע פפפ</div>
-
-<div dir=ltr class="test_move_by_word" title="0 3 8 12 16 19|23 19 16 12 8 3 0" contenteditable>אאא בבב aaa bbb צצצ דדד</div>
-<div dir=rtl class="test_move_by_word" title="23 20 16 11 8 4 0|0 4 8 11 16 20" contenteditable>אאא בבב aaa bbb צצצ דדד</div>
-
-<div dir=ltr class="test_move_by_word" title="0 4 8 11|11 8 4 0" contenteditable>שנב abc סטז</div>
-<div dir=rtl class="test_move_by_word" title="11 8 4 0|0 4 8" contenteditable>שנב abc סטז</div>
-
 <!-- Inline element -->
 <div dir=ltr id="d_1" class="test_move_by_word" title="[d_1, 0][d_1, 3]|[s_1, 2][d_1, 3][d_1,0]" contenteditable>אאא <span id="s_1">בב</span></div>
 <div dir=rtl id="d_2" class="test_move_by_word" title="[s_2, 2][d_2, 4][d_2, 0]|[d_2, 0][d_2, 4]" contenteditable>אאא <span id="s_2">בב</span></div>
diff --git a/LayoutTests/editing/selection/move-by-word-visually-single-space-one-element-expected.txt b/LayoutTests/editing/selection/move-by-word-visually-single-space-one-element-expected.txt
new file mode 100644
index 0000000..9a8b7b6
--- /dev/null
+++ b/LayoutTests/editing/selection/move-by-word-visually-single-space-one-element-expected.txt
@@ -0,0 +1,83 @@
+
+======== Move By Word ====
+Test 1, LTR:
+Move right by one word
+"abc def hij opq rst"[0, 4, 8, 12, 16]
+Move left by one word
+"abc def hij opq rst"[19, 16, 12, 8, 4, 0]
+Test 2, RTL:
+Move left by one word
+"abc def hij opq rst"[0, 15, 11, 7, 3]
+Move right by one word
+"abc def hij opq rst"[19, 3, 7, 11, 15, 0]
+Test 3, LTR:
+Move right by one word
+"ZZZ QQQ BBB CCC XXX"[0, 15, 11, 7, 3]
+Move left by one word
+"ZZZ QQQ BBB CCC XXX"[19, 3, 7, 11, 15, 0]
+Test 4, RTL:
+Move left by one word
+"ZZZ QQQ BBB CCC XXX"[0, 4, 8, 12, 16]
+Move right by one word
+"ZZZ QQQ BBB CCC XXX"[19, 16, 12, 8, 4, 0]
+Test 5, LTR:
+Move right by one word
+"abc def hij AAA BBB WWW opr uvw xyz"[0, 4, 8, 12, 19, 15, 24, 28, 32]
+Move left by one word
+"abc def hij AAA BBB WWW opr uvw xyz"[35, 32, 28, 24, 15, 19, 12, 8, 4, 0]
+Test 6, RTL:
+Move left by one word
+"abc def hij AAA BBB WWW opr uvw xyz"[0, 7, 3, 12, 16, 20, 24, 31, 27]
+Move right by one word
+"abc def hij AAA BBB WWW opr uvw xyz"[35, 27, 31, 24, 20, 16, 12, 3, 7, 0]
+Test 7, LTR:
+Move right by one word
+"abc def ZQB RIG uvw xyz"[0, 4, 8, 11, 16, 20]
+Move left by one word
+"abc def ZQB RIG uvw xyz"[23, 20, 16, 11, 8, 4, 0]
+Test 8, RTL:
+Move left by one word
+"abc def ZQB RIG uvw xyz"[0, 3, 8, 12, 16, 19]
+Move right by one word
+"abc def ZQB RIG uvw xyz"[23, 19, 16, 12, 8, 3, 0]
+Test 9, LTR:
+Move right by one word
+"aaa AAA bbb"[0, 4, 8]
+Move left by one word
+"aaa AAA bbb"[11, 8, 4, 0]
+Test 10, RTL:
+Move left by one word
+"aaa AAA bbb"[0, 4, 8, 11]
+Move right by one word
+"aaa AAA bbb"[11, 8, 4, 0]
+Test 11, LTR:
+Move right by one word
+"AAA BBB WWW aaa bbb ccc DDD SSS UUU"[0, 7, 3, 12, 16, 20, 24, 31, 27]
+Move left by one word
+"AAA BBB WWW aaa bbb ccc DDD SSS UUU"[35, 27, 31, 24, 20, 16, 12, 3, 7, 0]
+Test 12, RTL:
+Move left by one word
+"AAA BBB WWW aaa bbb ccc DDD SSS UUU"[0, 4, 8, 12, 19, 15, 24, 28, 32]
+Move right by one word
+"AAA BBB WWW aaa bbb ccc DDD SSS UUU"[35, 32, 28, 24, 15, 19, 12, 8, 4, 0]
+Test 13, LTR:
+Move right by one word
+"AAA BBB aaa bbb WWW DDD"[0, 3, 8, 12, 16, 19]
+Move left by one word
+"AAA BBB aaa bbb WWW DDD"[23, 19, 16, 12, 8, 3, 0]
+Test 14, RTL:
+Move left by one word
+"AAA BBB aaa bbb WWW DDD"[0, 4, 8, 11, 16, 20]
+Move right by one word
+"AAA BBB aaa bbb WWW DDD"[23, 20, 16, 11, 8, 4, 0]
+Test 15, LTR:
+Move right by one word
+"ZQB abc RIG"[0, 4, 8, 11]
+Move left by one word
+"ZQB abc RIG"[11, 8, 4, 0]
+Test 16, RTL:
+Move left by one word
+"ZQB abc RIG"[0, 4, 8]
+Move right by one word
+"ZQB abc RIG"[11, 8, 4, 0]
+
diff --git a/LayoutTests/editing/selection/move-by-word-visually-single-space-one-element.html b/LayoutTests/editing/selection/move-by-word-visually-single-space-one-element.html
new file mode 100644
index 0000000..ec00e76
--- /dev/null
+++ b/LayoutTests/editing/selection/move-by-word-visually-single-space-one-element.html
@@ -0,0 +1,69 @@
+<!DOCTYPE HTML>
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<link rel="stylesheet" type="text/css" href="resources/extend-selection.css" />
+<style>
+test_move_by_word {display: none;}
+</style>
+<script src="resources/move-by-word-visually.js"></script>
+<script>
+
+onload = function() {
+    try {
+        runTest();
+    } finally {
+        flushLog();
+    }
+};
+
+if (window.layoutTestController) 
+    layoutTestController.dumpAsText();
+</script>
+</head>
+<body>
+<div id="testMoveByWord">
+<!-- 
+Title saves the word breaks.
+The format of title is "xxx|xxxx".
+
+The sequence on the left of "|" is word boundaries when moving caret from left to right.
+The sequence on the right of "|" is word boundaries when moving caret from right to left.
+
+If there is a single node in the line, the sequence are offsets.
+If there are multiple nodes in the line, the sequence is array of [anchor_node_id, offset, child_node_index], 
+where child_node_index is optional, default is the first child of the anchor node.
+-->
+<!-- pure English -->
+<div dir=ltr class="test_move_by_word" title="0 4 8 12 16|19 16 12 8 4 0" contenteditable>abc def hij opq rst</div>
+<div dir=rtl class="test_move_by_word" title="19 3 7 11 15 0|0 15 11 7 3" contenteditable>abc def hij opq rst</div>
+
+<!-- pure Hebrew -->
+<div dir=ltr class="test_move_by_word" title="0 15 11 7 3|19 3 7 11 15 0" contenteditable>ששש נננ בבב גגג קקק</div>
+<div dir=rtl class="test_move_by_word" title="19 16 12 8 4 0|0 4 8 12 16" contenteditable>ששש נננ בבב גגג קקק</div>
+
+<!-- bidi text -->
+<!-- English Hebrew English -->
+<div dir=ltr class="test_move_by_word" title="0 4 8 12 19 15 24 28 32|35 32 28 24 15 19 12 8 4 0" contenteditable>abc def hij אאא בבב צצצ opr uvw xyz</div>
+<div dir=rtl class="test_move_by_word" title="35 27 31 24 20 16 12 3 7 0|0 7 3 12 16 20 24 31 27" contenteditable>abc def hij אאא בבב צצצ opr uvw xyz</div>
+
+<div dir=ltr class="test_move_by_word" title="0 4 8 11 16 20|23 20 16 11 8 4 0" contenteditable>abc def שנב סטז uvw xyz</div>
+<div dir=rtl class="test_move_by_word" title="23 19 16 12 8 3 0|0 3 8 12 16 19" contenteditable>abc def שנב סטז uvw xyz</div>
+
+<div dir=ltr class="test_move_by_word" title="0 4 8|11 8 4 0" contenteditable>aaa אאא bbb</div>
+<div dir=rtl class="test_move_by_word" title="11 8 4 0|0 4 8 11" contenteditable>aaa אאא bbb</div>
+
+<!-- Hebrew English Hebrew -->
+<div dir=ltr class="test_move_by_word" title="0 7 3 12 16 20 24 31 27|35 27 31 24 20 16 12 3 7 0" contenteditable>אאא בבב צצצ aaa bbb ccc דדד עעע פפפ</div>
+<div dir=rtl class="test_move_by_word" title="35 32 28 24 15 19 12 8 4 0|0 4 8 12 19 15 24 28 32" contenteditable>אאא בבב צצצ aaa bbb ccc דדד עעע פפפ</div>
+
+<div dir=ltr class="test_move_by_word" title="0 3 8 12 16 19|23 19 16 12 8 3 0" contenteditable>אאא בבב aaa bbb צצצ דדד</div>
+<div dir=rtl class="test_move_by_word" title="23 20 16 11 8 4 0|0 4 8 11 16 20" contenteditable>אאא בבב aaa bbb צצצ דדד</div>
+
+<div dir=ltr class="test_move_by_word" title="0 4 8 11|11 8 4 0" contenteditable>שנב abc סטז</div>
+<div dir=rtl class="test_move_by_word" title="11 8 4 0|0 4 8" contenteditable>שנב abc סטז</div>
+
+</div>
+<pre id="console"></pre>
+</body>
+</html>
diff --git a/LayoutTests/platform/chromium/test_expectations.txt b/LayoutTests/platform/chromium/test_expectations.txt
index 2bbe7a0..bf51abc 100644
--- a/LayoutTests/platform/chromium/test_expectations.txt
+++ b/LayoutTests/platform/chromium/test_expectations.txt
@@ -3891,5 +3891,3 @@
 
 BUGWK65219 WIN : webaudio/test-basic.html = PASS CRASH
 
-BUGWK65241 DEBUG : editing/selection/move-by-word-visually-others.html = TIMEOUT PASS
-BUGWK65241 DEBUG : editing/selection/move-by-word-visually-single-space-sigle-line.html = TIMEOUT PASS
diff --git a/LayoutTests/platform/qt/Skipped b/LayoutTests/platform/qt/Skipped
index 47d15dc..cfb94b0 100644
--- a/LayoutTests/platform/qt/Skipped
+++ b/LayoutTests/platform/qt/Skipped
@@ -2382,8 +2382,11 @@
 fast/url/idna2008.html
 
 # https://bugs.webkit.org/show_bug.cgi?id=59265
-editing/selection/move-by-word-visually-others.html
-editing/selection/move-by-word-visually-single-space-sigle-line.html
+editing/selection/move-by-word-visually-multi-line.html
+editing/selection/move-by-word-visually-multi-space.html
+editing/selection/move-by-word-visually-null-box.html
+editing/selection/move-by-word-visually-single-space-inline-element.html
+editing/selection/move-by-word-visually-single-space-one-element.html
 
 # [Qt] New tests introduced in r84742 fail
 # https://bugs.webkit.org/show_bug.cgi?id=59334