corinthia-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pmke...@apache.org
Subject [27/92] [abbrv] [partial] incubator-corinthia git commit: Add editing code from UX Write
Date Wed, 17 Dec 2014 13:28:37 GMT
http://git-wip-us.apache.org/repos/asf/incubator-corinthia/blob/03bd5af0/Editor/tests/dom/splitAroundSelection06-input.html
----------------------------------------------------------------------
diff --git a/Editor/tests/dom/splitAroundSelection06-input.html b/Editor/tests/dom/splitAroundSelection06-input.html
new file mode 100644
index 0000000..3691170
--- /dev/null
+++ b/Editor/tests/dom/splitAroundSelection06-input.html
@@ -0,0 +1,15 @@
+<!DOCTYPE html>
+<html>
+<head>
+<script>
+function performTest()
+{
+    var b = document.getElementsByTagName("B")[0];
+    var range = new Range(b.firstChild,4,b.firstChild,4);
+    Formatting_splitAroundSelection(range);
+    showRangeAsBrackets(range);
+}
+</script>
+</head>
+<body><p>One <b>Two Three Four</b> Five</p></body>
+</html>

http://git-wip-us.apache.org/repos/asf/incubator-corinthia/blob/03bd5af0/Editor/tests/dom/splitAroundSelection07-expected.html
----------------------------------------------------------------------
diff --git a/Editor/tests/dom/splitAroundSelection07-expected.html b/Editor/tests/dom/splitAroundSelection07-expected.html
new file mode 100644
index 0000000..3321d81
--- /dev/null
+++ b/Editor/tests/dom/splitAroundSelection07-expected.html
@@ -0,0 +1,11 @@
+<html>
+  <head></head>
+  <body>
+    <p>
+      One
+      <b>Two Three Four</b>
+      <b>[]</b>
+      Five
+    </p>
+  </body>
+</html>

http://git-wip-us.apache.org/repos/asf/incubator-corinthia/blob/03bd5af0/Editor/tests/dom/splitAroundSelection07-input.html
----------------------------------------------------------------------
diff --git a/Editor/tests/dom/splitAroundSelection07-input.html b/Editor/tests/dom/splitAroundSelection07-input.html
new file mode 100644
index 0000000..32a4b62
--- /dev/null
+++ b/Editor/tests/dom/splitAroundSelection07-input.html
@@ -0,0 +1,15 @@
+<!DOCTYPE html>
+<html>
+<head>
+<script>
+function performTest()
+{
+    var b = document.getElementsByTagName("B")[0];
+    var range = new Range(b.firstChild,14,b.firstChild,14);
+    Formatting_splitAroundSelection(range);
+    showRangeAsBrackets(range);
+}
+</script>
+</head>
+<body><p>One <b>Two Three Four</b> Five</p></body>
+</html>

http://git-wip-us.apache.org/repos/asf/incubator-corinthia/blob/03bd5af0/Editor/tests/dom/splitAroundSelection08-expected.html
----------------------------------------------------------------------
diff --git a/Editor/tests/dom/splitAroundSelection08-expected.html b/Editor/tests/dom/splitAroundSelection08-expected.html
new file mode 100644
index 0000000..9b00e16
--- /dev/null
+++ b/Editor/tests/dom/splitAroundSelection08-expected.html
@@ -0,0 +1,14 @@
+<html>
+  <head></head>
+  <body>
+    <p>
+      One
+      <b>Two</b>
+      <b>[Three Four</b>
+      Five
+      <b>Six Seven]</b>
+      <b>Eight</b>
+      Nine
+    </p>
+  </body>
+</html>

http://git-wip-us.apache.org/repos/asf/incubator-corinthia/blob/03bd5af0/Editor/tests/dom/splitAroundSelection08-input.html
----------------------------------------------------------------------
diff --git a/Editor/tests/dom/splitAroundSelection08-input.html b/Editor/tests/dom/splitAroundSelection08-input.html
new file mode 100644
index 0000000..ef9f400
--- /dev/null
+++ b/Editor/tests/dom/splitAroundSelection08-input.html
@@ -0,0 +1,16 @@
+<!DOCTYPE html>
+<html>
+<head>
+<script>
+function performTest()
+{
+    var b1 = document.getElementsByTagName("B")[0];
+    var b2 = document.getElementsByTagName("B")[1];
+    var range = new Range(b1.firstChild,4,b2.firstChild,9);
+    Formatting_splitAroundSelection(range);
+    showRangeAsBrackets(range);
+}
+</script>
+</head>
+<body><p>One <b>Two Three Four</b> Five <b>Six Seven Eight</b> Nine</p></body>
+</html>

http://git-wip-us.apache.org/repos/asf/incubator-corinthia/blob/03bd5af0/Editor/tests/dom/splitAroundSelection09-expected.html
----------------------------------------------------------------------
diff --git a/Editor/tests/dom/splitAroundSelection09-expected.html b/Editor/tests/dom/splitAroundSelection09-expected.html
new file mode 100644
index 0000000..de2bad9
--- /dev/null
+++ b/Editor/tests/dom/splitAroundSelection09-expected.html
@@ -0,0 +1,13 @@
+<html>
+  <head></head>
+  <body>
+    <p>
+      One
+      <b>[Two Three Four</b>
+      Five
+      <b>Six Seven]</b>
+      <b>Eight</b>
+      Nine
+    </p>
+  </body>
+</html>

http://git-wip-us.apache.org/repos/asf/incubator-corinthia/blob/03bd5af0/Editor/tests/dom/splitAroundSelection09-input.html
----------------------------------------------------------------------
diff --git a/Editor/tests/dom/splitAroundSelection09-input.html b/Editor/tests/dom/splitAroundSelection09-input.html
new file mode 100644
index 0000000..b666083
--- /dev/null
+++ b/Editor/tests/dom/splitAroundSelection09-input.html
@@ -0,0 +1,16 @@
+<!DOCTYPE html>
+<html>
+<head>
+<script>
+function performTest()
+{
+    var b1 = document.getElementsByTagName("B")[0];
+    var b2 = document.getElementsByTagName("B")[1];
+    var range = new Range(b1.firstChild,0,b2.firstChild,9);
+    Formatting_splitAroundSelection(range);
+    showRangeAsBrackets(range);
+}
+</script>
+</head>
+<body><p>One <b>Two Three Four</b> Five <b>Six Seven Eight</b> Nine</p></body>
+</html>

http://git-wip-us.apache.org/repos/asf/incubator-corinthia/blob/03bd5af0/Editor/tests/dom/splitAroundSelection10-expected.html
----------------------------------------------------------------------
diff --git a/Editor/tests/dom/splitAroundSelection10-expected.html b/Editor/tests/dom/splitAroundSelection10-expected.html
new file mode 100644
index 0000000..faffb83
--- /dev/null
+++ b/Editor/tests/dom/splitAroundSelection10-expected.html
@@ -0,0 +1,14 @@
+<html>
+  <head></head>
+  <body>
+    <p>
+      One
+      <b>Two Three Four</b>
+      <b>[</b>
+      Five
+      <b>Six Seven]</b>
+      <b>Eight</b>
+      Nine
+    </p>
+  </body>
+</html>

http://git-wip-us.apache.org/repos/asf/incubator-corinthia/blob/03bd5af0/Editor/tests/dom/splitAroundSelection10-input.html
----------------------------------------------------------------------
diff --git a/Editor/tests/dom/splitAroundSelection10-input.html b/Editor/tests/dom/splitAroundSelection10-input.html
new file mode 100644
index 0000000..569f397
--- /dev/null
+++ b/Editor/tests/dom/splitAroundSelection10-input.html
@@ -0,0 +1,16 @@
+<!DOCTYPE html>
+<html>
+<head>
+<script>
+function performTest()
+{
+    var b1 = document.getElementsByTagName("B")[0];
+    var b2 = document.getElementsByTagName("B")[1];
+    var range = new Range(b1.firstChild,14,b2.firstChild,9);
+    Formatting_splitAroundSelection(range);
+    showRangeAsBrackets(range);
+}
+</script>
+</head>
+<body><p>One <b>Two Three Four</b> Five <b>Six Seven Eight</b> Nine</p></body>
+</html>

http://git-wip-us.apache.org/repos/asf/incubator-corinthia/blob/03bd5af0/Editor/tests/dom/splitAroundSelection11-expected.html
----------------------------------------------------------------------
diff --git a/Editor/tests/dom/splitAroundSelection11-expected.html b/Editor/tests/dom/splitAroundSelection11-expected.html
new file mode 100644
index 0000000..388cf2f
--- /dev/null
+++ b/Editor/tests/dom/splitAroundSelection11-expected.html
@@ -0,0 +1,14 @@
+<html>
+  <head></head>
+  <body>
+    <p>
+      One
+      <b>Two</b>
+      <b>[Three Four</b>
+      Five
+      <b>]</b>
+      <b>Six Seven Eight</b>
+      Nine
+    </p>
+  </body>
+</html>

http://git-wip-us.apache.org/repos/asf/incubator-corinthia/blob/03bd5af0/Editor/tests/dom/splitAroundSelection11-input.html
----------------------------------------------------------------------
diff --git a/Editor/tests/dom/splitAroundSelection11-input.html b/Editor/tests/dom/splitAroundSelection11-input.html
new file mode 100644
index 0000000..1ee8569
--- /dev/null
+++ b/Editor/tests/dom/splitAroundSelection11-input.html
@@ -0,0 +1,16 @@
+<!DOCTYPE html>
+<html>
+<head>
+<script>
+function performTest()
+{
+    var b1 = document.getElementsByTagName("B")[0];
+    var b2 = document.getElementsByTagName("B")[1];
+    var range = new Range(b1.firstChild,4,b2.firstChild,0);
+    Formatting_splitAroundSelection(range);
+    showRangeAsBrackets(range);
+}
+</script>
+</head>
+<body><p>One <b>Two Three Four</b> Five <b>Six Seven Eight</b> Nine</p></body>
+</html>

http://git-wip-us.apache.org/repos/asf/incubator-corinthia/blob/03bd5af0/Editor/tests/dom/splitAroundSelection12-expected.html
----------------------------------------------------------------------
diff --git a/Editor/tests/dom/splitAroundSelection12-expected.html b/Editor/tests/dom/splitAroundSelection12-expected.html
new file mode 100644
index 0000000..36cc022
--- /dev/null
+++ b/Editor/tests/dom/splitAroundSelection12-expected.html
@@ -0,0 +1,13 @@
+<html>
+  <head></head>
+  <body>
+    <p>
+      One
+      <b>Two</b>
+      <b>[Three Four</b>
+      Five
+      <b>Six Seven Eight]</b>
+      Nine
+    </p>
+  </body>
+</html>

http://git-wip-us.apache.org/repos/asf/incubator-corinthia/blob/03bd5af0/Editor/tests/dom/splitAroundSelection12-input.html
----------------------------------------------------------------------
diff --git a/Editor/tests/dom/splitAroundSelection12-input.html b/Editor/tests/dom/splitAroundSelection12-input.html
new file mode 100644
index 0000000..d7ae253
--- /dev/null
+++ b/Editor/tests/dom/splitAroundSelection12-input.html
@@ -0,0 +1,16 @@
+<!DOCTYPE html>
+<html>
+<head>
+<script>
+function performTest()
+{
+    var b1 = document.getElementsByTagName("B")[0];
+    var b2 = document.getElementsByTagName("B")[1];
+    var range = new Range(b1.firstChild,4,b2.firstChild,15);
+    Formatting_splitAroundSelection(range);
+    showRangeAsBrackets(range);
+}
+</script>
+</head>
+<body><p>One <b>Two Three Four</b> Five <b>Six Seven Eight</b> Nine</p></body>
+</html>

http://git-wip-us.apache.org/repos/asf/incubator-corinthia/blob/03bd5af0/Editor/tests/dom/splitAroundSelection13-expected.html
----------------------------------------------------------------------
diff --git a/Editor/tests/dom/splitAroundSelection13-expected.html b/Editor/tests/dom/splitAroundSelection13-expected.html
new file mode 100644
index 0000000..c72ef07
--- /dev/null
+++ b/Editor/tests/dom/splitAroundSelection13-expected.html
@@ -0,0 +1,18 @@
+<html>
+  <head></head>
+  <body>
+    <p>
+      One
+      <b>Two</b>
+      <b>
+        [
+        <br/>
+        Three
+        <br/>
+        ]
+      </b>
+      <b>Four</b>
+      Five
+    </p>
+  </body>
+</html>

http://git-wip-us.apache.org/repos/asf/incubator-corinthia/blob/03bd5af0/Editor/tests/dom/splitAroundSelection13-input.html
----------------------------------------------------------------------
diff --git a/Editor/tests/dom/splitAroundSelection13-input.html b/Editor/tests/dom/splitAroundSelection13-input.html
new file mode 100644
index 0000000..882950e
--- /dev/null
+++ b/Editor/tests/dom/splitAroundSelection13-input.html
@@ -0,0 +1,15 @@
+<!DOCTYPE html>
+<html>
+<head>
+<script>
+function performTest()
+{
+    var b = document.getElementsByTagName("B")[0];
+    var range = new Range(b,1,b,4);
+    Formatting_splitAroundSelection(range);
+    showRangeAsBrackets(range);
+}
+</script>
+</head>
+<body><p>One<b>Two<br>Three<br>Four</b>Five</p></body>
+</html>

