corinthia-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pmke...@apache.org
Subject [29/92] [abbrv] [partial] incubator-corinthia git commit: Add editing code from UX Write
Date Wed, 17 Dec 2014 13:28:39 GMT
http://git-wip-us.apache.org/repos/asf/incubator-corinthia/blob/03bd5af0/Editor/tests/dom/ensureInlineNodesInParagraph12-expected.html
----------------------------------------------------------------------
diff --git a/Editor/tests/dom/ensureInlineNodesInParagraph12-expected.html b/Editor/tests/dom/ensureInlineNodesInParagraph12-expected.html
new file mode 100644
index 0000000..dcaa6db
--- /dev/null
+++ b/Editor/tests/dom/ensureInlineNodesInParagraph12-expected.html
@@ -0,0 +1,10 @@
+<html>
+  <head></head>
+  <body>
+    <p>
+      One
+      [Two
+      ]Three
+    </p>
+  </body>
+</html>

http://git-wip-us.apache.org/repos/asf/incubator-corinthia/blob/03bd5af0/Editor/tests/dom/ensureInlineNodesInParagraph12-input.html
----------------------------------------------------------------------
diff --git a/Editor/tests/dom/ensureInlineNodesInParagraph12-input.html b/Editor/tests/dom/ensureInlineNodesInParagraph12-input.html
new file mode 100644
index 0000000..754d737
--- /dev/null
+++ b/Editor/tests/dom/ensureInlineNodesInParagraph12-input.html
@@ -0,0 +1,26 @@
+<!DOCTYPE html>
+<html>
+<head>
+<script>
+function performTest()
+{
+    var text1 = DOM_createTextNode(document,"One");
+    var text2 = DOM_createTextNode(document,"Two");
+    var text3 = DOM_createTextNode(document,"Three");
+    DOM_deleteAllChildren(document.body);
+    DOM_appendChild(document.body,text1);
+    DOM_appendChild(document.body,text2);
+    DOM_appendChild(document.body,text3);
+
+    var range = new Range(document.body,1,document.body,2);
+
+    Range_trackWhileExecuting(range,function() {
+        Range_ensureInlineNodesInParagraph(range);
+    });
+    showRangeAsBrackets(range);
+}
+</script>
+</head>
+<body>
+</body>
+</html>

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

http://git-wip-us.apache.org/repos/asf/incubator-corinthia/blob/03bd5af0/Editor/tests/dom/ensureInlineNodesInParagraph13-input.html
----------------------------------------------------------------------
diff --git a/Editor/tests/dom/ensureInlineNodesInParagraph13-input.html b/Editor/tests/dom/ensureInlineNodesInParagraph13-input.html
new file mode 100644
index 0000000..a6f6e14
--- /dev/null
+++ b/Editor/tests/dom/ensureInlineNodesInParagraph13-input.html
@@ -0,0 +1,26 @@
+<!DOCTYPE html>
+<html>
+<head>
+<script>
+function performTest()
+{
+    var text1 = DOM_createTextNode(document,"One");
+    var text2 = DOM_createTextNode(document,"Two");
+    var text3 = DOM_createTextNode(document,"Three");
+    DOM_deleteAllChildren(document.body);
+    DOM_appendChild(document.body,text1);
+    DOM_appendChild(document.body,text2);
+    DOM_appendChild(document.body,text3);
+
+    var range = new Range(document.body,0,document.body,3);
+
+    Range_trackWhileExecuting(range,function() {
+        Hierarchy_ensureInlineNodesInParagraph(text1);
+    });
+    showRangeAsBrackets(range);
+}
+</script>
+</head>
+<body>
+</body>
+</html>

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

http://git-wip-us.apache.org/repos/asf/incubator-corinthia/blob/03bd5af0/Editor/tests/dom/ensureInlineNodesInParagraph14-input.html
----------------------------------------------------------------------
diff --git a/Editor/tests/dom/ensureInlineNodesInParagraph14-input.html b/Editor/tests/dom/ensureInlineNodesInParagraph14-input.html
new file mode 100644
index 0000000..ff558d2
--- /dev/null
+++ b/Editor/tests/dom/ensureInlineNodesInParagraph14-input.html
@@ -0,0 +1,26 @@
+<!DOCTYPE html>
+<html>
+<head>
+<script>
+function performTest()
+{
+    var text1 = DOM_createTextNode(document,"One");
+    var text2 = DOM_createTextNode(document,"Two");
+    var text3 = DOM_createTextNode(document,"Three");
+    DOM_deleteAllChildren(document.body);
+    DOM_appendChild(document.body,text1);
+    DOM_appendChild(document.body,text2);
+    DOM_appendChild(document.body,text3);
+
+    var range = new Range(document.body,0,document.body,3);
+
+    Range_trackWhileExecuting(range,function() {
+        Hierarchy_ensureInlineNodesInParagraph(text2);
+    });
+    showRangeAsBrackets(range);
+}
+</script>
+</head>
+<body>
+</body>
+</html>

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

http://git-wip-us.apache.org/repos/asf/incubator-corinthia/blob/03bd5af0/Editor/tests/dom/ensureInlineNodesInParagraph15-input.html
----------------------------------------------------------------------
diff --git a/Editor/tests/dom/ensureInlineNodesInParagraph15-input.html b/Editor/tests/dom/ensureInlineNodesInParagraph15-input.html
new file mode 100644
index 0000000..bf78a9c
--- /dev/null
+++ b/Editor/tests/dom/ensureInlineNodesInParagraph15-input.html
@@ -0,0 +1,26 @@
+<!DOCTYPE html>
+<html>
+<head>
+<script>
+function performTest()
+{
+    var text1 = DOM_createTextNode(document,"One");
+    var text2 = DOM_createTextNode(document,"Two");
+    var text3 = DOM_createTextNode(document,"Three");
+    DOM_deleteAllChildren(document.body);
+    DOM_appendChild(document.body,text1);
+    DOM_appendChild(document.body,text2);
+    DOM_appendChild(document.body,text3);
+
+    var range = new Range(document.body,0,document.body,3);
+
+    Range_trackWhileExecuting(range,function() {
+        Hierarchy_ensureInlineNodesInParagraph(text3);
+    });
+    showRangeAsBrackets(range);
+}
+</script>
+</head>
+<body>
+</body>
+</html>

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

http://git-wip-us.apache.org/repos/asf/incubator-corinthia/blob/03bd5af0/Editor/tests/dom/ensureInlineNodesInParagraph16-input.html
----------------------------------------------------------------------
diff --git a/Editor/tests/dom/ensureInlineNodesInParagraph16-input.html b/Editor/tests/dom/ensureInlineNodesInParagraph16-input.html
new file mode 100644
index 0000000..96d7002
--- /dev/null
+++ b/Editor/tests/dom/ensureInlineNodesInParagraph16-input.html
@@ -0,0 +1,26 @@
+<!DOCTYPE html>
+<html>
+<head>
+<script>
+function performTest()
+{
+    var text1 = DOM_createTextNode(document,"One");
+    var text2 = DOM_createTextNode(document,"Two");
+    var text3 = DOM_createTextNode(document,"Three");
+    DOM_deleteAllChildren(document.body);
+    DOM_appendChild(document.body,text1);
+    DOM_appendChild(document.body,text2);
+    DOM_appendChild(document.body,text3);
+
+    var range = new Range(document.body,0,document.body,3);
+
+    Range_trackWhileExecuting(range,function() {
+        Range_ensureInlineNodesInParagraph(range);
+    });
+    showRangeAsBrackets(range);
+}
+</script>
+</head>
+<body>
+</body>
+</html>

http://git-wip-us.apache.org/repos/asf/incubator-corinthia/blob/03bd5af0/Editor/tests/dom/ensureValidHierarchy01-expected.html
----------------------------------------------------------------------
diff --git a/Editor/tests/dom/ensureValidHierarchy01-expected.html b/Editor/tests/dom/ensureValidHierarchy01-expected.html
new file mode 100644
index 0000000..9a38b37
--- /dev/null
+++ b/Editor/tests/dom/ensureValidHierarchy01-expected.html
@@ -0,0 +1,4 @@
+<html>
+  <head></head>
+  <body><p><b>Sample text</b></p></body>
+</html>

http://git-wip-us.apache.org/repos/asf/incubator-corinthia/blob/03bd5af0/Editor/tests/dom/ensureValidHierarchy01-input.html
----------------------------------------------------------------------
diff --git a/Editor/tests/dom/ensureValidHierarchy01-input.html b/Editor/tests/dom/ensureValidHierarchy01-input.html
new file mode 100644
index 0000000..67ad9bd
--- /dev/null
+++ b/Editor/tests/dom/ensureValidHierarchy01-input.html
@@ -0,0 +1,17 @@
+<!DOCTYPE html>
+<html>
+<head>
+<script>
+function performTest()
+{
+    var p = document.getElementsByTagName("P")[0];
+    Hierarchy_ensureValidHierarchy(p.firstChild,true);
+}
+</script>
+</head>
+<body>
+
+<b><p>Sample text</p></b>
+
+</body>
+</html>

http://git-wip-us.apache.org/repos/asf/incubator-corinthia/blob/03bd5af0/Editor/tests/dom/ensureValidHierarchy02-expected.html
----------------------------------------------------------------------
diff --git a/Editor/tests/dom/ensureValidHierarchy02-expected.html b/Editor/tests/dom/ensureValidHierarchy02-expected.html
new file mode 100644
index 0000000..9a38b37
--- /dev/null
+++ b/Editor/tests/dom/ensureValidHierarchy02-expected.html
@@ -0,0 +1,4 @@
+<html>
+  <head></head>
+  <body><p><b>Sample text</b></p></body>
+</html>

http://git-wip-us.apache.org/repos/asf/incubator-corinthia/blob/03bd5af0/Editor/tests/dom/ensureValidHierarchy02-input.html
----------------------------------------------------------------------
diff --git a/Editor/tests/dom/ensureValidHierarchy02-input.html b/Editor/tests/dom/ensureValidHierarchy02-input.html
new file mode 100644
index 0000000..5e8c370
--- /dev/null
+++ b/Editor/tests/dom/ensureValidHierarchy02-input.html
@@ -0,0 +1,17 @@
+<!DOCTYPE html>
+<html>
+<head>
+<script>
+function performTest()
+{
+    var p = document.getElementsByTagName("P")[0];
+    Hierarchy_ensureValidHierarchy(p,true);
+}
+</script>
+</head>
+<body>
+
+<b><p>Sample text</p></b>
+
+</body>
+</html>

http://git-wip-us.apache.org/repos/asf/incubator-corinthia/blob/03bd5af0/Editor/tests/dom/ensureValidHierarchy03-expected.html
----------------------------------------------------------------------
diff --git a/Editor/tests/dom/ensureValidHierarchy03-expected.html b/Editor/tests/dom/ensureValidHierarchy03-expected.html
new file mode 100644
index 0000000..99f2e5b
--- /dev/null
+++ b/Editor/tests/dom/ensureValidHierarchy03-expected.html
@@ -0,0 +1,7 @@
+<html>
+  <head></head>
+  <body>
+    <p><b>Sample text</b></p>
+    <b><p>More text</p></b>
+  </body>
+</html>

http://git-wip-us.apache.org/repos/asf/incubator-corinthia/blob/03bd5af0/Editor/tests/dom/ensureValidHierarchy03-input.html
----------------------------------------------------------------------
diff --git a/Editor/tests/dom/ensureValidHierarchy03-input.html b/Editor/tests/dom/ensureValidHierarchy03-input.html
new file mode 100644
index 0000000..df900a8
--- /dev/null
+++ b/Editor/tests/dom/ensureValidHierarchy03-input.html
@@ -0,0 +1,17 @@
+<!DOCTYPE html>
+<html>
+<head>
+<script>
+function performTest()
+{
+    var p = document.getElementsByTagName("P")[0];
+    Hierarchy_ensureValidHierarchy(p.firstChild,true);
+}
+</script>
+</head>
+<body>
+
+<b><p>Sample text</p><p>More text</p></b>
+
+</body>
+</html>