http://git-wip-us.apache.org/repos/asf/incubator-corinthia/blob/03bd5af0/Editor/tests/dom/splitAroundSelection14-expected.html
----------------------------------------------------------------------
diff --git a/Editor/tests/dom/splitAroundSelection14-expected.html b/Editor/tests/dom/splitAroundSelection14-expected.html
new file mode 100644
index 0000000..ccb4460
--- /dev/null
+++ b/Editor/tests/dom/splitAroundSelection14-expected.html
@@ -0,0 +1,17 @@
+<html>
+  <head></head>
+  <body>
+    <p>
+      One
+      <b>
+        [Two
+        <br/>
+        Three
+        <br/>
+        ]
+      </b>
+      <b>Four</b>
+      Five
+    </p>
+  </body>
+</html>

http://git-wip-us.apache.org/repos/asf/incubator-corinthia/blob/03bd5af0/Editor/tests/dom/splitAroundSelection14-input.html
----------------------------------------------------------------------
diff --git a/Editor/tests/dom/splitAroundSelection14-input.html b/Editor/tests/dom/splitAroundSelection14-input.html
new file mode 100644
index 0000000..d8e9670
--- /dev/null
+++ b/Editor/tests/dom/splitAroundSelection14-input.html
@@ -0,0 +1,15 @@
+<!DOCTYPE html>
+<html>
+<head>
+<script>
+function performTest()
+{
+    var b = document.getElementsByTagName("B")[0];
+    var range = new Range(b,0,b,4);
+    Formatting_splitAroundSelection(range);
+    showRangeAsBrackets(range);
+}
+</script>
+</head>
+<body><p>One<b>Two<br>Three<br>Four</b>Five</p></body>
+</html>

http://git-wip-us.apache.org/repos/asf/incubator-corinthia/blob/03bd5af0/Editor/tests/dom/splitAroundSelection15-expected.html
----------------------------------------------------------------------
diff --git a/Editor/tests/dom/splitAroundSelection15-expected.html b/Editor/tests/dom/splitAroundSelection15-expected.html
new file mode 100644
index 0000000..c62fd1b
--- /dev/null
+++ b/Editor/tests/dom/splitAroundSelection15-expected.html
@@ -0,0 +1,17 @@
+<html>
+  <head></head>
+  <body>
+    <p>
+      One
+      <b>Two</b>
+      <b>
+        [
+        <br/>
+        Three
+        <br/>
+        Four]
+      </b>
+      Five
+    </p>
+  </body>
+</html>

http://git-wip-us.apache.org/repos/asf/incubator-corinthia/blob/03bd5af0/Editor/tests/dom/splitAroundSelection15-input.html
----------------------------------------------------------------------
diff --git a/Editor/tests/dom/splitAroundSelection15-input.html b/Editor/tests/dom/splitAroundSelection15-input.html
new file mode 100644
index 0000000..39ea86e
--- /dev/null
+++ b/Editor/tests/dom/splitAroundSelection15-input.html
@@ -0,0 +1,15 @@
+<!DOCTYPE html>
+<html>
+<head>
+<script>
+function performTest()
+{
+    var b = document.getElementsByTagName("B")[0];
+    var range = new Range(b,1,b,5);
+    Formatting_splitAroundSelection(range);
+    showRangeAsBrackets(range);
+}
+</script>
+</head>
+<body><p>One<b>Two<br>Three<br>Four</b>Five</p></body>
+</html>

http://git-wip-us.apache.org/repos/asf/incubator-corinthia/blob/03bd5af0/Editor/tests/dom/splitAroundSelection16-expected.html
----------------------------------------------------------------------
diff --git a/Editor/tests/dom/splitAroundSelection16-expected.html b/Editor/tests/dom/splitAroundSelection16-expected.html
new file mode 100644
index 0000000..e10e46a
--- /dev/null
+++ b/Editor/tests/dom/splitAroundSelection16-expected.html
@@ -0,0 +1,17 @@
+<html>
+  <head></head>
+  <body>
+    <p>
+      One
+      <b>[]</b>
+      <b>
+        Two
+        <br/>
+        Three
+        <br/>
+        Four
+      </b>
+      Five
+    </p>
+  </body>
+</html>

http://git-wip-us.apache.org/repos/asf/incubator-corinthia/blob/03bd5af0/Editor/tests/dom/splitAroundSelection16-input.html
----------------------------------------------------------------------
diff --git a/Editor/tests/dom/splitAroundSelection16-input.html b/Editor/tests/dom/splitAroundSelection16-input.html
new file mode 100644
index 0000000..0bd12b6
--- /dev/null
+++ b/Editor/tests/dom/splitAroundSelection16-input.html
@@ -0,0 +1,15 @@
+<!DOCTYPE html>
+<html>
+<head>
+<script>
+function performTest()
+{
+    var b = document.getElementsByTagName("B")[0];
+    var range = new Range(b,0,b,0);
+    Formatting_splitAroundSelection(range);
+    showRangeAsBrackets(range);
+}
+</script>
+</head>
+<body><p>One<b>Two<br>Three<br>Four</b>Five</p></body>
+</html>

http://git-wip-us.apache.org/repos/asf/incubator-corinthia/blob/03bd5af0/Editor/tests/dom/splitAroundSelection17-expected.html
----------------------------------------------------------------------
diff --git a/Editor/tests/dom/splitAroundSelection17-expected.html b/Editor/tests/dom/splitAroundSelection17-expected.html
new file mode 100644
index 0000000..e1cd259
--- /dev/null
+++ b/Editor/tests/dom/splitAroundSelection17-expected.html
@@ -0,0 +1,19 @@
+<html>
+  <head></head>
+  <body>
+    <p>
+      One
+      <b>
+        Two
+        <br/>
+      </b>
+      <b>[]</b>
+      <b>
+        Three
+        <br/>
+        Four
+      </b>
+      Five
+    </p>
+  </body>
+</html>

http://git-wip-us.apache.org/repos/asf/incubator-corinthia/blob/03bd5af0/Editor/tests/dom/splitAroundSelection17-input.html
----------------------------------------------------------------------
diff --git a/Editor/tests/dom/splitAroundSelection17-input.html b/Editor/tests/dom/splitAroundSelection17-input.html
new file mode 100644
index 0000000..c19ff7f
--- /dev/null
+++ b/Editor/tests/dom/splitAroundSelection17-input.html
@@ -0,0 +1,15 @@
+<!DOCTYPE html>
+<html>
+<head>
+<script>
+function performTest()
+{
+    var b = document.getElementsByTagName("B")[0];
+    var range = new Range(b,2,b,2);
+    Formatting_splitAroundSelection(range);
+    showRangeAsBrackets(range);
+}
+</script>
+</head>
+<body><p>One<b>Two<br>Three<br>Four</b>Five</p></body>
+</html>

http://git-wip-us.apache.org/repos/asf/incubator-corinthia/blob/03bd5af0/Editor/tests/dom/splitAroundSelection18-expected.html
----------------------------------------------------------------------
diff --git a/Editor/tests/dom/splitAroundSelection18-expected.html b/Editor/tests/dom/splitAroundSelection18-expected.html
new file mode 100644
index 0000000..899897f
--- /dev/null
+++ b/Editor/tests/dom/splitAroundSelection18-expected.html
@@ -0,0 +1,17 @@
+<html>
+  <head></head>
+  <body>
+    <p>
+      One
+      <b>
+        Two
+        <br/>
+        Three
+        <br/>
+        Four
+      </b>
+      <b>[]</b>
+      Five
+    </p>
+  </body>
+</html>

http://git-wip-us.apache.org/repos/asf/incubator-corinthia/blob/03bd5af0/Editor/tests/dom/splitAroundSelection18-input.html
----------------------------------------------------------------------
diff --git a/Editor/tests/dom/splitAroundSelection18-input.html b/Editor/tests/dom/splitAroundSelection18-input.html
new file mode 100644
index 0000000..99298f6
--- /dev/null
+++ b/Editor/tests/dom/splitAroundSelection18-input.html
@@ -0,0 +1,15 @@
+<!DOCTYPE html>
+<html>
+<head>
+<script>
+function performTest()
+{
+    var b = document.getElementsByTagName("B")[0];
+    var range = new Range(b,5,b,5);
+    Formatting_splitAroundSelection(range);
+    showRangeAsBrackets(range);
+}
+</script>
+</head>
+<body><p>One<b>Two<br>Three<br>Four</b>Five</p></body>
+</html>

http://git-wip-us.apache.org/repos/asf/incubator-corinthia/blob/03bd5af0/Editor/tests/dom/splitAroundSelection19-expected.html
----------------------------------------------------------------------
diff --git a/Editor/tests/dom/splitAroundSelection19-expected.html b/Editor/tests/dom/splitAroundSelection19-expected.html
new file mode 100644
index 0000000..9a828d1
--- /dev/null
+++ b/Editor/tests/dom/splitAroundSelection19-expected.html
@@ -0,0 +1,12 @@
+<html>
+  <head></head>
+  <body>
+    <p>
+      <b>
+        <s>Text1</s>
+        <s>Text2</s>
+        <s>Text3</s>
+      </b>
+    </p>
+  </body>
+</html>

http://git-wip-us.apache.org/repos/asf/incubator-corinthia/blob/03bd5af0/Editor/tests/dom/splitAroundSelection19-input.html
----------------------------------------------------------------------
diff --git a/Editor/tests/dom/splitAroundSelection19-input.html b/Editor/tests/dom/splitAroundSelection19-input.html
new file mode 100644
index 0000000..ccc961e
--- /dev/null
+++ b/Editor/tests/dom/splitAroundSelection19-input.html
@@ -0,0 +1,22 @@
+<!DOCTYPE html>
+<html>
+<head>
+<script>
+function performTest()
+{
+    Selection_preserveWhileExecuting(function() {
+        Formatting_splitAroundSelection(Selection_get());
+    });
+}
+</script>
+</head>
+<body>
+<p>
+  <b>
+    [<s>Text1</s>
+    <s>Text2</s>
+    <s>Text3</s>]
+  </b>
+</p>
+</body>
+</html>

http://git-wip-us.apache.org/repos/asf/incubator-corinthia/blob/03bd5af0/Editor/tests/dom/splitAroundSelection20-expected.html
----------------------------------------------------------------------
diff --git a/Editor/tests/dom/splitAroundSelection20-expected.html b/Editor/tests/dom/splitAroundSelection20-expected.html
new file mode 100644
index 0000000..fc44fa4
--- /dev/null
+++ b/Editor/tests/dom/splitAroundSelection20-expected.html
@@ -0,0 +1,12 @@
+<html>
+  <head></head>
+  <body>
+    <p>
+      <b>
+        <s>Text1</s>
+        <s>Text2</s>
+      </b>
+      <b><s>Text3</s></b>
+    </p>
+  </body>
+</html>

http://git-wip-us.apache.org/repos/asf/incubator-corinthia/blob/03bd5af0/Editor/tests/dom/splitAroundSelection20-input.html
----------------------------------------------------------------------
diff --git a/Editor/tests/dom/splitAroundSelection20-input.html b/Editor/tests/dom/splitAroundSelection20-input.html
new file mode 100644
index 0000000..60e20d5
--- /dev/null
+++ b/Editor/tests/dom/splitAroundSelection20-input.html
@@ -0,0 +1,22 @@
+<!DOCTYPE html>
+<html>
+<head>
+<script>
+function performTest()
+{
+    Selection_preserveWhileExecuting(function() {
+        Formatting_splitAroundSelection(Selection_get());
+    });
+}
+</script>
+</head>
+<body>
+<p>
+  <b>
+    [<s>Text1</s>
+    <s>Text2</s>]
+    <s>Text3</s>
+  </b>
+</p>
+</body>
+</html>

http://git-wip-us.apache.org/repos/asf/incubator-corinthia/blob/03bd5af0/Editor/tests/dom/splitAroundSelection21-expected.html
----------------------------------------------------------------------
diff --git a/Editor/tests/dom/splitAroundSelection21-expected.html b/Editor/tests/dom/splitAroundSelection21-expected.html
new file mode 100644
index 0000000..439796f
--- /dev/null
+++ b/Editor/tests/dom/splitAroundSelection21-expected.html
@@ -0,0 +1,12 @@
+<html>
+  <head></head>
+  <body>
+    <p>
+      <b><s>Text1</s></b>
+      <b>
+        <s>Text2</s>
+        <s>Text3</s>
+      </b>
+    </p>
+  </body>
+</html>

http://git-wip-us.apache.org/repos/asf/incubator-corinthia/blob/03bd5af0/Editor/tests/dom/splitAroundSelection21-input.html
----------------------------------------------------------------------
diff --git a/Editor/tests/dom/splitAroundSelection21-input.html b/Editor/tests/dom/splitAroundSelection21-input.html
new file mode 100644
index 0000000..5ea0229
--- /dev/null
+++ b/Editor/tests/dom/splitAroundSelection21-input.html
@@ -0,0 +1,22 @@
+<!DOCTYPE html>
+<html>
+<head>
+<script>
+function performTest()
+{
+    Selection_preserveWhileExecuting(function() {
+        Formatting_splitAroundSelection(Selection_get());
+    });
+}
+</script>
+</head>
+<body>
+<p>
+  <b>
+    <s>Text1</s>
+    [<s>Text2</s>
+    <s>Text3</s>]
+  </b>
+</p>
+</body>
+</html>

http://git-wip-us.apache.org/repos/asf/incubator-corinthia/blob/03bd5af0/Editor/tests/dom/splitAroundSelection22-expected.html
----------------------------------------------------------------------
diff --git a/Editor/tests/dom/splitAroundSelection22-expected.html b/Editor/tests/dom/splitAroundSelection22-expected.html
new file mode 100644
index 0000000..bbdc2de
--- /dev/null
+++ b/Editor/tests/dom/splitAroundSelection22-expected.html
@@ -0,0 +1,14 @@
+<html>
+  <head></head>
+  <body>
+    <p>
+      <b>
+        <i>
+          <s>Text1</s>
+          <s>Text2</s>
+          <s>Text3</s>
+        </i>
+      </b>
+    </p>
+  </body>
+</html>

http://git-wip-us.apache.org/repos/asf/incubator-corinthia/blob/03bd5af0/Editor/tests/dom/splitAroundSelection22-input.html
----------------------------------------------------------------------
diff --git a/Editor/tests/dom/splitAroundSelection22-input.html b/Editor/tests/dom/splitAroundSelection22-input.html
new file mode 100644
index 0000000..11210cf
--- /dev/null
+++ b/Editor/tests/dom/splitAroundSelection22-input.html
@@ -0,0 +1,24 @@
+<!DOCTYPE html>
+<html>
+<head>
+<script>
+function performTest()
+{
+    Selection_preserveWhileExecuting(function() {
+        Formatting_splitAroundSelection(Selection_get());
+    });
+}
+</script>
+</head>
+<body>
+<p>
+  <b>
+    <i>
+      [<s>Text1</s>
+      <s>Text2</s>
+      <s>Text3</s>]
+    </i>
+  </b>
+</p>
+</body>
+</html>

http://git-wip-us.apache.org/repos/asf/incubator-corinthia/blob/03bd5af0/Editor/tests/dom/splitAroundSelection23-expected.html
----------------------------------------------------------------------
diff --git a/Editor/tests/dom/splitAroundSelection23-expected.html b/Editor/tests/dom/splitAroundSelection23-expected.html
new file mode 100644
index 0000000..de87e0e
--- /dev/null
+++ b/Editor/tests/dom/splitAroundSelection23-expected.html
@@ -0,0 +1,14 @@
+<html>
+  <head></head>
+  <body>
+    <p>
+      <b>
+        <i>
+          <s>Text1</s>
+          <s>Text2</s>
+        </i>
+      </b>
+      <b><i><s>Text3</s></i></b>
+    </p>
+  </body>
+</html>

http://git-wip-us.apache.org/repos/asf/incubator-corinthia/blob/03bd5af0/Editor/tests/dom/splitAroundSelection23-input.html
----------------------------------------------------------------------
diff --git a/Editor/tests/dom/splitAroundSelection23-input.html b/Editor/tests/dom/splitAroundSelection23-input.html
new file mode 100644
index 0000000..a3f0e53
--- /dev/null
+++ b/Editor/tests/dom/splitAroundSelection23-input.html
@@ -0,0 +1,24 @@
+<!DOCTYPE html>
+<html>
+<head>
+<script>
+function performTest()
+{
+    Selection_preserveWhileExecuting(function() {
+        Formatting_splitAroundSelection(Selection_get());
+    });
+}
+</script>
+</head>
+<body>
+<p>
+  <b>
+    <i>
+      [<s>Text1</s>
+      <s>Text2</s>]
+      <s>Text3</s>
+    </i>
+  </b>
+</p>
+</body>
+</html>

http://git-wip-us.apache.org/repos/asf/incubator-corinthia/blob/03bd5af0/Editor/tests/dom/splitAroundSelection24-expected.html
----------------------------------------------------------------------
diff --git a/Editor/tests/dom/splitAroundSelection24-expected.html b/Editor/tests/dom/splitAroundSelection24-expected.html
new file mode 100644
index 0000000..ce33895
--- /dev/null
+++ b/Editor/tests/dom/splitAroundSelection24-expected.html
@@ -0,0 +1,14 @@
+<html>
+  <head></head>
+  <body>
+    <p>
+      <b><i><s>Text1</s></i></b>
+      <b>
+        <i>
+          <s>Text2</s>
+          <s>Text3</s>
+        </i>
+      </b>
+    </p>
+  </body>
+</html>

http://git-wip-us.apache.org/repos/asf/incubator-corinthia/blob/03bd5af0/Editor/tests/dom/splitAroundSelection24-input.html
----------------------------------------------------------------------
diff --git a/Editor/tests/dom/splitAroundSelection24-input.html b/Editor/tests/dom/splitAroundSelection24-input.html
new file mode 100644
index 0000000..256f488
--- /dev/null
+++ b/Editor/tests/dom/splitAroundSelection24-input.html
@@ -0,0 +1,24 @@
+<!DOCTYPE html>
+<html>
+<head>
+<script>
+function performTest()
+{
+    Selection_preserveWhileExecuting(function() {
+        Formatting_splitAroundSelection(Selection_get());
+    });
+}
+</script>
+</head>
+<body>
+<p>
+  <b>
+    <i>
+      <s>Text1</s>
+      [<s>Text2</s>
+      <s>Text3</s>]
+    </i>
+  </b>
+</p>
+</body>
+</html>

http://git-wip-us.apache.org/repos/asf/incubator-corinthia/blob/03bd5af0/Editor/tests/dom/stripComments01-expected.html
----------------------------------------------------------------------
diff --git a/Editor/tests/dom/stripComments01-expected.html b/Editor/tests/dom/stripComments01-expected.html
new file mode 100644
index 0000000..6bab67c
--- /dev/null
+++ b/Editor/tests/dom/stripComments01-expected.html
@@ -0,0 +1,26 @@
+<html>
+  <head></head>
+  <body>
+    <p>
+      One
+      <b>
+        Two
+        Three Four
+      </b>
+      Five
+    </p>
+    <ul>
+      <li>Item 1</li>
+      <li>
+        Item
+        2
+      </li>
+      <li>Item 3</li>
+    </ul>
+    <p>
+      One
+      <b>Two Three Four</b>
+      Five
+    </p>
+  </body>
+</html>

http://git-wip-us.apache.org/repos/asf/incubator-corinthia/blob/03bd5af0/Editor/tests/dom/stripComments01-input.html
----------------------------------------------------------------------
diff --git a/Editor/tests/dom/stripComments01-input.html b/Editor/tests/dom/stripComments01-input.html
new file mode 100644
index 0000000..ed5f644
--- /dev/null
+++ b/Editor/tests/dom/stripComments01-input.html
@@ -0,0 +1,26 @@
+<!DOCTYPE html>
+<html>
+<!-- comment 0 -->
+<head>
+<script>
+function performTest()
+{
+    Main_removeUnsupportedInput();
+}
+</script>
+</head>
+<!-- comment 1 -->
+<body>
+<!-- comment 2 -->
+<p>One <b>Two <!-- comment 3 --> Three Four</b> Five</p>
+<ul>
+  <?php a ?>
+  <li>Item 1</li>
+  <!-- comment 4 -->
+  <li>Item <!-- comment 5 --> 2</li>
+  <li>Item 3</li>
+</ul>
+<p>One <b>Two Three Four</b><!-- comment 6 --> Five</p>
+</body>
+<!-- comment 7 -->
+</html>

http://git-wip-us.apache.org/repos/asf/incubator-corinthia/blob/03bd5af0/Editor/tests/dom/tracking-delete01-expected.html
----------------------------------------------------------------------
diff --git a/Editor/tests/dom/tracking-delete01-expected.html b/Editor/tests/dom/tracking-delete01-expected.html
new file mode 100644
index 0000000..e3a4d99
--- /dev/null
+++ b/Editor/tests/dom/tracking-delete01-expected.html
@@ -0,0 +1,4 @@
+<html>
+  <head></head>
+  <body>[]</body>
+</html>

http://git-wip-us.apache.org/repos/asf/incubator-corinthia/blob/03bd5af0/Editor/tests/dom/tracking-delete01-input.html
----------------------------------------------------------------------
diff --git a/Editor/tests/dom/tracking-delete01-input.html b/Editor/tests/dom/tracking-delete01-input.html
new file mode 100644
index 0000000..abf8ea8
--- /dev/null
+++ b/Editor/tests/dom/tracking-delete01-input.html
@@ -0,0 +1,15 @@
+<!DOCTYPE html>
+<html>
+<head>
+<script>
+function performTest()
+{
+    Selection_preserveWhileExecuting(function() {
+        DOM_deleteNode(document.getElementsByTagName("P")[0]);
+    });
+    showSelection();
+}
+</script>
+</head>
+<body><p>[]</p></body>
+</html>

http://git-wip-us.apache.org/repos/asf/incubator-corinthia/blob/03bd5af0/Editor/tests/dom/tracking-delete02-expected.html
----------------------------------------------------------------------
diff --git a/Editor/tests/dom/tracking-delete02-expected.html b/Editor/tests/dom/tracking-delete02-expected.html
new file mode 100644
index 0000000..e3a4d99
--- /dev/null
+++ b/Editor/tests/dom/tracking-delete02-expected.html
@@ -0,0 +1,4 @@
+<html>
+  <head></head>
+  <body>[]</body>
+</html>

http://git-wip-us.apache.org/repos/asf/incubator-corinthia/blob/03bd5af0/Editor/tests/dom/tracking-delete02-input.html
----------------------------------------------------------------------
diff --git a/Editor/tests/dom/tracking-delete02-input.html b/Editor/tests/dom/tracking-delete02-input.html
new file mode 100644
index 0000000..e0e8963
--- /dev/null
+++ b/Editor/tests/dom/tracking-delete02-input.html
@@ -0,0 +1,15 @@
+<!DOCTYPE html>
+<html>
+<head>
+<script>
+function performTest()
+{
+    Selection_preserveWhileExecuting(function() {
+        DOM_deleteNode(document.getElementsByTagName("P")[0]);
+    });
+    showSelection();
+}
+</script>
+</head>
+<body><p><b>[]</b></p></body>
+</html>

http://git-wip-us.apache.org/repos/asf/incubator-corinthia/blob/03bd5af0/Editor/tests/dom/tracking-delete03-expected.html
----------------------------------------------------------------------
diff --git a/Editor/tests/dom/tracking-delete03-expected.html b/Editor/tests/dom/tracking-delete03-expected.html
new file mode 100644
index 0000000..e3a4d99
--- /dev/null
+++ b/Editor/tests/dom/tracking-delete03-expected.html
@@ -0,0 +1,4 @@
+<html>
+  <head></head>
+  <body>[]</body>
+</html>

http://git-wip-us.apache.org/repos/asf/incubator-corinthia/blob/03bd5af0/Editor/tests/dom/tracking-delete03-input.html
----------------------------------------------------------------------
diff --git a/Editor/tests/dom/tracking-delete03-input.html b/Editor/tests/dom/tracking-delete03-input.html
new file mode 100644
index 0000000..4e54134
--- /dev/null
+++ b/Editor/tests/dom/tracking-delete03-input.html
@@ -0,0 +1,15 @@
+<!DOCTYPE html>
+<html>
+<head>
+<script>
+function performTest()
+{
+    Selection_preserveWhileExecuting(function() {
+        DOM_deleteNode(document.getElementsByTagName("P")[0]);
+    });
+    showSelection();
+}
+</script>
+</head>
+<body><p><b><u>[x]</u></b></p></body>
+</html>