http://git-wip-us.apache.org/repos/asf/incubator-corinthia/blob/03bd5af0/Editor/tests/dom/ensureValidHierarchy04-expected.html
----------------------------------------------------------------------
diff --git a/Editor/tests/dom/ensureValidHierarchy04-expected.html b/Editor/tests/dom/ensureValidHierarchy04-expected.html
new file mode 100644
index 0000000..fa0fef6
--- /dev/null
+++ b/Editor/tests/dom/ensureValidHierarchy04-expected.html
@@ -0,0 +1,7 @@
+<html>
+  <head></head>
+  <body>
+    <b><p>Sample text</p></b>
+    <p><b>More text</b></p>
+  </body>
+</html>

http://git-wip-us.apache.org/repos/asf/incubator-corinthia/blob/03bd5af0/Editor/tests/dom/ensureValidHierarchy04-input.html
----------------------------------------------------------------------
diff --git a/Editor/tests/dom/ensureValidHierarchy04-input.html b/Editor/tests/dom/ensureValidHierarchy04-input.html
new file mode 100644
index 0000000..d5c6c87
--- /dev/null
+++ b/Editor/tests/dom/ensureValidHierarchy04-input.html
@@ -0,0 +1,17 @@
+<!DOCTYPE html>
+<html>
+<head>
+<script>
+function performTest()
+{
+    var p = document.getElementsByTagName("P")[1];
+    Hierarchy_ensureValidHierarchy(p.firstChild,true);
+}
+</script>
+</head>
+<body>
+
+<b><p>Sample text</p><p>More text</p></b>
+
+</body>
+</html>

http://git-wip-us.apache.org/repos/asf/incubator-corinthia/blob/03bd5af0/Editor/tests/dom/ensureValidHierarchy05-expected.html
----------------------------------------------------------------------
diff --git a/Editor/tests/dom/ensureValidHierarchy05-expected.html b/Editor/tests/dom/ensureValidHierarchy05-expected.html
new file mode 100644
index 0000000..5bd6582
--- /dev/null
+++ b/Editor/tests/dom/ensureValidHierarchy05-expected.html
@@ -0,0 +1,7 @@
+<html>
+  <head></head>
+  <body>
+    <p><b>Sample text</b></p>
+    <p><b>More text</b></p>
+  </body>
+</html>

http://git-wip-us.apache.org/repos/asf/incubator-corinthia/blob/03bd5af0/Editor/tests/dom/ensureValidHierarchy05-input.html
----------------------------------------------------------------------
diff --git a/Editor/tests/dom/ensureValidHierarchy05-input.html b/Editor/tests/dom/ensureValidHierarchy05-input.html
new file mode 100644
index 0000000..a00f331
--- /dev/null
+++ b/Editor/tests/dom/ensureValidHierarchy05-input.html
@@ -0,0 +1,19 @@
+<!DOCTYPE html>
+<html>
+<head>
+<script>
+function performTest()
+{
+    var p0 = document.getElementsByTagName("P")[0];
+    var p1 = document.getElementsByTagName("P")[1];
+    Hierarchy_ensureValidHierarchy(p0.firstChild,true);
+    Hierarchy_ensureValidHierarchy(p1.firstChild,true);
+}
+</script>
+</head>
+<body>
+
+<b><p>Sample text</p><p>More text</p></b>
+
+</body>
+</html>

http://git-wip-us.apache.org/repos/asf/incubator-corinthia/blob/03bd5af0/Editor/tests/dom/ensureValidHierarchy06-expected.html
----------------------------------------------------------------------
diff --git a/Editor/tests/dom/ensureValidHierarchy06-expected.html b/Editor/tests/dom/ensureValidHierarchy06-expected.html
new file mode 100644
index 0000000..d26dd5b
--- /dev/null
+++ b/Editor/tests/dom/ensureValidHierarchy06-expected.html
@@ -0,0 +1,4 @@
+<html>
+  <head></head>
+  <body><p><b><i><u>Sample text</u></i></b></p></body>
+</html>

http://git-wip-us.apache.org/repos/asf/incubator-corinthia/blob/03bd5af0/Editor/tests/dom/ensureValidHierarchy06-input.html
----------------------------------------------------------------------
diff --git a/Editor/tests/dom/ensureValidHierarchy06-input.html b/Editor/tests/dom/ensureValidHierarchy06-input.html
new file mode 100644
index 0000000..4cc8bef
--- /dev/null
+++ b/Editor/tests/dom/ensureValidHierarchy06-input.html
@@ -0,0 +1,17 @@
+<!DOCTYPE html>
+<html>
+<head>
+<script>
+function performTest()
+{
+    var p0 = document.getElementsByTagName("P")[0];
+    Hierarchy_ensureValidHierarchy(p0.firstChild,true);
+}
+</script>
+</head>
+<body>
+
+<b><i><u><p>Sample text</p></u></i></b>
+
+</body>
+</html>

http://git-wip-us.apache.org/repos/asf/incubator-corinthia/blob/03bd5af0/Editor/tests/dom/ensureValidHierarchy07-expected.html
----------------------------------------------------------------------
diff --git a/Editor/tests/dom/ensureValidHierarchy07-expected.html b/Editor/tests/dom/ensureValidHierarchy07-expected.html
new file mode 100644
index 0000000..c9589ff
--- /dev/null
+++ b/Editor/tests/dom/ensureValidHierarchy07-expected.html
@@ -0,0 +1,16 @@
+<html>
+  <head></head>
+  <body>
+    <ul><li><b><i><u>Item 1</u></i></b></li></ul>
+    <b>
+      <i>
+        <u>
+          <ol><li>Item 2</li></ol>
+          <p>Sample text</p>
+          <ul><li>Item 3</li></ul>
+          <ol><li>Item 4</li></ol>
+        </u>
+      </i>
+    </b>
+  </body>
+</html>

http://git-wip-us.apache.org/repos/asf/incubator-corinthia/blob/03bd5af0/Editor/tests/dom/ensureValidHierarchy07-input.html
----------------------------------------------------------------------
diff --git a/Editor/tests/dom/ensureValidHierarchy07-input.html b/Editor/tests/dom/ensureValidHierarchy07-input.html
new file mode 100644
index 0000000..e267d0f
--- /dev/null
+++ b/Editor/tests/dom/ensureValidHierarchy07-input.html
@@ -0,0 +1,17 @@
+<!DOCTYPE html>
+<html>
+<head>
+<script>
+function performTest()
+{
+    var li = document.getElementsByTagName("LI")[0];
+    Hierarchy_ensureValidHierarchy(li,true);
+}
+</script>
+</head>
+<body>
+
+<b><i><u><ul><li>Item 1</li></ul><ol><li>Item 2</li></ol><p>Sample text</p><ul><li>Item 3</li></ul><ol><li>Item 4</li></ol></u></i></b>
+
+</body>
+</html>

http://git-wip-us.apache.org/repos/asf/incubator-corinthia/blob/03bd5af0/Editor/tests/dom/ensureValidHierarchy08-expected.html
----------------------------------------------------------------------
diff --git a/Editor/tests/dom/ensureValidHierarchy08-expected.html b/Editor/tests/dom/ensureValidHierarchy08-expected.html
new file mode 100644
index 0000000..d10f177
--- /dev/null
+++ b/Editor/tests/dom/ensureValidHierarchy08-expected.html
@@ -0,0 +1,16 @@
+<html>
+  <head></head>
+  <body>
+    <b><i><u><ul><li>Item 1</li></ul></u></i></b>
+    <ol><li><b><i><u>Item 2</u></i></b></li></ol>
+    <b>
+      <i>
+        <u>
+          <p>Sample text</p>
+          <ul><li>Item 3</li></ul>
+          <ol><li>Item 4</li></ol>
+        </u>
+      </i>
+    </b>
+  </body>
+</html>

http://git-wip-us.apache.org/repos/asf/incubator-corinthia/blob/03bd5af0/Editor/tests/dom/ensureValidHierarchy08-input.html
----------------------------------------------------------------------
diff --git a/Editor/tests/dom/ensureValidHierarchy08-input.html b/Editor/tests/dom/ensureValidHierarchy08-input.html
new file mode 100644
index 0000000..a2c517b
--- /dev/null
+++ b/Editor/tests/dom/ensureValidHierarchy08-input.html
@@ -0,0 +1,17 @@
+<!DOCTYPE html>
+<html>
+<head>
+<script>
+function performTest()
+{
+    var li = document.getElementsByTagName("LI")[1];
+    Hierarchy_ensureValidHierarchy(li,true);
+}
+</script>
+</head>
+<body>
+
+<b><i><u><ul><li>Item 1</li></ul><ol><li>Item 2</li></ol><p>Sample text</p><ul><li>Item 3</li></ul><ol><li>Item 4</li></ol></u></i></b>
+
+</body>
+</html>

http://git-wip-us.apache.org/repos/asf/incubator-corinthia/blob/03bd5af0/Editor/tests/dom/ensureValidHierarchy09-expected.html
----------------------------------------------------------------------
diff --git a/Editor/tests/dom/ensureValidHierarchy09-expected.html b/Editor/tests/dom/ensureValidHierarchy09-expected.html
new file mode 100644
index 0000000..8d208ca
--- /dev/null
+++ b/Editor/tests/dom/ensureValidHierarchy09-expected.html
@@ -0,0 +1,22 @@
+<html>
+  <head></head>
+  <body>
+    <b>
+      <i>
+        <u>
+          <ul><li>Item 1</li></ul>
+          <ol><li>Item 2</li></ol>
+        </u>
+      </i>
+    </b>
+    <p><b><i><u>Sample text</u></i></b></p>
+    <b>
+      <i>
+        <u>
+          <ul><li>Item 3</li></ul>
+          <ol><li>Item 4</li></ol>
+        </u>
+      </i>
+    </b>
+  </body>
+</html>

http://git-wip-us.apache.org/repos/asf/incubator-corinthia/blob/03bd5af0/Editor/tests/dom/ensureValidHierarchy09-input.html
----------------------------------------------------------------------
diff --git a/Editor/tests/dom/ensureValidHierarchy09-input.html b/Editor/tests/dom/ensureValidHierarchy09-input.html
new file mode 100644
index 0000000..507bc73
--- /dev/null
+++ b/Editor/tests/dom/ensureValidHierarchy09-input.html
@@ -0,0 +1,17 @@
+<!DOCTYPE html>
+<html>
+<head>
+<script>
+function performTest()
+{
+    var p = document.getElementsByTagName("P")[0];
+    Hierarchy_ensureValidHierarchy(p,true);
+}
+</script>
+</head>
+<body>
+
+<b><i><u><ul><li>Item 1</li></ul><ol><li>Item 2</li></ol><p>Sample text</p><ul><li>Item 3</li></ul><ol><li>Item 4</li></ol></u></i></b>
+
+</body>
+</html>

http://git-wip-us.apache.org/repos/asf/incubator-corinthia/blob/03bd5af0/Editor/tests/dom/ensureValidHierarchy10-expected.html
----------------------------------------------------------------------
diff --git a/Editor/tests/dom/ensureValidHierarchy10-expected.html b/Editor/tests/dom/ensureValidHierarchy10-expected.html
new file mode 100644
index 0000000..3abc400
--- /dev/null
+++ b/Editor/tests/dom/ensureValidHierarchy10-expected.html
@@ -0,0 +1,16 @@
+<html>
+  <head></head>
+  <body>
+    <b>
+      <i>
+        <u>
+          <ul><li>Item 1</li></ul>
+          <ol><li>Item 2</li></ol>
+          <p>Sample text</p>
+        </u>
+      </i>
+    </b>
+    <ul><li><b><i><u>Item 3</u></i></b></li></ul>
+    <b><i><u><ol><li>Item 4</li></ol></u></i></b>
+  </body>
+</html>

http://git-wip-us.apache.org/repos/asf/incubator-corinthia/blob/03bd5af0/Editor/tests/dom/ensureValidHierarchy10-input.html
----------------------------------------------------------------------
diff --git a/Editor/tests/dom/ensureValidHierarchy10-input.html b/Editor/tests/dom/ensureValidHierarchy10-input.html
new file mode 100644
index 0000000..36cfc00
--- /dev/null
+++ b/Editor/tests/dom/ensureValidHierarchy10-input.html
@@ -0,0 +1,17 @@
+<!DOCTYPE html>
+<html>
+<head>
+<script>
+function performTest()
+{
+    var li = document.getElementsByTagName("LI")[2];
+    Hierarchy_ensureValidHierarchy(li,true);
+}
+</script>
+</head>
+<body>
+
+<b><i><u><ul><li>Item 1</li></ul><ol><li>Item 2</li></ol><p>Sample text</p><ul><li>Item 3</li></ul><ol><li>Item 4</li></ol></u></i></b>
+
+</body>
+</html>

http://git-wip-us.apache.org/repos/asf/incubator-corinthia/blob/03bd5af0/Editor/tests/dom/ensureValidHierarchy11-expected.html
----------------------------------------------------------------------
diff --git a/Editor/tests/dom/ensureValidHierarchy11-expected.html b/Editor/tests/dom/ensureValidHierarchy11-expected.html
new file mode 100644
index 0000000..79abfad
--- /dev/null
+++ b/Editor/tests/dom/ensureValidHierarchy11-expected.html
@@ -0,0 +1,16 @@
+<html>
+  <head></head>
+  <body>
+    <b>
+      <i>
+        <u>
+          <ul><li>Item 1</li></ul>
+          <ol><li>Item 2</li></ol>
+          <p>Sample text</p>
+          <ul><li>Item 3</li></ul>
+        </u>
+      </i>
+    </b>
+    <ol><li><b><i><u>Item 4</u></i></b></li></ol>
+  </body>
+</html>

http://git-wip-us.apache.org/repos/asf/incubator-corinthia/blob/03bd5af0/Editor/tests/dom/ensureValidHierarchy11-input.html
----------------------------------------------------------------------
diff --git a/Editor/tests/dom/ensureValidHierarchy11-input.html b/Editor/tests/dom/ensureValidHierarchy11-input.html
new file mode 100644
index 0000000..ac5d35b
--- /dev/null
+++ b/Editor/tests/dom/ensureValidHierarchy11-input.html
@@ -0,0 +1,17 @@
+<!DOCTYPE html>
+<html>
+<head>
+<script>
+function performTest()
+{
+    var li = document.getElementsByTagName("LI")[3];
+    Hierarchy_ensureValidHierarchy(li,true);
+}
+</script>
+</head>
+<body>
+
+<b><i><u><ul><li>Item 1</li></ul><ol><li>Item 2</li></ol><p>Sample text</p><ul><li>Item 3</li></ul><ol><li>Item 4</li></ol></u></i></b>
+
+</body>
+</html>

http://git-wip-us.apache.org/repos/asf/incubator-corinthia/blob/03bd5af0/Editor/tests/dom/ensureValidHierarchy12-expected.html
----------------------------------------------------------------------
diff --git a/Editor/tests/dom/ensureValidHierarchy12-expected.html b/Editor/tests/dom/ensureValidHierarchy12-expected.html
new file mode 100644
index 0000000..7c84d61
--- /dev/null
+++ b/Editor/tests/dom/ensureValidHierarchy12-expected.html
@@ -0,0 +1,55 @@
+<html>
+  <head></head>
+  <body>
+    <b><i>Beginning</i></b>
+    <ul>
+      <li id="1">
+        <b>
+          <i>
+            One
+            <br/>
+            Two
+            <br/>
+          </i>
+        </b>
+        <p><b><i>Hello</i></b></p>
+        <b>
+          <i>
+            Three
+            <br/>
+            Four
+            <br/>
+          </i>
+        </b>
+        <ul>
+          <li><b><i>List item 1</i></b></li>
+          <li><b><i>List item 2</i></b></li>
+        </ul>
+        <b>
+          <i>
+            Five
+            <br/>
+          </i>
+        </b>
+      </li>
+      <li id="2"><b><i>Two</i></b></li>
+      <li id="3"><p><b><i>Three</i></b></p></li>
+    </ul>
+    <b>
+      <i>
+        Middle
+        <ol>
+          <li>Four</li>
+          <li>Five</li>
+          <li>Six</li>
+        </ol>
+        End
+      </i>
+    </b>
+    <br/>
+    One
+    <br/>
+    Two
+    <br/>
+  </body>
+</html>

http://git-wip-us.apache.org/repos/asf/incubator-corinthia/blob/03bd5af0/Editor/tests/dom/ensureValidHierarchy12-input.html
----------------------------------------------------------------------
diff --git a/Editor/tests/dom/ensureValidHierarchy12-input.html b/Editor/tests/dom/ensureValidHierarchy12-input.html
new file mode 100644
index 0000000..4cccd2b
--- /dev/null
+++ b/Editor/tests/dom/ensureValidHierarchy12-input.html
@@ -0,0 +1,50 @@
+<!DOCTYPE html>
+<html>
+<head>
+<script>
+function performTest()
+{
+    var ul = document.getElementsByTagName("UL")[0];
+    Hierarchy_ensureValidHierarchy(ul,true);
+}
+</script>
+</head>
+<body>
+
+<b>
+  <i>
+    Beginning
+    <ul>
+      <li id="1">
+      One<br>
+      Two<br>
+      <p>Hello</p>
+      Three<br>
+      Four<br>
+      <ul>
+        <li>List item 1</li>
+        <li>List item 2</li>
+      </ul>
+      Five<br>
+    </li>
+    <li id="2">Two</li>
+    <li id="3"><p>Three</p></li>
+    </ul>
+    Middle
+    <ol>
+      <li>Four</li>
+      <li>Five</li>
+      <li>Six</li>
+    </ol>
+    End
+  </i>
+</b>
+
+<br>
+One
+<br>
+Two
+<br>
+
+</body>
+</html>

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

http://git-wip-us.apache.org/repos/asf/incubator-corinthia/blob/03bd5af0/Editor/tests/dom/mergeWithNeighbours01-input.html
----------------------------------------------------------------------
diff --git a/Editor/tests/dom/mergeWithNeighbours01-input.html b/Editor/tests/dom/mergeWithNeighbours01-input.html
new file mode 100644
index 0000000..8e86189
--- /dev/null
+++ b/Editor/tests/dom/mergeWithNeighbours01-input.html
@@ -0,0 +1,31 @@
+<!DOCTYPE html>
+<html>
+<head>
+<script>
+function performTest()
+{
+    var p = DOM_createElement(document,"P");
+    var text1 = DOM_createTextNode(document,"One");
+    var text2 = DOM_createTextNode(document,"Two");
+    var text3 = DOM_createTextNode(document,"Three");
+    var text4 = DOM_createTextNode(document,"Four");
+    var text5 = DOM_createTextNode(document,"Five");
+    DOM_appendChild(p,text1);
+    DOM_appendChild(p,text2);
+    DOM_appendChild(p,text3);
+    DOM_appendChild(p,text4);
+    DOM_appendChild(p,text5);
+    DOM_appendChild(document.body,p);
+
+    var range = new Range(text2,1,text4,3);
+    Range_trackWhileExecuting(range,function() {
+        Formatting_mergeWithNeighbours(text3,Formatting_MERGEABLE_INLINE);
+    });
+    showRangeAsBrackets(range);
+}
+</script>
+</head>
+<body>
+
+</body>
+</html>

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

http://git-wip-us.apache.org/repos/asf/incubator-corinthia/blob/03bd5af0/Editor/tests/dom/mergeWithNeighbours02-input.html
----------------------------------------------------------------------
diff --git a/Editor/tests/dom/mergeWithNeighbours02-input.html b/Editor/tests/dom/mergeWithNeighbours02-input.html
new file mode 100644
index 0000000..c203565
--- /dev/null
+++ b/Editor/tests/dom/mergeWithNeighbours02-input.html
@@ -0,0 +1,31 @@
+<!DOCTYPE html>
+<html>
+<head>
+<script>
+function performTest()
+{
+    var p = DOM_createElement(document,"P");
+    var text1 = DOM_createTextNode(document,"One");
+    var text2 = DOM_createTextNode(document,"Two");
+    var text3 = DOM_createTextNode(document,"Three");
+    var text4 = DOM_createTextNode(document,"Four");
+    var text5 = DOM_createTextNode(document,"Five");
+    DOM_appendChild(p,text1);
+    DOM_appendChild(p,text2);
+    DOM_appendChild(p,text3);
+    DOM_appendChild(p,text4);
+    DOM_appendChild(p,text5);
+    DOM_appendChild(document.body,p);
+
+    var range = new Range(text1,1,text5,3);
+    Range_trackWhileExecuting(range,function() {
+        Formatting_mergeWithNeighbours(text3,Formatting_MERGEABLE_INLINE);
+    });
+    showRangeAsBrackets(range);
+}
+</script>
+</head>
+<body>
+
+</body>
+</html>

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

http://git-wip-us.apache.org/repos/asf/incubator-corinthia/blob/03bd5af0/Editor/tests/dom/mergeWithNeighbours03-input.html
----------------------------------------------------------------------
diff --git a/Editor/tests/dom/mergeWithNeighbours03-input.html b/Editor/tests/dom/mergeWithNeighbours03-input.html
new file mode 100644
index 0000000..509f8ec
--- /dev/null
+++ b/Editor/tests/dom/mergeWithNeighbours03-input.html
@@ -0,0 +1,31 @@
+<!DOCTYPE html>
+<html>
+<head>
+<script>
+function performTest()
+{
+    var p = DOM_createElement(document,"P");
+    var text1 = DOM_createTextNode(document,"One");
+    var text2 = DOM_createTextNode(document,"Two");
+    var text3 = DOM_createTextNode(document,"Three");
+    var text4 = DOM_createTextNode(document,"Four");
+    var text5 = DOM_createTextNode(document,"Five");
+    DOM_appendChild(p,text1);
+    DOM_appendChild(p,text2);
+    DOM_appendChild(p,text3);
+    DOM_appendChild(p,text4);
+    DOM_appendChild(p,text5);
+    DOM_appendChild(document.body,p);
+
+    var range = new Range(text1,3,text5,4);
+    Range_trackWhileExecuting(range,function() {
+        Formatting_mergeWithNeighbours(text3,Formatting_MERGEABLE_INLINE);
+    });
+    showRangeAsBrackets(range);
+}
+</script>
+</head>
+<body>
+
+</body>
+</html>

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

http://git-wip-us.apache.org/repos/asf/incubator-corinthia/blob/03bd5af0/Editor/tests/dom/mergeWithNeighbours04-input.html
----------------------------------------------------------------------
diff --git a/Editor/tests/dom/mergeWithNeighbours04-input.html b/Editor/tests/dom/mergeWithNeighbours04-input.html
new file mode 100644
index 0000000..669e692
--- /dev/null
+++ b/Editor/tests/dom/mergeWithNeighbours04-input.html
@@ -0,0 +1,31 @@
+<!DOCTYPE html>
+<html>
+<head>
+<script>
+function performTest()
+{
+    var p = DOM_createElement(document,"P");
+    var text1 = DOM_createTextNode(document,"One");
+    var text2 = DOM_createTextNode(document,"One");
+    var text3 = DOM_createTextNode(document,"One");
+    var text4 = DOM_createTextNode(document,"One");
+    var text5 = DOM_createTextNode(document,"One");
+    DOM_appendChild(p,text1);
+    DOM_appendChild(p,text2);
+    DOM_appendChild(p,text3);
+    DOM_appendChild(p,text4);
+    DOM_appendChild(p,text5);
+    DOM_appendChild(document.body,p);
+
+    var range = new Range(text1,3,text5,4);
+    Range_trackWhileExecuting(range,function() {
+        Formatting_mergeWithNeighbours(text3,Formatting_MERGEABLE_INLINE);
+    });
+    showRangeAsBrackets(range);
+}
+</script>
+</head>
+<body>
+
+</body>
+</html>

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