http://git-wip-us.apache.org/repos/asf/incubator-corinthia/blob/03bd5af0/Editor/tests/dom/tracking-mergeWithNeighbours01-expected.html
----------------------------------------------------------------------
diff --git a/Editor/tests/dom/tracking-mergeWithNeighbours01-expected.html b/Editor/tests/dom/tracking-mergeWithNeighbours01-expected.html
new file mode 100644
index 0000000..d1477c0
--- /dev/null
+++ b/Editor/tests/dom/tracking-mergeWithNeighbours01-expected.html
@@ -0,0 +1,55 @@
+<html>
+  <head>
+  </head>
+  <body>-
+Before: positions[0] = (BODY,0)
+Before: positions[1] = (P,0)
+Before: positions[2] = (BR#br1,0)
+Before: positions[3] = (P,1)
+Before: positions[4] = "|One"
+Before: positions[5] = "O|ne"
+Before: positions[6] = "On|e"
+Before: positions[7] = "One|"
+Before: positions[8] = (P,2)
+Before: positions[9] = "|Two"
+Before: positions[10] = "T|wo"
+Before: positions[11] = "Tw|o"
+Before: positions[12] = "Two|"
+Before: positions[13] = (P,3)
+Before: positions[14] = "|Three"
+Before: positions[15] = "T|hree"
+Before: positions[16] = "Th|ree"
+Before: positions[17] = "Thr|ee"
+Before: positions[18] = "Thre|e"
+Before: positions[19] = "Three|"
+Before: positions[20] = (P,4)
+Before: positions[21] = (BR#br2,0)
+Before: positions[22] = (P,5)
+Before: positions[23] = (BODY,1)
+
+After: positions[0] = (BODY,0)
+After: positions[1] = (P,0)
+After: positions[2] = (BR#br1,0)
+After: positions[3] = (P,1)
+After: positions[4] = "|OneTwoThree" - changed from "|One"
+After: positions[5] = "O|neTwoThree" - changed from "O|ne"
+After: positions[6] = "On|eTwoThree" - changed from "On|e"
+After: positions[7] = "One|TwoThree" - changed from "One|"
+After: positions[8] = "One|TwoThree" - changed from (P,2)
+After: positions[9] = "One|TwoThree" - changed from "|Two"
+After: positions[10] = "OneT|woThree" - changed from "T|wo"
+After: positions[11] = "OneTw|oThree" - changed from "Tw|o"
+After: positions[12] = "OneTwo|Three" - changed from "Two|"
+After: positions[13] = "OneTwo|Three" - changed from (P,3)
+After: positions[14] = "OneTwo|Three" - changed from "|Three"
+After: positions[15] = "OneTwoT|hree" - changed from "T|hree"
+After: positions[16] = "OneTwoTh|ree" - changed from "Th|ree"
+After: positions[17] = "OneTwoThr|ee" - changed from "Thr|ee"
+After: positions[18] = "OneTwoThre|e" - changed from "Thre|e"
+After: positions[19] = "OneTwoThree|" - changed from "Three|"
+After: positions[20] = (P,2) - changed from (P,4)
+After: positions[21] = (BR#br2,0)
+After: positions[22] = (P,3) - changed from (P,5)
+After: positions[23] = (BODY,1)
+-</body>
+</html>

http://git-wip-us.apache.org/repos/asf/incubator-corinthia/blob/03bd5af0/Editor/tests/dom/tracking-mergeWithNeighbours01-input.html
----------------------------------------------------------------------
diff --git a/Editor/tests/dom/tracking-mergeWithNeighbours01-input.html b/Editor/tests/dom/tracking-mergeWithNeighbours01-input.html
new file mode 100644
index 0000000..6ca71bf
--- /dev/null
+++ b/Editor/tests/dom/tracking-mergeWithNeighbours01-input.html
@@ -0,0 +1,39 @@
+<!DOCTYPE html>
+<html>
+<head>
+<script type="text/javascript" src="RangeTest.js"></script>
+<script>
+
+function performTest()
+{
+    // DOM_wrapNode() should not affect any positions, because the node itself remains in the
+    // tree unmodified.
+
+    DOM_deleteAllChildren(document.body);
+    var p = DOM_createElement(document,"P");
+    var br1 = DOM_createElement(document,"BR");
+    var br2 = DOM_createElement(document,"BR");
+    DOM_setAttribute(br1,"id","br1");
+    DOM_setAttribute(br2,"id","br2");
+    var text1 = DOM_createTextNode(document,"One");
+    var text2 = DOM_createTextNode(document,"Two");
+    var text3 = DOM_createTextNode(document,"Three");
+    DOM_appendChild(p,br1);
+    DOM_appendChild(p,text1);
+    DOM_appendChild(p,text2);
+    DOM_appendChild(p,text3);
+    DOM_appendChild(p,br2);
+    DOM_appendChild(document.body,p);
+
+    var result = comparePositionsBeforeAndAfter(function() {
+        Formatting_mergeWithNeighbours(text2,Formatting_MERGEABLE_INLINE);
+    });
+
+    DOM_deleteAllChildren(document.body);
+    DOM_appendChild(document.body,DOM_createTextNode(document,"-\n"+result+"\n-"));
+}
+</script>
+</head>
+<body>
+</body>
+</html>

http://git-wip-us.apache.org/repos/asf/incubator-corinthia/blob/03bd5af0/Editor/tests/dom/tracking-mergeWithNeighbours02-expected.html
----------------------------------------------------------------------
diff --git a/Editor/tests/dom/tracking-mergeWithNeighbours02-expected.html b/Editor/tests/dom/tracking-mergeWithNeighbours02-expected.html
new file mode 100644
index 0000000..9a91f0d
--- /dev/null
+++ b/Editor/tests/dom/tracking-mergeWithNeighbours02-expected.html
@@ -0,0 +1,69 @@
+<html>
+  <head>
+  </head>
+  <body>-
+Before: positions[0] = (BODY,0)
+Before: positions[1] = (P,0)
+Before: positions[2] = (SPAN#span1,0)
+Before: positions[3] = (P,1)
+Before: positions[4] = (SPAN#span2,0)
+Before: positions[5] = (BR#br1,0)
+Before: positions[6] = (SPAN#span2,1)
+Before: positions[7] = (BR#br2,0)
+Before: positions[8] = (SPAN#span2,2)
+Before: positions[9] = (BR#br3,0)
+Before: positions[10] = (SPAN#span2,3)
+Before: positions[11] = (P,2)
+Before: positions[12] = (SPAN#span3,0)
+Before: positions[13] = (BR#br4,0)
+Before: positions[14] = (SPAN#span3,1)
+Before: positions[15] = (BR#br5,0)
+Before: positions[16] = (SPAN#span3,2)
+Before: positions[17] = (BR#br6,0)
+Before: positions[18] = (SPAN#span3,3)
+Before: positions[19] = (P,3)
+Before: positions[20] = (SPAN#span4,0)
+Before: positions[21] = (BR#br7,0)
+Before: positions[22] = (SPAN#span4,1)
+Before: positions[23] = (BR#br8,0)
+Before: positions[24] = (SPAN#span4,2)
+Before: positions[25] = (BR#br9,0)
+Before: positions[26] = (SPAN#span4,3)
+Before: positions[27] = (P,4)
+Before: positions[28] = (SPAN#span5,0)
+Before: positions[29] = (P,5)
+Before: positions[30] = (BODY,1)
+
+After: positions[0] = (BODY,0)
+After: positions[1] = (P,0)
+After: positions[2] = (SPAN#span1,0)
+After: positions[3] = (P,1)
+After: positions[4] = (SPAN#span2,0)
+After: positions[5] = (BR#br1,0)
+After: positions[6] = (SPAN#span2,1)
+After: positions[7] = (BR#br2,0)
+After: positions[8] = (SPAN#span2,2)
+After: positions[9] = (BR#br3,0)
+After: positions[10] = (SPAN#span2,3)
+After: positions[11] = (SPAN#span2,3) - changed from (P,2)
+After: positions[12] = (SPAN#span2,3) - changed from (SPAN#span3,0)
+After: positions[13] = (BR#br4,0)
+After: positions[14] = (SPAN#span2,4) - changed from (SPAN#span3,1)
+After: positions[15] = (BR#br5,0)
+After: positions[16] = (SPAN#span2,5) - changed from (SPAN#span3,2)
+After: positions[17] = (BR#br6,0)
+After: positions[18] = (SPAN#span2,6) - changed from (SPAN#span3,3)
+After: positions[19] = (SPAN#span2,6) - changed from (P,3)
+After: positions[20] = (SPAN#span2,6) - changed from (SPAN#span4,0)
+After: positions[21] = (BR#br7,0)
+After: positions[22] = (SPAN#span2,7) - changed from (SPAN#span4,1)
+After: positions[23] = (BR#br8,0)
+After: positions[24] = (SPAN#span2,8) - changed from (SPAN#span4,2)
+After: positions[25] = (BR#br9,0)
+After: positions[26] = (SPAN#span2,9) - changed from (SPAN#span4,3)
+After: positions[27] = (P,2) - changed from (P,4)
+After: positions[28] = (SPAN#span5,0)
+After: positions[29] = (P,3) - changed from (P,5)
+After: positions[30] = (BODY,1)
+-</body>
+</html>

http://git-wip-us.apache.org/repos/asf/incubator-corinthia/blob/03bd5af0/Editor/tests/dom/tracking-mergeWithNeighbours02-input.html
----------------------------------------------------------------------
diff --git a/Editor/tests/dom/tracking-mergeWithNeighbours02-input.html b/Editor/tests/dom/tracking-mergeWithNeighbours02-input.html
new file mode 100644
index 0000000..09fffaf
--- /dev/null
+++ b/Editor/tests/dom/tracking-mergeWithNeighbours02-input.html
@@ -0,0 +1,75 @@
+<!DOCTYPE html>
+<html>
+<head>
+<script type="text/javascript" src="RangeTest.js"></script>
+<script>
+
+function createElementWithId(elementName,id)
+{
+    var element = DOM_createElement(document,elementName);
+    DOM_setAttribute(element,"id",id);
+    return element;
+}
+
+function performTest()
+{
+    // DOM_wrapNode() should not affect any positions, because the node itself remains in the
+    // tree unmodified.
+
+    DOM_deleteAllChildren(document.body);
+
+    var p = DOM_createElement(document,"P");
+
+    var span1 = createElementWithId("SPAN","span1");
+    var span2 = createElementWithId("SPAN","span2");
+    var span3 = createElementWithId("SPAN","span3");
+    var span4 = createElementWithId("SPAN","span4");
+    var span5 = createElementWithId("SPAN","span5");
+    DOM_setAttribute(span1,"style","color: blue");
+    DOM_setAttribute(span5,"style","color: blue");
+
+    DOM_appendChild(document.body,p);
+    DOM_appendChild(p,span1);
+    DOM_appendChild(p,span2);
+    DOM_appendChild(p,span3);
+    DOM_appendChild(p,span4);
+    DOM_appendChild(p,span5);
+
+    DOM_appendChild(span2,createElementWithId("BR","br1"));
+    DOM_appendChild(span2,createElementWithId("BR","br2"));
+    DOM_appendChild(span2,createElementWithId("BR","br3"));
+    DOM_appendChild(span3,createElementWithId("BR","br4"));
+    DOM_appendChild(span3,createElementWithId("BR","br5"));
+    DOM_appendChild(span3,createElementWithId("BR","br6"));
+    DOM_appendChild(span4,createElementWithId("BR","br7"));
+    DOM_appendChild(span4,createElementWithId("BR","br8"));
+    DOM_appendChild(span4,createElementWithId("BR","br9"));
+
+    var result = comparePositionsBeforeAndAfter(function() {
+
+        // Temporarily remove id attributes so that elements will be considered mergeable
+        DOM_removeAttribute(span1,"id");
+        DOM_removeAttribute(span2,"id");
+        DOM_removeAttribute(span3,"id");
+        DOM_removeAttribute(span4,"id");
+        DOM_removeAttribute(span5,"id");
+
+        Formatting_mergeWithNeighbours(span3,Formatting_MERGEABLE_INLINE);
+
+        DOM_setAttribute(span1,"id","span1");
+        DOM_setAttribute(span2,"id","span2");
+        DOM_setAttribute(span3,"id","span3");
+        DOM_setAttribute(span4,"id","span4");
+        DOM_setAttribute(span5,"id","span5");
+
+    });
+
+
+    DOM_deleteAllChildren(document.body);
+    DOM_appendChild(document.body,DOM_createTextNode(document,"-\n"+result+"\n-"));
+}
+</script>
+</head>
+<body>
+</body>
+</html>

http://git-wip-us.apache.org/repos/asf/incubator-corinthia/blob/03bd5af0/Editor/tests/dom/tracking-moveNode-expected.html
----------------------------------------------------------------------
diff --git a/Editor/tests/dom/tracking-moveNode-expected.html b/Editor/tests/dom/tracking-moveNode-expected.html
new file mode 100644
index 0000000..796ef0a
--- /dev/null
+++ b/Editor/tests/dom/tracking-moveNode-expected.html
@@ -0,0 +1,177 @@
+<html>
+  <head>
+  </head>
+  <body>-
+Before: positions[0] = (BODY,0)
+Before: positions[1] = (P#p1,0)
+Before: positions[2] = (B,0)
+Before: positions[3] = "|ab"
+Before: positions[4] = "a|b"
+Before: positions[5] = "ab|"
+Before: positions[6] = (B,1)
+Before: positions[7] = (BR,0)
+Before: positions[8] = (B,2)
+Before: positions[9] = (P#p1,1)
+Before: positions[10] = (B,0)
+Before: positions[11] = "|cd"
+Before: positions[12] = "c|d"
+Before: positions[13] = "cd|"
+Before: positions[14] = (B,1)
+Before: positions[15] = (BR,0)
+Before: positions[16] = (B,2)
+Before: positions[17] = (P#p1,2)
+Before: positions[18] = (B,0)
+Before: positions[19] = "|ef"
+Before: positions[20] = "e|f"
+Before: positions[21] = "ef|"
+Before: positions[22] = (B,1)
+Before: positions[23] = (BR,0)
+Before: positions[24] = (B,2)
+Before: positions[25] = (P#p1,3)
+Before: positions[26] = (B,0)
+Before: positions[27] = "|gh"
+Before: positions[28] = "g|h"
+Before: positions[29] = "gh|"
+Before: positions[30] = (B,1)
+Before: positions[31] = (BR,0)
+Before: positions[32] = (B,2)
+Before: positions[33] = (P#p1,4)
+Before: positions[34] = (B,0)
+Before: positions[35] = "|ij"
+Before: positions[36] = "i|j"
+Before: positions[37] = "ij|"
+Before: positions[38] = (B,1)
+Before: positions[39] = (BR,0)
+Before: positions[40] = (B,2)
+Before: positions[41] = (P#p1,5)
+Before: positions[42] = (BODY,1)
+Before: positions[43] = (P#p2,0)
+Before: positions[44] = (B,0)
+Before: positions[45] = "|kl"
+Before: positions[46] = "k|l"
+Before: positions[47] = "kl|"
+Before: positions[48] = (B,1)
+Before: positions[49] = (BR,0)
+Before: positions[50] = (B,2)
+Before: positions[51] = (P#p2,1)
+Before: positions[52] = (B,0)
+Before: positions[53] = "|mn"
+Before: positions[54] = "m|n"
+Before: positions[55] = "mn|"
+Before: positions[56] = (B,1)
+Before: positions[57] = (BR,0)
+Before: positions[58] = (B,2)
+Before: positions[59] = (P#p2,2)
+Before: positions[60] = (B,0)
+Before: positions[61] = "|op"
+Before: positions[62] = "o|p"
+Before: positions[63] = "op|"
+Before: positions[64] = (B,1)
+Before: positions[65] = (BR,0)
+Before: positions[66] = (B,2)
+Before: positions[67] = (P#p2,3)
+Before: positions[68] = (B,0)
+Before: positions[69] = "|qr"
+Before: positions[70] = "q|r"
+Before: positions[71] = "qr|"
+Before: positions[72] = (B,1)
+Before: positions[73] = (BR,0)
+Before: positions[74] = (B,2)
+Before: positions[75] = (P#p2,4)
+Before: positions[76] = (B,0)
+Before: positions[77] = "|st"
+Before: positions[78] = "s|t"
+Before: positions[79] = "st|"
+Before: positions[80] = (B,1)
+Before: positions[81] = (BR,0)
+Before: positions[82] = (B,2)
+Before: positions[83] = (P#p2,5)
+Before: positions[84] = (BODY,2)
+
+After: positions[0] = (BODY,0)
+After: positions[1] = (P#p1,0)
+After: positions[2] = (B,0)
+After: positions[3] = "|ab"
+After: positions[4] = "a|b"
+After: positions[5] = "ab|"
+After: positions[6] = (B,1)
+After: positions[7] = (BR,0)
+After: positions[8] = (B,2)
+After: positions[9] = (P#p2,3) - changed from (P#p1,1)
+After: positions[10] = (B,0)
+After: positions[11] = "|cd"
+After: positions[12] = "c|d"
+After: positions[13] = "cd|"
+After: positions[14] = (B,1)
+After: positions[15] = (BR,0)
+After: positions[16] = (B,2)
+After: positions[17] = (P#p1,1) - changed from (P#p1,2)
+After: positions[18] = (B,0)
+After: positions[19] = "|ef"
+After: positions[20] = "e|f"
+After: positions[21] = "ef|"
+After: positions[22] = (B,1)
+After: positions[23] = (BR,0)
+After: positions[24] = (B,2)
+After: positions[25] = (P#p1,2) - changed from (P#p1,3)
+After: positions[26] = (B,0)
+After: positions[27] = "|gh"
+After: positions[28] = "g|h"
+After: positions[29] = "gh|"
+After: positions[30] = (B,1)
+After: positions[31] = (BR,0)
+After: positions[32] = (B,2)
+After: positions[33] = (P#p1,3) - changed from (P#p1,4)
+After: positions[34] = (B,0)
+After: positions[35] = "|ij"
+After: positions[36] = "i|j"
+After: positions[37] = "ij|"
+After: positions[38] = (B,1)
+After: positions[39] = (BR,0)
+After: positions[40] = (B,2)
+After: positions[41] = (P#p1,4) - changed from (P#p1,5)
+After: positions[42] = (BODY,1)
+After: positions[43] = (P#p2,0)
+After: positions[44] = (B,0)
+After: positions[45] = "|kl"
+After: positions[46] = "k|l"
+After: positions[47] = "kl|"
+After: positions[48] = (B,1)
+After: positions[49] = (BR,0)
+After: positions[50] = (B,2)
+After: positions[51] = (P#p2,1)
+After: positions[52] = (B,0)
+After: positions[53] = "|mn"
+After: positions[54] = "m|n"
+After: positions[55] = "mn|"
+After: positions[56] = (B,1)
+After: positions[57] = (BR,0)
+After: positions[58] = (B,2)
+After: positions[59] = (P#p2,2)
+After: positions[60] = (B,0)
+After: positions[61] = "|op"
+After: positions[62] = "o|p"
+After: positions[63] = "op|"
+After: positions[64] = (B,1)
+After: positions[65] = (BR,0)
+After: positions[66] = (B,2)
+After: positions[67] = (P#p2,3)
+After: positions[68] = (B,0)
+After: positions[69] = "|qr"
+After: positions[70] = "q|r"
+After: positions[71] = "qr|"
+After: positions[72] = (B,1)
+After: positions[73] = (BR,0)
+After: positions[74] = (B,2)
+After: positions[75] = (P#p2,5) - changed from (P#p2,4)
+After: positions[76] = (B,0)
+After: positions[77] = "|st"
+After: positions[78] = "s|t"
+After: positions[79] = "st|"
+After: positions[80] = (B,1)
+After: positions[81] = (BR,0)
+After: positions[82] = (B,2)
+After: positions[83] = (P#p2,6) - changed from (P#p2,5)
+After: positions[84] = (BODY,2)
+-</body>
+</html>

http://git-wip-us.apache.org/repos/asf/incubator-corinthia/blob/03bd5af0/Editor/tests/dom/tracking-moveNode-input.html
----------------------------------------------------------------------
diff --git a/Editor/tests/dom/tracking-moveNode-input.html b/Editor/tests/dom/tracking-moveNode-input.html
new file mode 100644
index 0000000..3375f56
--- /dev/null
+++ b/Editor/tests/dom/tracking-moveNode-input.html
@@ -0,0 +1,41 @@
+<!DOCTYPE html>
+<html>
+<head>
+<script type="text/javascript" src="RangeTest.js"></script>
+<script>
+
+function performTest()
+{
+    // DOM_wrapNode() should not affect any positions, because the node itself remains in the
+    // tree unmodified.
+
+    removeWhitespaceAndCommentNodes(document.body);
+
+    var p1 = document.getElementById("p1");
+    var p2 = document.getElementById("p2");
+
+    var result = comparePositionsBeforeAndAfter(function() {
+        DOM_insertBefore(p2,p1.childNodes[1],p2.childNodes[3]);
+    });
+
+    DOM_deleteAllChildren(document.body);
+    DOM_appendChild(document.body,DOM_createTextNode(document,"-\n"+result+"\n-"));
+}
+</script>
+</head>
+<body>
+<p id="p1">
+<b>ab<br></b>
+<b>cd<br></b>
+<b>ef<br></b>
+<b>gh<br></b>
+<b>ij<br></b>
+</p>
+<p id="p2">
+<b>kl<br></b>
+<b>mn<br></b>
+<b>op<br></b>
+<b>qr<br></b>
+<b>st<br></b>
+</p>
+</html>

http://git-wip-us.apache.org/repos/asf/incubator-corinthia/blob/03bd5af0/Editor/tests/dom/tracking-removeNodeButKeepChildren-expected.html
----------------------------------------------------------------------
diff --git a/Editor/tests/dom/tracking-removeNodeButKeepChildren-expected.html b/Editor/tests/dom/tracking-removeNodeButKeepChildren-expected.html
new file mode 100644
index 0000000..88f6503
--- /dev/null
+++ b/Editor/tests/dom/tracking-removeNodeButKeepChildren-expected.html
@@ -0,0 +1,85 @@
+<html>
+  <head>
+  </head>
+  <body>-
+Before: positions[0] = (BODY,0)
+Before: positions[1] = (P#p1,0)
+Before: positions[2] = "|ab"
+Before: positions[3] = "a|b"
+Before: positions[4] = "ab|"
+Before: positions[5] = (P#p1,1)
+Before: positions[6] = (BR,0)
+Before: positions[7] = (P#p1,2)
+Before: positions[8] = (BODY,1)
+Before: positions[9] = (P#p2,0)
+Before: positions[10] = "|cd"
+Before: positions[11] = "c|d"
+Before: positions[12] = "cd|"
+Before: positions[13] = (P#p2,1)
+Before: positions[14] = (B,0)
+Before: positions[15] = "|ef"
+Before: positions[16] = "e|f"
+Before: positions[17] = "ef|"
+Before: positions[18] = (B,1)
+Before: positions[19] = (BR,0)
+Before: positions[20] = (B,2)
+Before: positions[21] = (P#p2,2)
+Before: positions[22] = "|gh"
+Before: positions[23] = "g|h"
+Before: positions[24] = "gh|"
+Before: positions[25] = (P#p2,3)
+Before: positions[26] = (BODY,2)
+Before: positions[27] = (P#p3,0)
+Before: positions[28] = "|ij"
+Before: positions[29] = "i|j"
+Before: positions[30] = "ij|"
+Before: positions[31] = (P#p3,1)
+Before: positions[32] = (BR,0)
+Before: positions[33] = (P#p3,2)
+Before: positions[34] = (BODY,3)
+Before: positions[35] = "|\n\n"
+Before: positions[36] = "\n|\n"
+Before: positions[37] = "\n\n|"
+Before: positions[38] = (BODY,4)
+
+After: positions[0] = (BODY,0)
+After: positions[1] = (P#p1,0)
+After: positions[2] = "|ab"
+After: positions[3] = "a|b"
+After: positions[4] = "ab|"
+After: positions[5] = (P#p1,1)
+After: positions[6] = (BR,0)
+After: positions[7] = (P#p1,2)
+After: positions[8] = (BODY,1)
+After: positions[9] = (BODY,1) - changed from (P#p2,0)
+After: positions[10] = "|cd"
+After: positions[11] = "c|d"
+After: positions[12] = "cd|"
+After: positions[13] = (BODY,2) - changed from (P#p2,1)
+After: positions[14] = (B,0)
+After: positions[15] = "|ef"
+After: positions[16] = "e|f"
+After: positions[17] = "ef|"
+After: positions[18] = (B,1)
+After: positions[19] = (BR,0)
+After: positions[20] = (B,2)
+After: positions[21] = (BODY,3) - changed from (P#p2,2)
+After: positions[22] = "|gh"
+After: positions[23] = "g|h"
+After: positions[24] = "gh|"
+After: positions[25] = (BODY,4) - changed from (P#p2,3)
+After: positions[26] = (BODY,4) - changed from (BODY,2)
+After: positions[27] = (P#p3,0)
+After: positions[28] = "|ij"
+After: positions[29] = "i|j"
+After: positions[30] = "ij|"
+After: positions[31] = (P#p3,1)
+After: positions[32] = (BR,0)
+After: positions[33] = (P#p3,2)
+After: positions[34] = (BODY,5) - changed from (BODY,3)
+After: positions[35] = "|\n\n"
+After: positions[36] = "\n|\n"
+After: positions[37] = "\n\n|"
+After: positions[38] = (BODY,6) - changed from (BODY,4)
+-</body>
+</html>

http://git-wip-us.apache.org/repos/asf/incubator-corinthia/blob/03bd5af0/Editor/tests/dom/tracking-removeNodeButKeepChildren-input.html
----------------------------------------------------------------------
diff --git a/Editor/tests/dom/tracking-removeNodeButKeepChildren-input.html b/Editor/tests/dom/tracking-removeNodeButKeepChildren-input.html
new file mode 100644
index 0000000..4ea6bc3
--- /dev/null
+++ b/Editor/tests/dom/tracking-removeNodeButKeepChildren-input.html
@@ -0,0 +1,22 @@
+<!DOCTYPE html>
+<html>
+<head>
+<script type="text/javascript" src="RangeTest.js"></script>
+<script>
+
+function performTest()
+{
+    // DOM_wrapNode() should not affect any positions, because the node itself remains in the
+    // tree unmodified.
+
+   var result = comparePositionsBeforeAndAfter(function() {
+        DOM_removeNodeButKeepChildren(document.getElementById("p2"),"DIV");
+    });
+
+    DOM_deleteAllChildren(document.body);
+    DOM_appendChild(document.body,DOM_createTextNode(document,"-\n"+result+"\n-"));
+}
+</script>
+</head>
+<body><p id="p1">ab<br></p><p id="p2">cd<b>ef<br></b>gh</b></p><p id="p3">ij<br></p></body>
+</html>

http://git-wip-us.apache.org/repos/asf/incubator-corinthia/blob/03bd5af0/Editor/tests/dom/tracking-replaceElement-expected.html
----------------------------------------------------------------------
diff --git a/Editor/tests/dom/tracking-replaceElement-expected.html b/Editor/tests/dom/tracking-replaceElement-expected.html
new file mode 100644
index 0000000..a3e6149
--- /dev/null
+++ b/Editor/tests/dom/tracking-replaceElement-expected.html
@@ -0,0 +1,85 @@
+<html>
+  <head>
+  </head>
+  <body>-
+Before: positions[0] = (BODY,0)
+Before: positions[1] = (P#p1,0)
+Before: positions[2] = "|ab"
+Before: positions[3] = "a|b"
+Before: positions[4] = "ab|"
+Before: positions[5] = (P#p1,1)
+Before: positions[6] = (BR,0)
+Before: positions[7] = (P#p1,2)
+Before: positions[8] = (BODY,1)
+Before: positions[9] = (P#p2,0)
+Before: positions[10] = "|cd"
+Before: positions[11] = "c|d"
+Before: positions[12] = "cd|"
+Before: positions[13] = (P#p2,1)
+Before: positions[14] = (B,0)
+Before: positions[15] = "|ef"
+Before: positions[16] = "e|f"
+Before: positions[17] = "ef|"
+Before: positions[18] = (B,1)
+Before: positions[19] = (BR,0)
+Before: positions[20] = (B,2)
+Before: positions[21] = (P#p2,2)
+Before: positions[22] = "|gh"
+Before: positions[23] = "g|h"
+Before: positions[24] = "gh|"
+Before: positions[25] = (P#p2,3)
+Before: positions[26] = (BODY,2)
+Before: positions[27] = (P#p3,0)
+Before: positions[28] = "|ij"
+Before: positions[29] = "i|j"
+Before: positions[30] = "ij|"
+Before: positions[31] = (P#p3,1)
+Before: positions[32] = (BR,0)
+Before: positions[33] = (P#p3,2)
+Before: positions[34] = (BODY,3)
+Before: positions[35] = "|\n\n"
+Before: positions[36] = "\n|\n"
+Before: positions[37] = "\n\n|"
+Before: positions[38] = (BODY,4)
+
+After: positions[0] = (BODY,0)
+After: positions[1] = (P#p1,0)
+After: positions[2] = "|ab"
+After: positions[3] = "a|b"
+After: positions[4] = "ab|"
+After: positions[5] = (P#p1,1)
+After: positions[6] = (BR,0)
+After: positions[7] = (P#p1,2)
+After: positions[8] = (BODY,1)
+After: positions[9] = (DIV#p2,0) - changed from (P#p2,0)
+After: positions[10] = "|cd"
+After: positions[11] = "c|d"
+After: positions[12] = "cd|"
+After: positions[13] = (DIV#p2,1) - changed from (P#p2,1)
+After: positions[14] = (B,0)
+After: positions[15] = "|ef"
+After: positions[16] = "e|f"
+After: positions[17] = "ef|"
+After: positions[18] = (B,1)
+After: positions[19] = (BR,0)
+After: positions[20] = (B,2)
+After: positions[21] = (DIV#p2,2) - changed from (P#p2,2)
+After: positions[22] = "|gh"
+After: positions[23] = "g|h"
+After: positions[24] = "gh|"
+After: positions[25] = (DIV#p2,3) - changed from (P#p2,3)
+After: positions[26] = (BODY,2)
+After: positions[27] = (P#p3,0)
+After: positions[28] = "|ij"
+After: positions[29] = "i|j"
+After: positions[30] = "ij|"
+After: positions[31] = (P#p3,1)
+After: positions[32] = (BR,0)
+After: positions[33] = (P#p3,2)
+After: positions[34] = (BODY,3)
+After: positions[35] = "|\n\n"
+After: positions[36] = "\n|\n"
+After: positions[37] = "\n\n|"
+After: positions[38] = (BODY,4)
+-</body>
+</html>

http://git-wip-us.apache.org/repos/asf/incubator-corinthia/blob/03bd5af0/Editor/tests/dom/tracking-replaceElement-input.html
----------------------------------------------------------------------
diff --git a/Editor/tests/dom/tracking-replaceElement-input.html b/Editor/tests/dom/tracking-replaceElement-input.html
new file mode 100644
index 0000000..f4237b3
--- /dev/null
+++ b/Editor/tests/dom/tracking-replaceElement-input.html
@@ -0,0 +1,22 @@
+<!DOCTYPE html>
+<html>
+<head>
+<script type="text/javascript" src="RangeTest.js"></script>
+<script>
+
+function performTest()
+{
+    // DOM_wrapNode() should not affect any positions, because the node itself remains in the
+    // tree unmodified.
+
+    var result = comparePositionsBeforeAndAfter(function() {
+        DOM_replaceElement(document.getElementById("p2"),"DIV");
+    });
+
+    DOM_deleteAllChildren(document.body);
+    DOM_appendChild(document.body,DOM_createTextNode(document,"-\n"+result+"\n-"));
+}
+</script>
+</head>
+<body><p id="p1">ab<br></p><p id="p2">cd<b>ef<br></b>gh</b></p><p id="p3">ij<br></p></body>
+</html>

http://git-wip-us.apache.org/repos/asf/incubator-corinthia/blob/03bd5af0/Editor/tests/dom/tracking-text1-expected.html
----------------------------------------------------------------------
diff --git a/Editor/tests/dom/tracking-text1-expected.html b/Editor/tests/dom/tracking-text1-expected.html
new file mode 100644
index 0000000..c2814ab
--- /dev/null
+++ b/Editor/tests/dom/tracking-text1-expected.html
@@ -0,0 +1,43 @@
+<html>
+  <head></head>
+  <body>-
+Before text change:
+positions[0] = "|Here is some text"
+positions[1] = "H|ere is some text"
+positions[2] = "He|re is some text"
+positions[3] = "Her|e is some text"
+positions[4] = "Here| is some text"
+positions[5] = "Here |is some text"
+positions[6] = "Here i|s some text"
+positions[7] = "Here is| some text"
+positions[8] = "Here is |some text"
+positions[9] = "Here is s|ome text"
+positions[10] = "Here is so|me text"
+positions[11] = "Here is som|e text"
+positions[12] = "Here is some| text"
+positions[13] = "Here is some |text"
+positions[14] = "Here is some t|ext"
+positions[15] = "Here is some te|xt"
+positions[16] = "Here is some tex|t"
+positions[17] = "Here is some text|"
+After text change:
+positions[0] = "|Here is text"
+positions[1] = "H|ere is text"
+positions[2] = "He|re is text"
+positions[3] = "Her|e is text"
+positions[4] = "Here| is text"
+positions[5] = "Here |is text"
+positions[6] = "Here i|s text"
+positions[7] = "Here is| text"
+positions[8] = "Here is |text"
+positions[9] = "Here is |text"
+positions[10] = "Here is |text"
+positions[11] = "Here is |text"
+positions[12] = "Here is |text"
+positions[13] = "Here is |text"
+positions[14] = "Here is t|ext"
+positions[15] = "Here is te|xt"
+positions[16] = "Here is tex|t"
+positions[17] = "Here is text|"
+-</body>
+</html>

http://git-wip-us.apache.org/repos/asf/incubator-corinthia/blob/03bd5af0/Editor/tests/dom/tracking-text1-input.html
----------------------------------------------------------------------
diff --git a/Editor/tests/dom/tracking-text1-input.html b/Editor/tests/dom/tracking-text1-input.html
new file mode 100644
index 0000000..aa854c2
--- /dev/null
+++ b/Editor/tests/dom/tracking-text1-input.html
@@ -0,0 +1,32 @@
+<!DOCTYPE html>
+<html>
+<head>
+<script>
+function performTest()
+{
+    var p = document.getElementsByTagName("P")[0];
+    var text = p.firstChild;
+    var positions = new Array();
+    for (var i = 0; i <= text.nodeValue.length; i++)
+        positions.push(new Position(text,i));
+
+    var messages = new Array();
+    messages.push("Before text change:");
+    for (var i = 0; i < positions.length; i++)
+        messages.push("positions["+i+"] = "+positions[i]);
+
+    Position_trackWhileExecuting(positions,function() {
+        DOM_deleteCharacters(text,8,13);
+    });
+
+    messages.push("After text change:");
+    for (var i = 0; i < positions.length; i++)
+        messages.push("positions["+i+"] = "+positions[i]);
+
+    DOM_deleteAllChildren(document.body);
+    DOM_appendChild(document.body,DOM_createTextNode(document,"-\n"+messages.join("\n")+"\n-"));
+}
+</script>
+</head>
+<body><p>Here is some text</p></body>
+</html>

http://git-wip-us.apache.org/repos/asf/incubator-corinthia/blob/03bd5af0/Editor/tests/dom/tracking-text2-expected.html
----------------------------------------------------------------------
diff --git a/Editor/tests/dom/tracking-text2-expected.html b/Editor/tests/dom/tracking-text2-expected.html
new file mode 100644
index 0000000..f435e11
--- /dev/null
+++ b/Editor/tests/dom/tracking-text2-expected.html
@@ -0,0 +1,43 @@
+<html>
+  <head></head>
+  <body>-
+Before text change:
+positions[0] = "|Here is some text"
+positions[1] = "H|ere is some text"
+positions[2] = "He|re is some text"
+positions[3] = "Her|e is some text"
+positions[4] = "Here| is some text"
+positions[5] = "Here |is some text"
+positions[6] = "Here i|s some text"
+positions[7] = "Here is| some text"
+positions[8] = "Here is |some text"
+positions[9] = "Here is s|ome text"
+positions[10] = "Here is so|me text"
+positions[11] = "Here is som|e text"
+positions[12] = "Here is some| text"
+positions[13] = "Here is some |text"
+positions[14] = "Here is some t|ext"
+positions[15] = "Here is some te|xt"
+positions[16] = "Here is some tex|t"
+positions[17] = "Here is some text|"
+After text change:
+positions[0] = "|is some text"
+positions[1] = "|is some text"
+positions[2] = "|is some text"
+positions[3] = "|is some text"
+positions[4] = "|is some text"
+positions[5] = "|is some text"
+positions[6] = "i|s some text"
+positions[7] = "is| some text"
+positions[8] = "is |some text"
+positions[9] = "is s|ome text"
+positions[10] = "is so|me text"
+positions[11] = "is som|e text"
+positions[12] = "is some| text"
+positions[13] = "is some |text"
+positions[14] = "is some t|ext"
+positions[15] = "is some te|xt"
+positions[16] = "is some tex|t"
+positions[17] = "is some text|"
+-</body>
+</html>

http://git-wip-us.apache.org/repos/asf/incubator-corinthia/blob/03bd5af0/Editor/tests/dom/tracking-text2-input.html
----------------------------------------------------------------------
diff --git a/Editor/tests/dom/tracking-text2-input.html b/Editor/tests/dom/tracking-text2-input.html
new file mode 100644
index 0000000..f952c17
--- /dev/null
+++ b/Editor/tests/dom/tracking-text2-input.html
@@ -0,0 +1,32 @@
+<!DOCTYPE html>
+<html>
+<head>
+<script>
+function performTest()
+{
+    var p = document.getElementsByTagName("P")[0];
+    var text = p.firstChild;
+    var positions = new Array();
+    for (var i = 0; i <= text.nodeValue.length; i++)
+        positions.push(new Position(text,i));
+
+    var messages = new Array();
+    messages.push("Before text change:");
+    for (var i = 0; i < positions.length; i++)
+        messages.push("positions["+i+"] = "+positions[i]);
+
+    Position_trackWhileExecuting(positions,function() {
+        DOM_deleteCharacters(text,0,5);
+    });
+
+    messages.push("After text change:");
+    for (var i = 0; i < positions.length; i++)
+        messages.push("positions["+i+"] = "+positions[i]);
+
+    DOM_deleteAllChildren(document.body);
+    DOM_appendChild(document.body,DOM_createTextNode(document,"-\n"+messages.join("\n")+"\n-"));
+}
+</script>
+</head>
+<body><p>Here is some text</p></body>
+</html>

http://git-wip-us.apache.org/repos/asf/incubator-corinthia/blob/03bd5af0/Editor/tests/dom/tracking-text3-expected.html
----------------------------------------------------------------------
diff --git a/Editor/tests/dom/tracking-text3-expected.html b/Editor/tests/dom/tracking-text3-expected.html
new file mode 100644
index 0000000..57b328e
--- /dev/null
+++ b/Editor/tests/dom/tracking-text3-expected.html
@@ -0,0 +1,43 @@
+<html>
+  <head></head>
+  <body>-
+Before text change:
+positions[0] = "|Here is some text"
+positions[1] = "H|ere is some text"
+positions[2] = "He|re is some text"
+positions[3] = "Her|e is some text"
+positions[4] = "Here| is some text"
+positions[5] = "Here |is some text"
+positions[6] = "Here i|s some text"
+positions[7] = "Here is| some text"
+positions[8] = "Here is |some text"
+positions[9] = "Here is s|ome text"
+positions[10] = "Here is so|me text"
+positions[11] = "Here is som|e text"
+positions[12] = "Here is some| text"
+positions[13] = "Here is some |text"
+positions[14] = "Here is some t|ext"
+positions[15] = "Here is some te|xt"
+positions[16] = "Here is some tex|t"
+positions[17] = "Here is some text|"
+After text change:
+positions[0] = "|Here is some"
+positions[1] = "H|ere is some"
+positions[2] = "He|re is some"
+positions[3] = "Her|e is some"
+positions[4] = "Here| is some"
+positions[5] = "Here |is some"
+positions[6] = "Here i|s some"
+positions[7] = "Here is| some"
+positions[8] = "Here is |some"
+positions[9] = "Here is s|ome"
+positions[10] = "Here is so|me"
+positions[11] = "Here is som|e"
+positions[12] = "Here is some|"
+positions[13] = "Here is some|"
+positions[14] = "Here is some|"
+positions[15] = "Here is some|"
+positions[16] = "Here is some|"
+positions[17] = "Here is some|"
+-</body>
+</html>

http://git-wip-us.apache.org/repos/asf/incubator-corinthia/blob/03bd5af0/Editor/tests/dom/tracking-text3-input.html
----------------------------------------------------------------------
diff --git a/Editor/tests/dom/tracking-text3-input.html b/Editor/tests/dom/tracking-text3-input.html
new file mode 100644
index 0000000..e19dad9
--- /dev/null
+++ b/Editor/tests/dom/tracking-text3-input.html
@@ -0,0 +1,32 @@
+<!DOCTYPE html>
+<html>
+<head>
+<script>
+function performTest()
+{
+    var p = document.getElementsByTagName("P")[0];
+    var text = p.firstChild;
+    var positions = new Array();
+    for (var i = 0; i <= text.nodeValue.length; i++)
+        positions.push(new Position(text,i));
+
+    var messages = new Array();
+    messages.push("Before text change:");
+    for (var i = 0; i < positions.length; i++)
+        messages.push("positions["+i+"] = "+positions[i]);
+
+    Position_trackWhileExecuting(positions,function() {
+        DOM_deleteCharacters(text,12);
+    });
+
+    messages.push("After text change:");
+    for (var i = 0; i < positions.length; i++)
+        messages.push("positions["+i+"] = "+positions[i]);
+
+    DOM_deleteAllChildren(document.body);
+    DOM_appendChild(document.body,DOM_createTextNode(document,"-\n"+messages.join("\n")+"\n-"));
+}
+</script>
+</head>
+<body><p>Here is some text</p></body>
+</html>

http://git-wip-us.apache.org/repos/asf/incubator-corinthia/blob/03bd5af0/Editor/tests/dom/tracking-text4-expected.html
----------------------------------------------------------------------
diff --git a/Editor/tests/dom/tracking-text4-expected.html b/Editor/tests/dom/tracking-text4-expected.html
new file mode 100644
index 0000000..1339a49
--- /dev/null
+++ b/Editor/tests/dom/tracking-text4-expected.html
@@ -0,0 +1,43 @@
+<html>
+  <head></head>
+  <body>-
+Before text change:
+positions[0] = "|Here is some text"
+positions[1] = "H|ere is some text"
+positions[2] = "He|re is some text"
+positions[3] = "Her|e is some text"
+positions[4] = "Here| is some text"
+positions[5] = "Here |is some text"
+positions[6] = "Here i|s some text"
+positions[7] = "Here is| some text"
+positions[8] = "Here is |some text"
+positions[9] = "Here is s|ome text"
+positions[10] = "Here is so|me text"
+positions[11] = "Here is som|e text"
+positions[12] = "Here is some| text"
+positions[13] = "Here is some |text"
+positions[14] = "Here is some t|ext"
+positions[15] = "Here is some te|xt"
+positions[16] = "Here is some tex|t"
+positions[17] = "Here is some text|"
+After text change:
+positions[0] = "|Here is (inserted)some text"
+positions[1] = "H|ere is (inserted)some text"
+positions[2] = "He|re is (inserted)some text"
+positions[3] = "Her|e is (inserted)some text"
+positions[4] = "Here| is (inserted)some text"
+positions[5] = "Here |is (inserted)some text"
+positions[6] = "Here i|s (inserted)some text"
+positions[7] = "Here is| (inserted)some text"
+positions[8] = "Here is |(inserted)some text"
+positions[9] = "Here is (inserted)s|ome text"
+positions[10] = "Here is (inserted)so|me text"
+positions[11] = "Here is (inserted)som|e text"
+positions[12] = "Here is (inserted)some| text"
+positions[13] = "Here is (inserted)some |text"
+positions[14] = "Here is (inserted)some t|ext"
+positions[15] = "Here is (inserted)some te|xt"
+positions[16] = "Here is (inserted)some tex|t"
+positions[17] = "Here is (inserted)some text|"
+-</body>
+</html>

http://git-wip-us.apache.org/repos/asf/incubator-corinthia/blob/03bd5af0/Editor/tests/dom/tracking-text4-input.html
----------------------------------------------------------------------
diff --git a/Editor/tests/dom/tracking-text4-input.html b/Editor/tests/dom/tracking-text4-input.html
new file mode 100644
index 0000000..7c1fe7b
--- /dev/null
+++ b/Editor/tests/dom/tracking-text4-input.html
@@ -0,0 +1,32 @@
+<!DOCTYPE html>
+<html>
+<head>
+<script>
+function performTest()
+{
+    var p = document.getElementsByTagName("P")[0];
+    var text = p.firstChild;
+    var positions = new Array();
+    for (var i = 0; i <= text.nodeValue.length; i++)
+        positions.push(new Position(text,i));
+
+    var messages = new Array();
+    messages.push("Before text change:");
+    for (var i = 0; i < positions.length; i++)
+        messages.push("positions["+i+"] = "+positions[i]);
+
+    Position_trackWhileExecuting(positions,function() {
+        DOM_insertCharacters(text,8,"(inserted)");
+    });
+
+    messages.push("After text change:");
+    for (var i = 0; i < positions.length; i++)
+        messages.push("positions["+i+"] = "+positions[i]);
+
+    DOM_deleteAllChildren(document.body);
+    DOM_appendChild(document.body,DOM_createTextNode(document,"-\n"+messages.join("\n")+"\n-"));
+}
+</script>
+</head>
+<body><p>Here is some text</p></body>
+</html>

http://git-wip-us.apache.org/repos/asf/incubator-corinthia/blob/03bd5af0/Editor/tests/dom/tracking-text5-expected.html
----------------------------------------------------------------------
diff --git a/Editor/tests/dom/tracking-text5-expected.html b/Editor/tests/dom/tracking-text5-expected.html
new file mode 100644
index 0000000..a60a0ea
--- /dev/null
+++ b/Editor/tests/dom/tracking-text5-expected.html
@@ -0,0 +1,43 @@
+<html>
+  <head></head>
+  <body>-
+Before text change:
+positions[0] = "|Here is some text"
+positions[1] = "H|ere is some text"
+positions[2] = "He|re is some text"
+positions[3] = "Her|e is some text"
+positions[4] = "Here| is some text"
+positions[5] = "Here |is some text"
+positions[6] = "Here i|s some text"
+positions[7] = "Here is| some text"
+positions[8] = "Here is |some text"
+positions[9] = "Here is s|ome text"
+positions[10] = "Here is so|me text"
+positions[11] = "Here is som|e text"
+positions[12] = "Here is some| text"
+positions[13] = "Here is some |text"
+positions[14] = "Here is some t|ext"
+positions[15] = "Here is some te|xt"
+positions[16] = "Here is some tex|t"
+positions[17] = "Here is some text|"
+After text change:
+positions[0] = "|(inserted)Here is some text"
+positions[1] = "(inserted)H|ere is some text"
+positions[2] = "(inserted)He|re is some text"
+positions[3] = "(inserted)Her|e is some text"
+positions[4] = "(inserted)Here| is some text"
+positions[5] = "(inserted)Here |is some text"
+positions[6] = "(inserted)Here i|s some text"
+positions[7] = "(inserted)Here is| some text"
+positions[8] = "(inserted)Here is |some text"
+positions[9] = "(inserted)Here is s|ome text"
+positions[10] = "(inserted)Here is so|me text"
+positions[11] = "(inserted)Here is som|e text"
+positions[12] = "(inserted)Here is some| text"
+positions[13] = "(inserted)Here is some |text"
+positions[14] = "(inserted)Here is some t|ext"
+positions[15] = "(inserted)Here is some te|xt"
+positions[16] = "(inserted)Here is some tex|t"
+positions[17] = "(inserted)Here is some text|"
+-</body>
+</html>

http://git-wip-us.apache.org/repos/asf/incubator-corinthia/blob/03bd5af0/Editor/tests/dom/tracking-text5-input.html
----------------------------------------------------------------------
diff --git a/Editor/tests/dom/tracking-text5-input.html b/Editor/tests/dom/tracking-text5-input.html
new file mode 100644
index 0000000..c4b0018
--- /dev/null
+++ b/Editor/tests/dom/tracking-text5-input.html
@@ -0,0 +1,32 @@
+<!DOCTYPE html>
+<html>
+<head>
+<script>
+function performTest()
+{
+    var p = document.getElementsByTagName("P")[0];
+    var text = p.firstChild;
+    var positions = new Array();
+    for (var i = 0; i <= text.nodeValue.length; i++)
+        positions.push(new Position(text,i));
+
+    var messages = new Array();
+    messages.push("Before text change:");
+    for (var i = 0; i < positions.length; i++)
+        messages.push("positions["+i+"] = "+positions[i]);
+
+    Position_trackWhileExecuting(positions,function() {
+        DOM_insertCharacters(text,0,"(inserted)");
+    });
+
+    messages.push("After text change:");
+    for (var i = 0; i < positions.length; i++)
+        messages.push("positions["+i+"] = "+positions[i]);
+
+    DOM_deleteAllChildren(document.body);
+    DOM_appendChild(document.body,DOM_createTextNode(document,"-\n"+messages.join("\n")+"\n-"));
+}
+</script>
+</head>
+<body><p>Here is some text</p></body>
+</html>

http://git-wip-us.apache.org/repos/asf/incubator-corinthia/blob/03bd5af0/Editor/tests/dom/tracking-text6-expected.html
----------------------------------------------------------------------
diff --git a/Editor/tests/dom/tracking-text6-expected.html b/Editor/tests/dom/tracking-text6-expected.html
new file mode 100644
index 0000000..81f5d4f
--- /dev/null
+++ b/Editor/tests/dom/tracking-text6-expected.html
@@ -0,0 +1,43 @@
+<html>
+  <head></head>
+  <body>-
+Before text change:
+positions[0] = "|Here is some text"
+positions[1] = "H|ere is some text"
+positions[2] = "He|re is some text"
+positions[3] = "Her|e is some text"
+positions[4] = "Here| is some text"
+positions[5] = "Here |is some text"
+positions[6] = "Here i|s some text"
+positions[7] = "Here is| some text"
+positions[8] = "Here is |some text"
+positions[9] = "Here is s|ome text"
+positions[10] = "Here is so|me text"
+positions[11] = "Here is som|e text"
+positions[12] = "Here is some| text"
+positions[13] = "Here is some |text"
+positions[14] = "Here is some t|ext"
+positions[15] = "Here is some te|xt"
+positions[16] = "Here is some tex|t"
+positions[17] = "Here is some text|"
+After text change:
+positions[0] = "|Here is some text(inserted)"
+positions[1] = "H|ere is some text(inserted)"
+positions[2] = "He|re is some text(inserted)"
+positions[3] = "Her|e is some text(inserted)"
+positions[4] = "Here| is some text(inserted)"
+positions[5] = "Here |is some text(inserted)"
+positions[6] = "Here i|s some text(inserted)"
+positions[7] = "Here is| some text(inserted)"
+positions[8] = "Here is |some text(inserted)"
+positions[9] = "Here is s|ome text(inserted)"
+positions[10] = "Here is so|me text(inserted)"
+positions[11] = "Here is som|e text(inserted)"
+positions[12] = "Here is some| text(inserted)"
+positions[13] = "Here is some |text(inserted)"
+positions[14] = "Here is some t|ext(inserted)"
+positions[15] = "Here is some te|xt(inserted)"
+positions[16] = "Here is some tex|t(inserted)"
+positions[17] = "Here is some text|(inserted)"
+-</body>
+</html>

http://git-wip-us.apache.org/repos/asf/incubator-corinthia/blob/03bd5af0/Editor/tests/dom/tracking-text6-input.html
----------------------------------------------------------------------
diff --git a/Editor/tests/dom/tracking-text6-input.html b/Editor/tests/dom/tracking-text6-input.html
new file mode 100644
index 0000000..07b8887
--- /dev/null
+++ b/Editor/tests/dom/tracking-text6-input.html
@@ -0,0 +1,32 @@
+<!DOCTYPE html>
+<html>
+<head>
+<script>
+function performTest()
+{
+    var p = document.getElementsByTagName("P")[0];
+    var text = p.firstChild;
+    var positions = new Array();
+    for (var i = 0; i <= text.nodeValue.length; i++)
+        positions.push(new Position(text,i));
+
+    var messages = new Array();
+    messages.push("Before text change:");
+    for (var i = 0; i < positions.length; i++)
+        messages.push("positions["+i+"] = "+positions[i]);
+
+    Position_trackWhileExecuting(positions,function() {
+        DOM_insertCharacters(text,text.nodeValue.length,"(inserted)");
+    });
+
+    messages.push("After text change:");
+    for (var i = 0; i < positions.length; i++)
+        messages.push("positions["+i+"] = "+positions[i]);
+
+    DOM_deleteAllChildren(document.body);
+    DOM_appendChild(document.body,DOM_createTextNode(document,"-\n"+messages.join("\n")+"\n-"));
+}
+</script>
+</head>
+<body><p>Here is some text</p></body>
+</html>

http://git-wip-us.apache.org/repos/asf/incubator-corinthia/blob/03bd5af0/Editor/tests/dom/tracking-text7-expected.html
----------------------------------------------------------------------
diff --git a/Editor/tests/dom/tracking-text7-expected.html b/Editor/tests/dom/tracking-text7-expected.html
new file mode 100644
index 0000000..5b65f1b
--- /dev/null
+++ b/Editor/tests/dom/tracking-text7-expected.html
@@ -0,0 +1,43 @@
+<html>
+  <head></head>
+  <body>-
+Before text change:
+positions[0] = "|Here is some text"
+positions[1] = "H|ere is some text"
+positions[2] = "He|re is some text"
+positions[3] = "Her|e is some text"
+positions[4] = "Here| is some text"
+positions[5] = "Here |is some text"
+positions[6] = "Here i|s some text"
+positions[7] = "Here is| some text"
+positions[8] = "Here is |some text"
+positions[9] = "Here is s|ome text"
+positions[10] = "Here is so|me text"
+positions[11] = "Here is som|e text"
+positions[12] = "Here is some| text"
+positions[13] = "Here is some |text"
+positions[14] = "Here is some t|ext"
+positions[15] = "Here is some te|xt"
+positions[16] = "Here is some tex|t"
+positions[17] = "Here is some text|"
+After text change:
+positions[0] = "|Here is (inserted)text"
+positions[1] = "H|ere is (inserted)text"
+positions[2] = "He|re is (inserted)text"
+positions[3] = "Her|e is (inserted)text"
+positions[4] = "Here| is (inserted)text"
+positions[5] = "Here |is (inserted)text"
+positions[6] = "Here i|s (inserted)text"
+positions[7] = "Here is| (inserted)text"
+positions[8] = "Here is |(inserted)text"
+positions[9] = "Here is |(inserted)text"
+positions[10] = "Here is |(inserted)text"
+positions[11] = "Here is |(inserted)text"
+positions[12] = "Here is |(inserted)text"
+positions[13] = "Here is |(inserted)text"
+positions[14] = "Here is (inserted)t|ext"
+positions[15] = "Here is (inserted)te|xt"
+positions[16] = "Here is (inserted)tex|t"
+positions[17] = "Here is (inserted)text|"
+-</body>
+</html>

http://git-wip-us.apache.org/repos/asf/incubator-corinthia/blob/03bd5af0/Editor/tests/dom/tracking-text7-input.html
----------------------------------------------------------------------
diff --git a/Editor/tests/dom/tracking-text7-input.html b/Editor/tests/dom/tracking-text7-input.html
new file mode 100644
index 0000000..00942ca
--- /dev/null
+++ b/Editor/tests/dom/tracking-text7-input.html
@@ -0,0 +1,33 @@
+<!DOCTYPE html>
+<html>
+<head>
+<script>
+function performTest()
+{
+    var p = document.getElementsByTagName("P")[0];
+    var text = p.firstChild;
+    var positions = new Array();
+    for (var i = 0; i <= text.nodeValue.length; i++)
+        positions.push(new Position(text,i));
+
+    var messages = new Array();
+    messages.push("Before text change:");
+    for (var i = 0; i < positions.length; i++)
+        messages.push("positions["+i+"] = "+positions[i]);
+
+    Position_trackWhileExecuting(positions,function() {
+        DOM_deleteCharacters(text,8,13);
+        DOM_insertCharacters(text,8,"(inserted)");
+    });
+
+    messages.push("After text change:");
+    for (var i = 0; i < positions.length; i++)
+        messages.push("positions["+i+"] = "+positions[i]);
+
+    DOM_deleteAllChildren(document.body);
+    DOM_appendChild(document.body,DOM_createTextNode(document,"-\n"+messages.join("\n")+"\n-"));
+}
+</script>
+</head>
+<body><p>Here is some text</p></body>
+</html>

http://git-wip-us.apache.org/repos/asf/incubator-corinthia/blob/03bd5af0/Editor/tests/dom/tracking-text8-expected.html
----------------------------------------------------------------------
diff --git a/Editor/tests/dom/tracking-text8-expected.html b/Editor/tests/dom/tracking-text8-expected.html
new file mode 100644
index 0000000..5e9ba61
--- /dev/null
+++ b/Editor/tests/dom/tracking-text8-expected.html
@@ -0,0 +1,43 @@
+<html>
+  <head></head>
+  <body>-
+Before text change:
+positions[0] = "|Here is some text"
+positions[1] = "H|ere is some text"
+positions[2] = "He|re is some text"
+positions[3] = "Her|e is some text"
+positions[4] = "Here| is some text"
+positions[5] = "Here |is some text"
+positions[6] = "Here i|s some text"
+positions[7] = "Here is| some text"
+positions[8] = "Here is |some text"
+positions[9] = "Here is s|ome text"
+positions[10] = "Here is so|me text"
+positions[11] = "Here is som|e text"
+positions[12] = "Here is some| text"
+positions[13] = "Here is some |text"
+positions[14] = "Here is some t|ext"
+positions[15] = "Here is some te|xt"
+positions[16] = "Here is some tex|t"
+positions[17] = "Here is some text|"
+After text change:
+positions[0] = "|(inserted) is some text"
+positions[1] = "|(inserted) is some text"
+positions[2] = "|(inserted) is some text"
+positions[3] = "|(inserted) is some text"
+positions[4] = "|(inserted) is some text"
+positions[5] = "(inserted) |is some text"
+positions[6] = "(inserted) i|s some text"
+positions[7] = "(inserted) is| some text"
+positions[8] = "(inserted) is |some text"
+positions[9] = "(inserted) is s|ome text"
+positions[10] = "(inserted) is so|me text"
+positions[11] = "(inserted) is som|e text"
+positions[12] = "(inserted) is some| text"
+positions[13] = "(inserted) is some |text"
+positions[14] = "(inserted) is some t|ext"
+positions[15] = "(inserted) is some te|xt"
+positions[16] = "(inserted) is some tex|t"
+positions[17] = "(inserted) is some text|"
+-</body>
+</html>

http://git-wip-us.apache.org/repos/asf/incubator-corinthia/blob/03bd5af0/Editor/tests/dom/tracking-text8-input.html
----------------------------------------------------------------------
diff --git a/Editor/tests/dom/tracking-text8-input.html b/Editor/tests/dom/tracking-text8-input.html
new file mode 100644
index 0000000..d40c4a1
--- /dev/null
+++ b/Editor/tests/dom/tracking-text8-input.html
@@ -0,0 +1,33 @@
+<!DOCTYPE html>
+<html>
+<head>
+<script>
+function performTest()
+{
+    var p = document.getElementsByTagName("P")[0];
+    var text = p.firstChild;
+    var positions = new Array();
+    for (var i = 0; i <= text.nodeValue.length; i++)
+        positions.push(new Position(text,i));
+
+    var messages = new Array();
+    messages.push("Before text change:");
+    for (var i = 0; i < positions.length; i++)
+        messages.push("positions["+i+"] = "+positions[i]);
+
+    Position_trackWhileExecuting(positions,function() {
+        DOM_deleteCharacters(text,0,4);
+        DOM_insertCharacters(text,0,"(inserted)");
+    });
+
+    messages.push("After text change:");
+    for (var i = 0; i < positions.length; i++)
+        messages.push("positions["+i+"] = "+positions[i]);
+
+    DOM_deleteAllChildren(document.body);
+    DOM_appendChild(document.body,DOM_createTextNode(document,"-\n"+messages.join("\n")+"\n-"));
+}
+</script>
+</head>
+<body><p>Here is some text</p></body>
+</html>

http://git-wip-us.apache.org/repos/asf/incubator-corinthia/blob/03bd5af0/Editor/tests/dom/tracking-text9-expected.html
----------------------------------------------------------------------
diff --git a/Editor/tests/dom/tracking-text9-expected.html b/Editor/tests/dom/tracking-text9-expected.html
new file mode 100644
index 0000000..a6a11f4
--- /dev/null
+++ b/Editor/tests/dom/tracking-text9-expected.html
@@ -0,0 +1,43 @@
+<html>
+  <head></head>
+  <body>-
+Before text change:
+positions[0] = "|Here is some text"
+positions[1] = "H|ere is some text"
+positions[2] = "He|re is some text"
+positions[3] = "Her|e is some text"
+positions[4] = "Here| is some text"
+positions[5] = "Here |is some text"
+positions[6] = "Here i|s some text"
+positions[7] = "Here is| some text"
+positions[8] = "Here is |some text"
+positions[9] = "Here is s|ome text"
+positions[10] = "Here is so|me text"
+positions[11] = "Here is som|e text"
+positions[12] = "Here is some| text"
+positions[13] = "Here is some |text"
+positions[14] = "Here is some t|ext"
+positions[15] = "Here is some te|xt"
+positions[16] = "Here is some tex|t"
+positions[17] = "Here is some text|"
+After text change:
+positions[0] = "|text(inserted)"
+positions[1] = "|text(inserted)"
+positions[2] = "|text(inserted)"
+positions[3] = "|text(inserted)"
+positions[4] = "|text(inserted)"
+positions[5] = "|text(inserted)"
+positions[6] = "|text(inserted)"
+positions[7] = "|text(inserted)"
+positions[8] = "|text(inserted)"
+positions[9] = "|text(inserted)"
+positions[10] = "|text(inserted)"
+positions[11] = "|text(inserted)"
+positions[12] = "|text(inserted)"
+positions[13] = "|text(inserted)"
+positions[14] = "t|ext(inserted)"
+positions[15] = "te|xt(inserted)"
+positions[16] = "tex|t(inserted)"
+positions[17] = "text|(inserted)"
+-</body>
+</html>

http://git-wip-us.apache.org/repos/asf/incubator-corinthia/blob/03bd5af0/Editor/tests/dom/tracking-text9-input.html
----------------------------------------------------------------------
diff --git a/Editor/tests/dom/tracking-text9-input.html b/Editor/tests/dom/tracking-text9-input.html
new file mode 100644
index 0000000..326c848
--- /dev/null
+++ b/Editor/tests/dom/tracking-text9-input.html
@@ -0,0 +1,33 @@
+<!DOCTYPE html>
+<html>
+<head>
+<script>
+function performTest()
+{
+    var p = document.getElementsByTagName("P")[0];
+    var text = p.firstChild;
+    var positions = new Array();
+    for (var i = 0; i <= text.nodeValue.length; i++)
+        positions.push(new Position(text,i));
+
+    var messages = new Array();
+    messages.push("Before text change:");
+    for (var i = 0; i < positions.length; i++)
+        messages.push("positions["+i+"] = "+positions[i]);
+
+    Position_trackWhileExecuting(positions,function() {
+        DOM_deleteCharacters(text,0,13);
+        DOM_insertCharacters(text,text.nodeValue.length,"(inserted)");
+    });
+
+    messages.push("After text change:");
+    for (var i = 0; i < positions.length; i++)
+        messages.push("positions["+i+"] = "+positions[i]);
+
+    DOM_deleteAllChildren(document.body);
+    DOM_appendChild(document.body,DOM_createTextNode(document,"-\n"+messages.join("\n")+"\n-"));
+}
+</script>
+</head>
+<body><p>Here is some text</p></body>
+</html>


Mime
View raw message