http://git-wip-us.apache.org/repos/asf/incubator-corinthia/blob/03bd5af0/Editor/tests/dom/mergeWithNeighbours05-input.html
----------------------------------------------------------------------
diff --git a/Editor/tests/dom/mergeWithNeighbours05-input.html b/Editor/tests/dom/mergeWithNeighbours05-input.html
new file mode 100644
index 0000000..38ac111
--- /dev/null
+++ b/Editor/tests/dom/mergeWithNeighbours05-input.html
@@ -0,0 +1,25 @@
+<!DOCTYPE html>
+<html>
+<head>
+<script>
+function performTest()
+{
+    var bs = document.getElementsByTagName("B");
+    var is = document.getElementsByTagName("I");
+
+    var range = new Range(bs[1],DOM_nodeOffset(is[4]),
+                          bs[2],DOM_nodeOffset(is[8]));
+
+    Range_trackWhileExecuting(range,function() {
+        Formatting_mergeWithNeighbours(bs[1],Formatting_MERGEABLE_INLINE);
+    });
+    showRangeAsBrackets(range);
+}
+</script>
+</head>
+<body>
+
+<p><b><i>One</i><i>Two</i><i>Three</i></b><b><i>Four</i><i>Five</i><i>Six</i></b><b><i>Seven</i><i>Eight</i><i>Nine</i></b></p>
+
+</body>
+</html>

http://git-wip-us.apache.org/repos/asf/incubator-corinthia/blob/03bd5af0/Editor/tests/dom/mergeWithNeighbours06-expected.html
----------------------------------------------------------------------
diff --git a/Editor/tests/dom/mergeWithNeighbours06-expected.html b/Editor/tests/dom/mergeWithNeighbours06-expected.html
new file mode 100644
index 0000000..2cf0aa5
--- /dev/null
+++ b/Editor/tests/dom/mergeWithNeighbours06-expected.html
@@ -0,0 +1,11 @@
+<html>
+  <head></head>
+  <body>
+    <p>
+      <b>
+        <i>One[TwoThreeFourFiveSixSevenEightNine</i>
+        ]
+      </b>
+    </p>
+  </body>
+</html>

http://git-wip-us.apache.org/repos/asf/incubator-corinthia/blob/03bd5af0/Editor/tests/dom/mergeWithNeighbours06-input.html
----------------------------------------------------------------------
diff --git a/Editor/tests/dom/mergeWithNeighbours06-input.html b/Editor/tests/dom/mergeWithNeighbours06-input.html
new file mode 100644
index 0000000..0224e91
--- /dev/null
+++ b/Editor/tests/dom/mergeWithNeighbours06-input.html
@@ -0,0 +1,25 @@
+<!DOCTYPE html>
+<html>
+<head>
+<script>
+function performTest()
+{
+    var bs = document.getElementsByTagName("B");
+    var is = document.getElementsByTagName("I");
+
+    var range = new Range(bs[0],1,
+                          bs[2],bs[2].childNodes.length);
+
+    Range_trackWhileExecuting(range,function() {
+        Formatting_mergeWithNeighbours(bs[1],Formatting_MERGEABLE_INLINE);
+    });
+    showRangeAsBrackets(range);
+}
+</script>
+</head>
+<body>
+
+<p><b><i>One</i><i>Two</i><i>Three</i></b><b><i>Four</i><i>Five</i><i>Six</i></b><b><i>Seven</i><i>Eight</i><i>Nine</i></b></p>
+
+</body>
+</html>

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

http://git-wip-us.apache.org/repos/asf/incubator-corinthia/blob/03bd5af0/Editor/tests/dom/mergeWithNeighbours07-input.html
----------------------------------------------------------------------
diff --git a/Editor/tests/dom/mergeWithNeighbours07-input.html b/Editor/tests/dom/mergeWithNeighbours07-input.html
new file mode 100644
index 0000000..8ebf653
--- /dev/null
+++ b/Editor/tests/dom/mergeWithNeighbours07-input.html
@@ -0,0 +1,31 @@
+<!DOCTYPE html>
+<html>
+<head>
+<script>
+function performTest()
+{
+    var p = DOM_createElement(document,"P");
+    var text1 = DOM_createTextNode(document,"One");
+    var text2 = DOM_createTextNode(document,"Two");
+    var text3 = DOM_createTextNode(document,"Three");
+    var text4 = DOM_createTextNode(document,"Four");
+    var text5 = DOM_createTextNode(document,"Five");
+    DOM_appendChild(p,text1);
+    DOM_appendChild(p,text2);
+    DOM_appendChild(p,text3);
+    DOM_appendChild(p,text4);
+    DOM_appendChild(p,text5);
+    DOM_appendChild(document.body,p);
+
+    var range = new Range(p,2,p,4);
+    Range_trackWhileExecuting(range,function() {
+        Formatting_mergeWithNeighbours(text3,Formatting_MERGEABLE_INLINE);
+    });
+    showRangeAsBrackets(range);
+}
+</script>
+</head>
+<body>
+
+</body>
+</html>

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

http://git-wip-us.apache.org/repos/asf/incubator-corinthia/blob/03bd5af0/Editor/tests/dom/mergeWithNeighbours08-input.html
----------------------------------------------------------------------
diff --git a/Editor/tests/dom/mergeWithNeighbours08-input.html b/Editor/tests/dom/mergeWithNeighbours08-input.html
new file mode 100644
index 0000000..5521088
--- /dev/null
+++ b/Editor/tests/dom/mergeWithNeighbours08-input.html
@@ -0,0 +1,39 @@
+<!DOCTYPE html>
+<html>
+<head>
+<script>
+function performTest()
+{
+    var p = DOM_createElement(document,"P");
+    var text1 = DOM_createTextNode(document,"One");
+    var text2 = DOM_createTextNode(document,"Two");
+    var text3 = DOM_createTextNode(document,"Three");
+    var text4 = DOM_createTextNode(document,"Four");
+    var text5 = DOM_createTextNode(document,"Five");
+    var br1 = DOM_createElement(document,"BR");
+    var br2 = DOM_createElement(document,"BR");
+    var br3 = DOM_createElement(document,"BR");
+    var br4 = DOM_createElement(document,"BR");
+    DOM_appendChild(p,br1);
+    DOM_appendChild(p,br2);
+    DOM_appendChild(p,text1);
+    DOM_appendChild(p,text2);
+    DOM_appendChild(p,text3);
+    DOM_appendChild(p,text4);
+    DOM_appendChild(p,text5);
+    DOM_appendChild(p,br3);
+    DOM_appendChild(p,br4);
+    DOM_appendChild(document.body,p);
+
+    var range = new Range(p,2,p,7);
+    Range_trackWhileExecuting(range,function() {
+        Formatting_mergeWithNeighbours(text3,Formatting_MERGEABLE_INLINE);
+    });
+    showRangeAsBrackets(range);
+}
+</script>
+</head>
+<body>
+
+</body>
+</html>

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

http://git-wip-us.apache.org/repos/asf/incubator-corinthia/blob/03bd5af0/Editor/tests/dom/mergeWithNeighbours09-input.html
----------------------------------------------------------------------
diff --git a/Editor/tests/dom/mergeWithNeighbours09-input.html b/Editor/tests/dom/mergeWithNeighbours09-input.html
new file mode 100644
index 0000000..858d654
--- /dev/null
+++ b/Editor/tests/dom/mergeWithNeighbours09-input.html
@@ -0,0 +1,39 @@
+<!DOCTYPE html>
+<html>
+<head>
+<script>
+function performTest()
+{
+    var p = DOM_createElement(document,"P");
+    var text1 = DOM_createTextNode(document,"One");
+    var text2 = DOM_createTextNode(document,"Two");
+    var text3 = DOM_createTextNode(document,"Three");
+    var text4 = DOM_createTextNode(document,"Four");
+    var text5 = DOM_createTextNode(document,"Five");
+    var br1 = DOM_createElement(document,"BR");
+    var br2 = DOM_createElement(document,"BR");
+    var br3 = DOM_createElement(document,"BR");
+    var br4 = DOM_createElement(document,"BR");
+    DOM_appendChild(p,br1);
+    DOM_appendChild(p,br2);
+    DOM_appendChild(p,text1);
+    DOM_appendChild(p,text2);
+    DOM_appendChild(p,text3);
+    DOM_appendChild(p,text4);
+    DOM_appendChild(p,text5);
+    DOM_appendChild(p,br3);
+    DOM_appendChild(p,br4);
+    DOM_appendChild(document.body,p);
+
+    var range = new Range(p,1,p,8);
+    Range_trackWhileExecuting(range,function() {
+        Formatting_mergeWithNeighbours(text3,Formatting_MERGEABLE_INLINE);
+    });
+    showRangeAsBrackets(range);
+}
+</script>
+</head>
+<body>
+
+</body>
+</html>

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

http://git-wip-us.apache.org/repos/asf/incubator-corinthia/blob/03bd5af0/Editor/tests/dom/mergeWithNeighbours10-input.html
----------------------------------------------------------------------
diff --git a/Editor/tests/dom/mergeWithNeighbours10-input.html b/Editor/tests/dom/mergeWithNeighbours10-input.html
new file mode 100644
index 0000000..5953ac7
--- /dev/null
+++ b/Editor/tests/dom/mergeWithNeighbours10-input.html
@@ -0,0 +1,39 @@
+<!DOCTYPE html>
+<html>
+<head>
+<script>
+function performTest()
+{
+    var p = DOM_createElement(document,"P");
+    var text1 = DOM_createTextNode(document,"One");
+    var text2 = DOM_createTextNode(document,"Two");
+    var text3 = DOM_createTextNode(document,"Three");
+    var text4 = DOM_createTextNode(document,"Four");
+    var text5 = DOM_createTextNode(document,"Five");
+    var br1 = DOM_createElement(document,"BR");
+    var br2 = DOM_createElement(document,"BR");
+    var br3 = DOM_createElement(document,"BR");
+    var br4 = DOM_createElement(document,"BR");
+    DOM_appendChild(p,br1);
+    DOM_appendChild(p,br2);
+    DOM_appendChild(p,text1);
+    DOM_appendChild(p,text2);
+    DOM_appendChild(p,text3);
+    DOM_appendChild(p,text4);
+    DOM_appendChild(p,text5);
+    DOM_appendChild(p,br3);
+    DOM_appendChild(p,br4);
+    DOM_appendChild(document.body,p);
+
+    var range = new Range(p,0,p,9);
+    Range_trackWhileExecuting(range,function() {
+        Formatting_mergeWithNeighbours(text3,Formatting_MERGEABLE_INLINE);
+    });
+    showRangeAsBrackets(range);
+}
+</script>
+</head>
+<body>
+
+</body>
+</html>

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

http://git-wip-us.apache.org/repos/asf/incubator-corinthia/blob/03bd5af0/Editor/tests/dom/mergeWithNeighbours11-input.html
----------------------------------------------------------------------
diff --git a/Editor/tests/dom/mergeWithNeighbours11-input.html b/Editor/tests/dom/mergeWithNeighbours11-input.html
new file mode 100644
index 0000000..5c58d04
--- /dev/null
+++ b/Editor/tests/dom/mergeWithNeighbours11-input.html
@@ -0,0 +1,25 @@
+<!DOCTYPE html>
+<html>
+<head>
+<script>
+function performTest()
+{
+    var p = document.getElementsByTagName("P")[0];
+    var bs = document.getElementsByTagName("B");
+    var is = document.getElementsByTagName("I");
+
+    var range = new Range(p,1,p,2);
+
+    Range_trackWhileExecuting(range,function() {
+        Formatting_mergeWithNeighbours(bs[1],Formatting_MERGEABLE_INLINE);
+    });
+    showRangeAsBrackets(range);
+}
+</script>
+</head>
+<body>
+
+<p><b><i>One</i><i>Two</i><i>Three</i></b><b><i>Four</i><i>Five</i><i>Six</i></b><b><i>Seven</i><i>Eight</i><i>Nine</i></b></p>
+
+</body>
+</html>

http://git-wip-us.apache.org/repos/asf/incubator-corinthia/blob/03bd5af0/Editor/tests/dom/mergeWithNeighbours12-expected.html
----------------------------------------------------------------------
diff --git a/Editor/tests/dom/mergeWithNeighbours12-expected.html b/Editor/tests/dom/mergeWithNeighbours12-expected.html
new file mode 100644
index 0000000..7629b0f
--- /dev/null
+++ b/Editor/tests/dom/mergeWithNeighbours12-expected.html
@@ -0,0 +1,14 @@
+<html>
+  <head></head>
+  <body>
+    <p>
+      <br/>
+      <br/>
+      [
+      <b><i>OneTwoThreeFourFiveSixSevenEightNine</i></b>
+      ]
+      <br/>
+      <br/>
+    </p>
+  </body>
+</html>

http://git-wip-us.apache.org/repos/asf/incubator-corinthia/blob/03bd5af0/Editor/tests/dom/mergeWithNeighbours12-input.html
----------------------------------------------------------------------
diff --git a/Editor/tests/dom/mergeWithNeighbours12-input.html b/Editor/tests/dom/mergeWithNeighbours12-input.html
new file mode 100644
index 0000000..5cee75a
--- /dev/null
+++ b/Editor/tests/dom/mergeWithNeighbours12-input.html
@@ -0,0 +1,25 @@
+<!DOCTYPE html>
+<html>
+<head>
+<script>
+function performTest()
+{
+    var p = document.getElementsByTagName("P")[0];
+    var bs = document.getElementsByTagName("B");
+    var is = document.getElementsByTagName("I");
+
+    var range = new Range(p,2,p,5);
+
+    Range_trackWhileExecuting(range,function() {
+       Formatting_mergeWithNeighbours(bs[1],Formatting_MERGEABLE_INLINE);
+    });
+    showRangeAsBrackets(range);
+}
+</script>
+</head>
+<body>
+
+<p><br><br><b><i>One</i><i>Two</i><i>Three</i></b><b><i>Four</i><i>Five</i><i>Six</i></b><b><i>Seven</i><i>Eight</i><i>Nine</i></b><br><br></p>
+
+</body>
+</html>

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

http://git-wip-us.apache.org/repos/asf/incubator-corinthia/blob/03bd5af0/Editor/tests/dom/mergeWithNeighbours13-input.html
----------------------------------------------------------------------
diff --git a/Editor/tests/dom/mergeWithNeighbours13-input.html b/Editor/tests/dom/mergeWithNeighbours13-input.html
new file mode 100644
index 0000000..ad8c2eb
--- /dev/null
+++ b/Editor/tests/dom/mergeWithNeighbours13-input.html
@@ -0,0 +1,25 @@
+<!DOCTYPE html>
+<html>
+<head>
+<script>
+function performTest()
+{
+    var p = document.getElementsByTagName("P")[0];
+    var bs = document.getElementsByTagName("B");
+    var is = document.getElementsByTagName("I");
+
+    var range = new Range(p,1,p,6);
+
+    Range_trackWhileExecuting(range,function() {
+       Formatting_mergeWithNeighbours(bs[1],Formatting_MERGEABLE_INLINE);
+    });
+    showRangeAsBrackets(range);
+}
+</script>
+</head>
+<body>
+
+<p><br><br><b><i>One</i><i>Two</i><i>Three</i></b><b><i>Four</i><i>Five</i><i>Six</i></b><b><i>Seven</i><i>Eight</i><i>Nine</i></b><br><br></p>
+
+</body>
+</html>

http://git-wip-us.apache.org/repos/asf/incubator-corinthia/blob/03bd5af0/Editor/tests/dom/mergeWithNeighbours14-expected.html
----------------------------------------------------------------------
diff --git a/Editor/tests/dom/mergeWithNeighbours14-expected.html b/Editor/tests/dom/mergeWithNeighbours14-expected.html
new file mode 100644
index 0000000..93a1e30
--- /dev/null
+++ b/Editor/tests/dom/mergeWithNeighbours14-expected.html
@@ -0,0 +1,14 @@
+<html>
+  <head></head>
+  <body>
+    <p>
+      [
+      <br/>
+      <br/>
+      <b><i>OneTwoThreeFourFiveSixSevenEightNine</i></b>
+      <br/>
+      <br/>
+      ]
+    </p>
+  </body>
+</html>

http://git-wip-us.apache.org/repos/asf/incubator-corinthia/blob/03bd5af0/Editor/tests/dom/mergeWithNeighbours14-input.html
----------------------------------------------------------------------
diff --git a/Editor/tests/dom/mergeWithNeighbours14-input.html b/Editor/tests/dom/mergeWithNeighbours14-input.html
new file mode 100644
index 0000000..363c0ea
--- /dev/null
+++ b/Editor/tests/dom/mergeWithNeighbours14-input.html
@@ -0,0 +1,25 @@
+<!DOCTYPE html>
+<html>
+<head>
+<script>
+function performTest()
+{
+    var p = document.getElementsByTagName("P")[0];
+    var bs = document.getElementsByTagName("B");
+    var is = document.getElementsByTagName("I");
+
+    var range = new Range(p,0,p,7);
+
+    Range_trackWhileExecuting(range,function() {
+       Formatting_mergeWithNeighbours(bs[1],Formatting_MERGEABLE_INLINE);
+    });
+    showRangeAsBrackets(range);
+}
+</script>
+</head>
+<body>
+
+<p><br><br><b><i>One</i><i>Two</i><i>Three</i></b><b><i>Four</i><i>Five</i><i>Six</i></b><b><i>Seven</i><i>Eight</i><i>Nine</i></b><br><br></p>
+
+</body>
+</html>

http://git-wip-us.apache.org/repos/asf/incubator-corinthia/blob/03bd5af0/Editor/tests/dom/moveCharacters01-expected.html
----------------------------------------------------------------------
diff --git a/Editor/tests/dom/moveCharacters01-expected.html b/Editor/tests/dom/moveCharacters01-expected.html
new file mode 100644
index 0000000..1806ced
--- /dev/null
+++ b/Editor/tests/dom/moveCharacters01-expected.html
@@ -0,0 +1,28 @@
+"|one two three"   ->   "|one three"           ->   "|one two three"
+"o|ne two three"   ->   "o|ne three"           ->   "o|ne two three"
+"on|e two three"   ->   "on|e three"           ->   "on|e two three"
+"one| two three"   ->   "one| three"           ->   "one| two three"
+"one |two three"   ->   "four five |two six"   ->   "one |two three"
+"one t|wo three"   ->   "four five t|wo six"   ->   "one t|wo three"
+"one tw|o three"   ->   "four five tw|o six"   ->   "one tw|o three"
+"one two| three"   ->   "four five two| six"   ->   "one two| three"
+"one two |three"   ->   "four five two |six"   ->   "one two |three"
+"one two t|hree"   ->   "one t|hree"           ->   "one two t|hree"
+"one two th|ree"   ->   "one th|ree"           ->   "one two th|ree"
+"one two thr|ee"   ->   "one thr|ee"           ->   "one two thr|ee"
+"one two thre|e"   ->   "one thre|e"           ->   "one two thre|e"
+"one two three|"   ->   "one three|"           ->   "one two three|"
+"|four five six"   ->   "|four five two six"   ->   "|four five six"
+"f|our five six"   ->   "f|our five two six"   ->   "f|our five six"
+"fo|ur five six"   ->   "fo|ur five two six"   ->   "fo|ur five six"
+"fou|r five six"   ->   "fou|r five two six"   ->   "fou|r five six"
+"four| five six"   ->   "four| five two six"   ->   "four| five six"
+"four |five six"   ->   "four |five two six"   ->   "four |five six"
+"four f|ive six"   ->   "four f|ive two six"   ->   "four f|ive six"
+"four fi|ve six"   ->   "four fi|ve two six"   ->   "four fi|ve six"
+"four fiv|e six"   ->   "four fiv|e two six"   ->   "four fiv|e six"
+"four five| six"   ->   "four five| two six"   ->   "four five| six"
+"four five |six"   ->   "four five two |six"   ->   "one two |three" ***
+"four five s|ix"   ->   "four five two s|ix"   ->   "four five s|ix"
+"four five si|x"   ->   "four five two si|x"   ->   "four five si|x"
+"four five six|"   ->   "four five two six|"   ->   "four five six|"

http://git-wip-us.apache.org/repos/asf/incubator-corinthia/blob/03bd5af0/Editor/tests/dom/moveCharacters01-input.html
----------------------------------------------------------------------
diff --git a/Editor/tests/dom/moveCharacters01-input.html b/Editor/tests/dom/moveCharacters01-input.html
new file mode 100644
index 0000000..a3ab123
--- /dev/null
+++ b/Editor/tests/dom/moveCharacters01-input.html
@@ -0,0 +1,62 @@
+<!DOCTYPE html>
+<html>
+<head>
+<script>
+function pad(str,length)
+{
+    str = ""+str;
+    while (str.length < length)
+        str += " ";
+    return str;
+}
+
+function performTest()
+{
+    var ps = document.getElementsByTagName("P");
+    var text1 = ps[0].firstChild;
+    var text2 = ps[1].firstChild;
+
+    var positions = new Array();
+    for (var i = 0; i <= text1.nodeValue.length; i++)
+        positions.push(new Position(text1,i));
+
+    for (var i = 0; i <= text2.nodeValue.length; i++)
+        positions.push(new Position(text2,i));
+
+    var origStrings = new Array();
+    for (var i = 0; i < positions.length; i++)
+        origStrings.push(positions[i].toString());
+
+    Position_trackWhileExecuting(positions,function() {
+        DOM_moveCharacters(text1,4,8,text2,10,false,false);
+    });
+
+    var movedStrings = new Array();
+    for (var i = 0; i < positions.length; i++)
+        movedStrings.push(positions[i].toString());
+
+    Position_trackWhileExecuting(positions,function() {
+        UndoManager_undo();
+    });
+    var undoneStrings = new Array();
+    for (var i = 0; i < positions.length; i++)
+        undoneStrings.push(positions[i].toString());
+
+    var lines = new Array();
+    for (var i = 0; i < positions.length; i++) {
+        var extra = "";
+        if (undoneStrings[i] != origStrings[i])
+            extra += " ***";
+        lines.push(origStrings[i]+"   ->   "+
+                   pad(movedStrings[i],20)+"   ->   "+
+                   undoneStrings[i]+extra+"\n");
+    }
+    return lines.join("");
+}
+</script>
+</head>
+<body>
+<p>one two three</p>
+<p>four five six</p>
+</body>
+</html>

http://git-wip-us.apache.org/repos/asf/incubator-corinthia/blob/03bd5af0/Editor/tests/dom/moveCharacters02-expected.html
----------------------------------------------------------------------
diff --git a/Editor/tests/dom/moveCharacters02-expected.html b/Editor/tests/dom/moveCharacters02-expected.html
new file mode 100644
index 0000000..1a6ddfb
--- /dev/null
+++ b/Editor/tests/dom/moveCharacters02-expected.html
@@ -0,0 +1,28 @@
+"|one two three"   ->   "|one three"           ->   "|one two three"
+"o|ne two three"   ->   "o|ne three"           ->   "o|ne two three"
+"on|e two three"   ->   "on|e three"           ->   "on|e two three"
+"one| two three"   ->   "one| three"           ->   "one| two three"
+"one |two three"   ->   "one |three"           ->   "one |two three"
+"one t|wo three"   ->   "four five t|wo six"   ->   "one t|wo three"
+"one tw|o three"   ->   "four five tw|o six"   ->   "one tw|o three"
+"one two| three"   ->   "four five two| six"   ->   "one two| three"
+"one two |three"   ->   "four five two |six"   ->   "one two |three"
+"one two t|hree"   ->   "one t|hree"           ->   "one two t|hree"
+"one two th|ree"   ->   "one th|ree"           ->   "one two th|ree"
+"one two thr|ee"   ->   "one thr|ee"           ->   "one two thr|ee"
+"one two thre|e"   ->   "one thre|e"           ->   "one two thre|e"
+"one two three|"   ->   "one three|"           ->   "one two three|"
+"|four five six"   ->   "|four five two six"   ->   "|four five six"
+"f|our five six"   ->   "f|our five two six"   ->   "f|our five six"
+"fo|ur five six"   ->   "fo|ur five two six"   ->   "fo|ur five six"
+"fou|r five six"   ->   "fou|r five two six"   ->   "fou|r five six"
+"four| five six"   ->   "four| five two six"   ->   "four| five six"
+"four |five six"   ->   "four |five two six"   ->   "four |five six"
+"four f|ive six"   ->   "four f|ive two six"   ->   "four f|ive six"
+"four fi|ve six"   ->   "four fi|ve two six"   ->   "four fi|ve six"
+"four fiv|e six"   ->   "four fiv|e two six"   ->   "four fiv|e six"
+"four five| six"   ->   "four five| two six"   ->   "four five| six"
+"four five |six"   ->   "four five |two six"   ->   "four five |six"
+"four five s|ix"   ->   "four five two s|ix"   ->   "four five s|ix"
+"four five si|x"   ->   "four five two si|x"   ->   "four five si|x"
+"four five six|"   ->   "four five two six|"   ->   "four five six|"

http://git-wip-us.apache.org/repos/asf/incubator-corinthia/blob/03bd5af0/Editor/tests/dom/moveCharacters02-input.html
----------------------------------------------------------------------
diff --git a/Editor/tests/dom/moveCharacters02-input.html b/Editor/tests/dom/moveCharacters02-input.html
new file mode 100644
index 0000000..38ed8a1
--- /dev/null
+++ b/Editor/tests/dom/moveCharacters02-input.html
@@ -0,0 +1,62 @@
+<!DOCTYPE html>
+<html>
+<head>
+<script>
+function pad(str,length)
+{
+    str = ""+str;
+    while (str.length < length)
+        str += " ";
+    return str;
+}
+
+function performTest()
+{
+    var ps = document.getElementsByTagName("P");
+    var text1 = ps[0].firstChild;
+    var text2 = ps[1].firstChild;
+
+    var positions = new Array();
+    for (var i = 0; i <= text1.nodeValue.length; i++)
+        positions.push(new Position(text1,i));
+
+    for (var i = 0; i <= text2.nodeValue.length; i++)
+        positions.push(new Position(text2,i));
+
+    var origStrings = new Array();
+    for (var i = 0; i < positions.length; i++)
+        origStrings.push(positions[i].toString());
+
+    Position_trackWhileExecuting(positions,function() {
+        DOM_moveCharacters(text1,4,8,text2,10,true,false);
+    });
+
+    var movedStrings = new Array();
+    for (var i = 0; i < positions.length; i++)
+        movedStrings.push(positions[i].toString());
+
+    Position_trackWhileExecuting(positions,function() {
+        UndoManager_undo();
+    });
+    var undoneStrings = new Array();
+    for (var i = 0; i < positions.length; i++)
+        undoneStrings.push(positions[i].toString());
+
+    var lines = new Array();
+    for (var i = 0; i < positions.length; i++) {
+        var extra = "";
+        if (undoneStrings[i] != origStrings[i])
+            extra += " ***";
+        lines.push(origStrings[i]+"   ->   "+
+                   pad(movedStrings[i],20)+"   ->   "+
+                   undoneStrings[i]+extra+"\n");
+    }
+    return lines.join("");
+}
+</script>
+</head>
+<body>
+<p>one two three</p>
+<p>four five six</p>
+</body>
+</html>

http://git-wip-us.apache.org/repos/asf/incubator-corinthia/blob/03bd5af0/Editor/tests/dom/moveCharacters03-expected.html
----------------------------------------------------------------------
diff --git a/Editor/tests/dom/moveCharacters03-expected.html b/Editor/tests/dom/moveCharacters03-expected.html
new file mode 100644
index 0000000..c5aeb63
--- /dev/null
+++ b/Editor/tests/dom/moveCharacters03-expected.html
@@ -0,0 +1,28 @@
+"|one two three"   ->   "|one three"           ->   "|one two three"
+"o|ne two three"   ->   "o|ne three"           ->   "o|ne two three"
+"on|e two three"   ->   "on|e three"           ->   "on|e two three"
+"one| two three"   ->   "one| three"           ->   "one| two three"
+"one |two three"   ->   "four five |two six"   ->   "one |two three"
+"one t|wo three"   ->   "four five t|wo six"   ->   "one t|wo three"
+"one tw|o three"   ->   "four five tw|o six"   ->   "one tw|o three"
+"one two| three"   ->   "four five two| six"   ->   "one two| three"
+"one two |three"   ->   "one |three"           ->   "one two |three"
+"one two t|hree"   ->   "one t|hree"           ->   "one two t|hree"
+"one two th|ree"   ->   "one th|ree"           ->   "one two th|ree"
+"one two thr|ee"   ->   "one thr|ee"           ->   "one two thr|ee"
+"one two thre|e"   ->   "one thre|e"           ->   "one two thre|e"
+"one two three|"   ->   "one three|"           ->   "one two three|"
+"|four five six"   ->   "|four five two six"   ->   "|four five six"
+"f|our five six"   ->   "f|our five two six"   ->   "f|our five six"
+"fo|ur five six"   ->   "fo|ur five two six"   ->   "fo|ur five six"
+"fou|r five six"   ->   "fou|r five two six"   ->   "fou|r five six"
+"four| five six"   ->   "four| five two six"   ->   "four| five six"
+"four |five six"   ->   "four |five two six"   ->   "four |five six"
+"four f|ive six"   ->   "four f|ive two six"   ->   "four f|ive six"
+"four fi|ve six"   ->   "four fi|ve two six"   ->   "four fi|ve six"
+"four fiv|e six"   ->   "four fiv|e two six"   ->   "four fiv|e six"
+"four five| six"   ->   "four five| two six"   ->   "four five| six"
+"four five |six"   ->   "four five two |six"   ->   "four five |six"
+"four five s|ix"   ->   "four five two s|ix"   ->   "four five s|ix"
+"four five si|x"   ->   "four five two si|x"   ->   "four five si|x"
+"four five six|"   ->   "four five two six|"   ->   "four five six|"

http://git-wip-us.apache.org/repos/asf/incubator-corinthia/blob/03bd5af0/Editor/tests/dom/moveCharacters03-input.html
----------------------------------------------------------------------
diff --git a/Editor/tests/dom/moveCharacters03-input.html b/Editor/tests/dom/moveCharacters03-input.html
new file mode 100644
index 0000000..a18c32e
--- /dev/null
+++ b/Editor/tests/dom/moveCharacters03-input.html
@@ -0,0 +1,62 @@
+<!DOCTYPE html>
+<html>
+<head>
+<script>
+function pad(str,length)
+{
+    str = ""+str;
+    while (str.length < length)
+        str += " ";
+    return str;
+}
+
+function performTest()
+{
+    var ps = document.getElementsByTagName("P");
+    var text1 = ps[0].firstChild;
+    var text2 = ps[1].firstChild;
+
+    var positions = new Array();
+    for (var i = 0; i <= text1.nodeValue.length; i++)
+        positions.push(new Position(text1,i));
+
+    for (var i = 0; i <= text2.nodeValue.length; i++)
+        positions.push(new Position(text2,i));
+
+    var origStrings = new Array();
+    for (var i = 0; i < positions.length; i++)
+        origStrings.push(positions[i].toString());
+
+    Position_trackWhileExecuting(positions,function() {
+        DOM_moveCharacters(text1,4,8,text2,10,false,true);
+    });
+
+    var movedStrings = new Array();
+    for (var i = 0; i < positions.length; i++)
+        movedStrings.push(positions[i].toString());
+
+    Position_trackWhileExecuting(positions,function() {
+        UndoManager_undo();
+    });
+    var undoneStrings = new Array();
+    for (var i = 0; i < positions.length; i++)
+        undoneStrings.push(positions[i].toString());
+
+    var lines = new Array();
+    for (var i = 0; i < positions.length; i++) {
+        var extra = "";
+        if (undoneStrings[i] != origStrings[i])
+            extra += " ***";
+        lines.push(origStrings[i]+"   ->   "+
+                   pad(movedStrings[i],20)+"   ->   "+
+                   undoneStrings[i]+extra+"\n");
+    }
+    return lines.join("");
+}
+</script>
+</head>
+<body>
+<p>one two three</p>
+<p>four five six</p>
+</body>
+</html>

http://git-wip-us.apache.org/repos/asf/incubator-corinthia/blob/03bd5af0/Editor/tests/dom/moveCharacters04-expected.html
----------------------------------------------------------------------
diff --git a/Editor/tests/dom/moveCharacters04-expected.html b/Editor/tests/dom/moveCharacters04-expected.html
new file mode 100644
index 0000000..c59f731
--- /dev/null
+++ b/Editor/tests/dom/moveCharacters04-expected.html
@@ -0,0 +1,28 @@
+"|one two three"   ->   "|one three"           ->   "|one two three"
+"o|ne two three"   ->   "o|ne three"           ->   "o|ne two three"
+"on|e two three"   ->   "on|e three"           ->   "on|e two three"
+"one| two three"   ->   "one| three"           ->   "one| two three"
+"one |two three"   ->   "one |three"           ->   "one |two three"
+"one t|wo three"   ->   "four five t|wo six"   ->   "one t|wo three"
+"one tw|o three"   ->   "four five tw|o six"   ->   "one tw|o three"
+"one two| three"   ->   "four five two| six"   ->   "one two| three"
+"one two |three"   ->   "one |three"           ->   "one |two three" ***
+"one two t|hree"   ->   "one t|hree"           ->   "one two t|hree"
+"one two th|ree"   ->   "one th|ree"           ->   "one two th|ree"
+"one two thr|ee"   ->   "one thr|ee"           ->   "one two thr|ee"
+"one two thre|e"   ->   "one thre|e"           ->   "one two thre|e"
+"one two three|"   ->   "one three|"           ->   "one two three|"
+"|four five six"   ->   "|four five two six"   ->   "|four five six"
+"f|our five six"   ->   "f|our five two six"   ->   "f|our five six"
+"fo|ur five six"   ->   "fo|ur five two six"   ->   "fo|ur five six"
+"fou|r five six"   ->   "fou|r five two six"   ->   "fou|r five six"
+"four| five six"   ->   "four| five two six"   ->   "four| five six"
+"four |five six"   ->   "four |five two six"   ->   "four |five six"
+"four f|ive six"   ->   "four f|ive two six"   ->   "four f|ive six"
+"four fi|ve six"   ->   "four fi|ve two six"   ->   "four fi|ve six"
+"four fiv|e six"   ->   "four fiv|e two six"   ->   "four fiv|e six"
+"four five| six"   ->   "four five| two six"   ->   "four five| six"
+"four five |six"   ->   "four five |two six"   ->   "four five |six"
+"four five s|ix"   ->   "four five two s|ix"   ->   "four five s|ix"
+"four five si|x"   ->   "four five two si|x"   ->   "four five si|x"
+"four five six|"   ->   "four five two six|"   ->   "four five six|"

http://git-wip-us.apache.org/repos/asf/incubator-corinthia/blob/03bd5af0/Editor/tests/dom/moveCharacters04-input.html
----------------------------------------------------------------------
diff --git a/Editor/tests/dom/moveCharacters04-input.html b/Editor/tests/dom/moveCharacters04-input.html
new file mode 100644
index 0000000..7d409d7
--- /dev/null
+++ b/Editor/tests/dom/moveCharacters04-input.html
@@ -0,0 +1,62 @@
+<!DOCTYPE html>
+<html>
+<head>
+<script>
+function pad(str,length)
+{
+    str = ""+str;
+    while (str.length < length)
+        str += " ";
+    return str;
+}
+
+function performTest()
+{
+    var ps = document.getElementsByTagName("P");
+    var text1 = ps[0].firstChild;
+    var text2 = ps[1].firstChild;
+
+    var positions = new Array();
+    for (var i = 0; i <= text1.nodeValue.length; i++)
+        positions.push(new Position(text1,i));
+
+    for (var i = 0; i <= text2.nodeValue.length; i++)
+        positions.push(new Position(text2,i));
+
+    var origStrings = new Array();
+    for (var i = 0; i < positions.length; i++)
+        origStrings.push(positions[i].toString());
+
+    Position_trackWhileExecuting(positions,function() {
+        DOM_moveCharacters(text1,4,8,text2,10,true,true);
+    });
+
+    var movedStrings = new Array();
+    for (var i = 0; i < positions.length; i++)
+        movedStrings.push(positions[i].toString());
+
+    Position_trackWhileExecuting(positions,function() {
+        UndoManager_undo();
+    });
+    var undoneStrings = new Array();
+    for (var i = 0; i < positions.length; i++)
+        undoneStrings.push(positions[i].toString());
+
+    var lines = new Array();
+    for (var i = 0; i < positions.length; i++) {
+        var extra = "";
+        if (undoneStrings[i] != origStrings[i])
+            extra += " ***";
+        lines.push(origStrings[i]+"   ->   "+
+                   pad(movedStrings[i],20)+"   ->   "+
+                   undoneStrings[i]+extra+"\n");
+    }
+    return lines.join("");
+}
+</script>
+</head>
+<body>
+<p>one two three</p>
+<p>four five six</p>
+</body>
+</html>

http://git-wip-us.apache.org/repos/asf/incubator-corinthia/blob/03bd5af0/Editor/tests/dom/moveNode01-expected.html
----------------------------------------------------------------------
diff --git a/Editor/tests/dom/moveNode01-expected.html b/Editor/tests/dom/moveNode01-expected.html
new file mode 100644
index 0000000..6aad3c0
--- /dev/null
+++ b/Editor/tests/dom/moveNode01-expected.html
@@ -0,0 +1,10 @@
+<html>
+  <head></head>
+  <body>
+    <tt/>
+    <span>Zero</span>
+    <p><span>One</span></p>
+    <p>Two</p>
+    <p>Three</p>
+  </body>
+</html>

http://git-wip-us.apache.org/repos/asf/incubator-corinthia/blob/03bd5af0/Editor/tests/dom/moveNode01-input.html
----------------------------------------------------------------------
diff --git a/Editor/tests/dom/moveNode01-input.html b/Editor/tests/dom/moveNode01-input.html
new file mode 100644
index 0000000..c2a167f
--- /dev/null
+++ b/Editor/tests/dom/moveNode01-input.html
@@ -0,0 +1,19 @@
+<!DOCTYPE html>
+<html>
+<head>
+<script>
+function performTest()
+{
+    var ps = document.getElementsByTagName("P");
+    var position = new Position(ps[0],0);
+
+    Position_trackWhileExecuting([position],function() {
+        DOM_insertBefore(document.body,ps[0].childNodes[0],ps[0]);
+    });
+
+    var tt = DOM_createElement(document,"tt");
+    insertAtPosition(position,tt);
+}
+</script>
+</head>
+<body><p><span>Zero</span><span>One</span></p><p>Two</p><p>Three</p></body></html>

http://git-wip-us.apache.org/repos/asf/incubator-corinthia/blob/03bd5af0/Editor/tests/dom/moveNode02-expected.html
----------------------------------------------------------------------
diff --git a/Editor/tests/dom/moveNode02-expected.html b/Editor/tests/dom/moveNode02-expected.html
new file mode 100644
index 0000000..8aca2c8
--- /dev/null
+++ b/Editor/tests/dom/moveNode02-expected.html
@@ -0,0 +1,10 @@
+<html>
+  <head></head>
+  <body>
+    <p><span>One</span></p>
+    <tt/>
+    <span>Zero</span>
+    <p>Two</p>
+    <p>Three</p>
+  </body>
+</html>

http://git-wip-us.apache.org/repos/asf/incubator-corinthia/blob/03bd5af0/Editor/tests/dom/moveNode02-input.html
----------------------------------------------------------------------
diff --git a/Editor/tests/dom/moveNode02-input.html b/Editor/tests/dom/moveNode02-input.html
new file mode 100644
index 0000000..6ca508a
--- /dev/null
+++ b/Editor/tests/dom/moveNode02-input.html
@@ -0,0 +1,19 @@
+<!DOCTYPE html>
+<html>
+<head>
+<script>
+function performTest()
+{
+    var ps = document.getElementsByTagName("P");
+    var position = new Position(ps[0],0);
+
+    Position_trackWhileExecuting([position],function() {
+        DOM_insertBefore(document.body,ps[0].childNodes[0],ps[1]);
+    });
+
+    var tt = DOM_createElement(document,"tt");
+    insertAtPosition(position,tt);
+}
+</script>
+</head>
+<body><p><span>Zero</span><span>One</span></p><p>Two</p><p>Three</p></body></html>

http://git-wip-us.apache.org/repos/asf/incubator-corinthia/blob/03bd5af0/Editor/tests/dom/moveNode03-expected.html
----------------------------------------------------------------------
diff --git a/Editor/tests/dom/moveNode03-expected.html b/Editor/tests/dom/moveNode03-expected.html
new file mode 100644
index 0000000..023e626
--- /dev/null
+++ b/Editor/tests/dom/moveNode03-expected.html
@@ -0,0 +1,10 @@
+<html>
+  <head></head>
+  <body>
+    <p><span>One</span></p>
+    <p>Two</p>
+    <tt/>
+    <span>Zero</span>
+    <p>Three</p>
+  </body>
+</html>

http://git-wip-us.apache.org/repos/asf/incubator-corinthia/blob/03bd5af0/Editor/tests/dom/moveNode03-input.html
----------------------------------------------------------------------
diff --git a/Editor/tests/dom/moveNode03-input.html b/Editor/tests/dom/moveNode03-input.html
new file mode 100644
index 0000000..f2f4fe0
--- /dev/null
+++ b/Editor/tests/dom/moveNode03-input.html
@@ -0,0 +1,19 @@
+<!DOCTYPE html>
+<html>
+<head>
+<script>
+function performTest()
+{
+    var ps = document.getElementsByTagName("P");
+    var position = new Position(ps[0],0);
+
+    Position_trackWhileExecuting([position],function() {
+        DOM_insertBefore(document.body,ps[0].childNodes[0],ps[2]);
+    });
+
+    var tt = DOM_createElement(document,"tt");
+    insertAtPosition(position,tt);
+}
+</script>
+</head>
+<body><p><span>Zero</span><span>One</span></p><p>Two</p><p>Three</p></body></html>

http://git-wip-us.apache.org/repos/asf/incubator-corinthia/blob/03bd5af0/Editor/tests/dom/moveNode04-expected.html
----------------------------------------------------------------------
diff --git a/Editor/tests/dom/moveNode04-expected.html b/Editor/tests/dom/moveNode04-expected.html
new file mode 100644
index 0000000..0d92ebe
--- /dev/null
+++ b/Editor/tests/dom/moveNode04-expected.html
@@ -0,0 +1,10 @@
+<html>
+  <head></head>
+  <body>
+    <p><span>One</span></p>
+    <p>Two</p>
+    <p>Three</p>
+    <tt/>
+    <span>Zero</span>
+  </body>
+</html>

http://git-wip-us.apache.org/repos/asf/incubator-corinthia/blob/03bd5af0/Editor/tests/dom/moveNode04-input.html
----------------------------------------------------------------------
diff --git a/Editor/tests/dom/moveNode04-input.html b/Editor/tests/dom/moveNode04-input.html
new file mode 100644
index 0000000..2ad8ecc
--- /dev/null
+++ b/Editor/tests/dom/moveNode04-input.html
@@ -0,0 +1,19 @@
+<!DOCTYPE html>
+<html>
+<head>
+<script>
+function performTest()
+{
+    var ps = document.getElementsByTagName("P");
+    var position = new Position(ps[0],0);
+
+    Position_trackWhileExecuting([position],function() {
+        DOM_insertBefore(document.body,ps[0].childNodes[0],ps[3]);
+    });
+
+    var tt = DOM_createElement(document,"tt");
+    insertAtPosition(position,tt);
+}
+</script>
+</head>
+<body><p><span>Zero</span><span>One</span></p><p>Two</p><p>Three</p></body></html>

http://git-wip-us.apache.org/repos/asf/incubator-corinthia/blob/03bd5af0/Editor/tests/dom/moveNode05-expected.html
----------------------------------------------------------------------
diff --git a/Editor/tests/dom/moveNode05-expected.html b/Editor/tests/dom/moveNode05-expected.html
new file mode 100644
index 0000000..53dc1fb
--- /dev/null
+++ b/Editor/tests/dom/moveNode05-expected.html
@@ -0,0 +1,10 @@
+<html>
+  <head></head>
+  <body>
+    <tt/>
+    <span>One</span>
+    <p><span>Zero</span></p>
+    <p>Two</p>
+    <p>Three</p>
+  </body>
+</html>

http://git-wip-us.apache.org/repos/asf/incubator-corinthia/blob/03bd5af0/Editor/tests/dom/moveNode05-input.html
----------------------------------------------------------------------
diff --git a/Editor/tests/dom/moveNode05-input.html b/Editor/tests/dom/moveNode05-input.html
new file mode 100644
index 0000000..2db783e
--- /dev/null
+++ b/Editor/tests/dom/moveNode05-input.html
@@ -0,0 +1,19 @@
+<!DOCTYPE html>
+<html>
+<head>
+<script>
+function performTest()
+{
+    var ps = document.getElementsByTagName("P");
+    var position = new Position(ps[0],1);
+
+    Position_trackWhileExecuting([position],function() {
+        DOM_insertBefore(document.body,ps[0].childNodes[1],ps[0]);
+    });
+
+    var tt = DOM_createElement(document,"tt");
+    insertAtPosition(position,tt);
+}
+</script>
+</head>
+<body><p><span>Zero</span><span>One</span></p><p>Two</p><p>Three</p></body></html>

http://git-wip-us.apache.org/repos/asf/incubator-corinthia/blob/03bd5af0/Editor/tests/dom/moveNode06-expected.html
----------------------------------------------------------------------
diff --git a/Editor/tests/dom/moveNode06-expected.html b/Editor/tests/dom/moveNode06-expected.html
new file mode 100644
index 0000000..5842ce2
--- /dev/null
+++ b/Editor/tests/dom/moveNode06-expected.html
@@ -0,0 +1,10 @@
+<html>
+  <head></head>
+  <body>
+    <p><span>Zero</span></p>
+    <tt/>
+    <span>One</span>
+    <p>Two</p>
+    <p>Three</p>
+  </body>
+</html>

http://git-wip-us.apache.org/repos/asf/incubator-corinthia/blob/03bd5af0/Editor/tests/dom/moveNode06-input.html
----------------------------------------------------------------------
diff --git a/Editor/tests/dom/moveNode06-input.html b/Editor/tests/dom/moveNode06-input.html
new file mode 100644
index 0000000..5f32219
--- /dev/null
+++ b/Editor/tests/dom/moveNode06-input.html
@@ -0,0 +1,19 @@
+<!DOCTYPE html>
+<html>
+<head>
+<script>
+function performTest()
+{
+    var ps = document.getElementsByTagName("P");
+    var position = new Position(ps[0],1);
+
+    Position_trackWhileExecuting([position],function() {
+        DOM_insertBefore(document.body,ps[0].childNodes[1],ps[1]);
+    });
+
+    var tt = DOM_createElement(document,"tt");
+    insertAtPosition(position,tt);
+}
+</script>
+</head>
+<body><p><span>Zero</span><span>One</span></p><p>Two</p><p>Three</p></body></html>

http://git-wip-us.apache.org/repos/asf/incubator-corinthia/blob/03bd5af0/Editor/tests/dom/moveNode07-expected.html
----------------------------------------------------------------------
diff --git a/Editor/tests/dom/moveNode07-expected.html b/Editor/tests/dom/moveNode07-expected.html
new file mode 100644
index 0000000..97072cc
--- /dev/null
+++ b/Editor/tests/dom/moveNode07-expected.html
@@ -0,0 +1,10 @@
+<html>
+  <head></head>
+  <body>
+    <p><span>Zero</span></p>
+    <p>Two</p>
+    <tt/>
+    <span>One</span>
+    <p>Three</p>
+  </body>
+</html>

http://git-wip-us.apache.org/repos/asf/incubator-corinthia/blob/03bd5af0/Editor/tests/dom/moveNode07-input.html
----------------------------------------------------------------------
diff --git a/Editor/tests/dom/moveNode07-input.html b/Editor/tests/dom/moveNode07-input.html
new file mode 100644
index 0000000..255861c
--- /dev/null
+++ b/Editor/tests/dom/moveNode07-input.html
@@ -0,0 +1,19 @@
+<!DOCTYPE html>
+<html>
+<head>
+<script>
+function performTest()
+{
+    var ps = document.getElementsByTagName("P");
+    var position = new Position(ps[0],1);
+
+    Position_trackWhileExecuting([position],function() {
+        DOM_insertBefore(document.body,ps[0].childNodes[1],ps[2]);
+    });
+
+    var tt = DOM_createElement(document,"tt");
+    insertAtPosition(position,tt);
+}
+</script>
+</head>
+<body><p><span>Zero</span><span>One</span></p><p>Two</p><p>Three</p></body></html>

http://git-wip-us.apache.org/repos/asf/incubator-corinthia/blob/03bd5af0/Editor/tests/dom/moveNode08-expected.html
----------------------------------------------------------------------
diff --git a/Editor/tests/dom/moveNode08-expected.html b/Editor/tests/dom/moveNode08-expected.html
new file mode 100644
index 0000000..dd2d2eb
--- /dev/null
+++ b/Editor/tests/dom/moveNode08-expected.html
@@ -0,0 +1,10 @@
+<html>
+  <head></head>
+  <body>
+    <p><span>Zero</span></p>
+    <p>Two</p>
+    <p>Three</p>
+    <tt/>
+    <span>One</span>
+  </body>
+</html>

http://git-wip-us.apache.org/repos/asf/incubator-corinthia/blob/03bd5af0/Editor/tests/dom/moveNode08-input.html
----------------------------------------------------------------------
diff --git a/Editor/tests/dom/moveNode08-input.html b/Editor/tests/dom/moveNode08-input.html
new file mode 100644
index 0000000..47fa98a
--- /dev/null
+++ b/Editor/tests/dom/moveNode08-input.html
@@ -0,0 +1,19 @@
+<!DOCTYPE html>
+<html>
+<head>
+<script>
+function performTest()
+{
+    var ps = document.getElementsByTagName("P");
+    var position = new Position(ps[0],1);
+
+    Position_trackWhileExecuting([position],function() {
+        DOM_insertBefore(document.body,ps[0].childNodes[1],null);
+    });
+
+    var tt = DOM_createElement(document,"tt");
+    insertAtPosition(position,tt);
+}
+</script>
+</head>
+<body><p><span>Zero</span><span>One</span></p><p>Two</p><p>Three</p></body></html>

http://git-wip-us.apache.org/repos/asf/incubator-corinthia/blob/03bd5af0/Editor/tests/dom/moveNode09-expected.html
----------------------------------------------------------------------
diff --git a/Editor/tests/dom/moveNode09-expected.html b/Editor/tests/dom/moveNode09-expected.html
new file mode 100644
index 0000000..380df29
--- /dev/null
+++ b/Editor/tests/dom/moveNode09-expected.html
@@ -0,0 +1,12 @@
+<html>
+  <head></head>
+  <body>
+    <span>One</span>
+    <p>
+      <tt/>
+      <span>Zero</span>
+    </p>
+    <p>Two</p>
+    <p>Three</p>
+  </body>
+</html>

http://git-wip-us.apache.org/repos/asf/incubator-corinthia/blob/03bd5af0/Editor/tests/dom/moveNode09-input.html
----------------------------------------------------------------------
diff --git a/Editor/tests/dom/moveNode09-input.html b/Editor/tests/dom/moveNode09-input.html
new file mode 100644
index 0000000..7f0184b
--- /dev/null
+++ b/Editor/tests/dom/moveNode09-input.html
@@ -0,0 +1,19 @@
+<!DOCTYPE html>
+<html>
+<head>
+<script>
+function performTest()
+{
+    var ps = document.getElementsByTagName("P");
+    var position = new Position(ps[0],0);
+
+    Position_trackWhileExecuting([position],function() {
+        DOM_insertBefore(document.body,ps[0].childNodes[1],ps[0]);
+    });
+
+    var tt = DOM_createElement(document,"tt");
+    insertAtPosition(position,tt);
+}
+</script>
+</head>
+<body><p><span>Zero</span><span>One</span></p><p>Two</p><p>Three</p></body></html>

http://git-wip-us.apache.org/repos/asf/incubator-corinthia/blob/03bd5af0/Editor/tests/dom/moveNode10-expected.html
----------------------------------------------------------------------
diff --git a/Editor/tests/dom/moveNode10-expected.html b/Editor/tests/dom/moveNode10-expected.html
new file mode 100644
index 0000000..064dc3a
--- /dev/null
+++ b/Editor/tests/dom/moveNode10-expected.html
@@ -0,0 +1,12 @@
+<html>
+  <head></head>
+  <body>
+    <span>Zero</span>
+    <p>
+      <tt/>
+      <span>One</span>
+    </p>
+    <p>Two</p>
+    <p>Three</p>
+  </body>
+</html>

http://git-wip-us.apache.org/repos/asf/incubator-corinthia/blob/03bd5af0/Editor/tests/dom/moveNode10-input.html
----------------------------------------------------------------------
diff --git a/Editor/tests/dom/moveNode10-input.html b/Editor/tests/dom/moveNode10-input.html
new file mode 100644
index 0000000..72d7950
--- /dev/null
+++ b/Editor/tests/dom/moveNode10-input.html
@@ -0,0 +1,19 @@
+<!DOCTYPE html>
+<html>
+<head>
+<script>
+function performTest()
+{
+    var ps = document.getElementsByTagName("P");
+    var position = new Position(ps[0],1);
+
+    Position_trackWhileExecuting([position],function() {
+        DOM_insertBefore(document.body,ps[0].childNodes[0],ps[0]);
+    });
+
+    var tt = DOM_createElement(document,"tt");
+    insertAtPosition(position,tt);
+}
+</script>
+</head>
+<body><p><span>Zero</span><span>One</span></p><p>Two</p><p>Three</p></body></html>

http://git-wip-us.apache.org/repos/asf/incubator-corinthia/blob/03bd5af0/Editor/tests/dom/moveNode11-expected.html
----------------------------------------------------------------------
diff --git a/Editor/tests/dom/moveNode11-expected.html b/Editor/tests/dom/moveNode11-expected.html
new file mode 100644
index 0000000..03e6860
--- /dev/null
+++ b/Editor/tests/dom/moveNode11-expected.html
@@ -0,0 +1,12 @@
+<html>
+  <head></head>
+  <body>
+    <span>Zero</span>
+    <p>
+      <span>One</span>
+      <tt/>
+    </p>
+    <p>Two</p>
+    <p>Three</p>
+  </body>
+</html>

http://git-wip-us.apache.org/repos/asf/incubator-corinthia/blob/03bd5af0/Editor/tests/dom/moveNode11-input.html
----------------------------------------------------------------------
diff --git a/Editor/tests/dom/moveNode11-input.html b/Editor/tests/dom/moveNode11-input.html
new file mode 100644
index 0000000..bcf7118
--- /dev/null
+++ b/Editor/tests/dom/moveNode11-input.html
@@ -0,0 +1,19 @@
+<!DOCTYPE html>
+<html>
+<head>
+<script>
+function performTest()
+{
+    var ps = document.getElementsByTagName("P");
+    var position = new Position(ps[0],2);
+
+    Position_trackWhileExecuting([position],function() {
+        DOM_insertBefore(document.body,ps[0].childNodes[0],ps[0]);
+    });
+
+    var tt = DOM_createElement(document,"tt");
+    insertAtPosition(position,tt);
+}
+</script>
+</head>
+<body><p><span>Zero</span><span>One</span></p><p>Two</p><p>Three</p></body></html>

http://git-wip-us.apache.org/repos/asf/incubator-corinthia/blob/03bd5af0/Editor/tests/dom/moveNode12-expected.html
----------------------------------------------------------------------
diff --git a/Editor/tests/dom/moveNode12-expected.html b/Editor/tests/dom/moveNode12-expected.html
new file mode 100644
index 0000000..1b755ae
--- /dev/null
+++ b/Editor/tests/dom/moveNode12-expected.html
@@ -0,0 +1,12 @@
+<html>
+  <head></head>
+  <body>
+    <span>One</span>
+    <p>
+      <span>Zero</span>
+      <tt/>
+    </p>
+    <p>Two</p>
+    <p>Three</p>
+  </body>
+</html>

http://git-wip-us.apache.org/repos/asf/incubator-corinthia/blob/03bd5af0/Editor/tests/dom/moveNode12-input.html
----------------------------------------------------------------------
diff --git a/Editor/tests/dom/moveNode12-input.html b/Editor/tests/dom/moveNode12-input.html
new file mode 100644
index 0000000..d6705a4
--- /dev/null
+++ b/Editor/tests/dom/moveNode12-input.html
@@ -0,0 +1,19 @@
+<!DOCTYPE html>
+<html>
+<head>
+<script>
+function performTest()
+{
+    var ps = document.getElementsByTagName("P");
+    var position = new Position(ps[0],2);
+
+    Position_trackWhileExecuting([position],function() {
+        DOM_insertBefore(document.body,ps[0].childNodes[1],ps[0]);
+    });
+
+    var tt = DOM_createElement(document,"tt");
+    insertAtPosition(position,tt);
+}
+</script>
+</head>
+<body><p><span>Zero</span><span>One</span></p><p>Two</p><p>Three</p></body></html>

http://git-wip-us.apache.org/repos/asf/incubator-corinthia/blob/03bd5af0/Editor/tests/dom/moveNode13-expected.html
----------------------------------------------------------------------
diff --git a/Editor/tests/dom/moveNode13-expected.html b/Editor/tests/dom/moveNode13-expected.html
new file mode 100644
index 0000000..52a99f5
--- /dev/null
+++ b/Editor/tests/dom/moveNode13-expected.html
@@ -0,0 +1,12 @@
+<html>
+  <head></head>
+  <body>
+    <p>
+      <tt/>
+      <span>Zero</span>
+      <span>One</span>
+    </p>
+    <p>Two</p>
+    <p>Three</p>
+  </body>
+</html>

http://git-wip-us.apache.org/repos/asf/incubator-corinthia/blob/03bd5af0/Editor/tests/dom/moveNode13-input.html
----------------------------------------------------------------------
diff --git a/Editor/tests/dom/moveNode13-input.html b/Editor/tests/dom/moveNode13-input.html
new file mode 100644
index 0000000..1d81cf1
--- /dev/null
+++ b/Editor/tests/dom/moveNode13-input.html
@@ -0,0 +1,19 @@
+<!DOCTYPE html>
+<html>
+<head>
+<script>
+function performTest()
+{
+    var ps = document.getElementsByTagName("P");
+    var position = new Position(ps[0],0);
+
+    Position_trackWhileExecuting([position],function() {
+        DOM_insertBefore(document.body,ps[0],ps[1]);
+    });
+
+    var tt = DOM_createElement(document,"tt");
+    insertAtPosition(position,tt);
+}
+</script>
+</head>
+<body><p><span>Zero</span><span>One</span></p><p>Two</p><p>Three</p></body></html>


Mime
View raw message