corinthia-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From j...@apache.org
Subject [50/51] [abbrv] [partial] incubator-corinthia git commit: added js test files
Date Fri, 14 Aug 2015 16:10:57 GMT
http://git-wip-us.apache.org/repos/asf/incubator-corinthia/blob/0633908a/experiments/editorFramework/test/Layer0/PrettyPrinter.js
----------------------------------------------------------------------
diff --git a/experiments/editorFramework/test/Layer0/PrettyPrinter.js b/experiments/editorFramework/test/Layer0/PrettyPrinter.js
new file mode 100644
index 0000000..f18d7ba
--- /dev/null
+++ b/experiments/editorFramework/test/Layer0/PrettyPrinter.js
@@ -0,0 +1,226 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements.  See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership.  The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License.  You may obtain a copy of the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied.  See the License for the
+// specific language governing permissions and limitations
+// under the License.
+
+(function() {
+
+    // Applicable options:
+    // keepSelectionHighlights (boolean)
+    // preserveCase (boolean)
+    // showNamespaceDetails (boolean)
+    // separateLines (boolean)
+
+    function getHTML(root,options)
+    {
+        var copy;
+        UndoManager_disableWhileExecuting(function() {
+            if (options == null)
+                options = new Object();
+            copy = DOM_cloneNode(root,true);
+            if (!options.keepSelectionHighlights)
+                removeSelectionSpans(copy);
+            for (var body = copy.firstChild; body != null; body = body.nextSibling) {
+                if (body.nodeName == "BODY") {
+                    DOM_removeAttribute(body,"style");
+                    DOM_removeAttribute(body,"contentEditable");
+                }
+            }
+        });
+
+        var output = new Array();
+        prettyPrint(output,options,copy,"");
+        return output.join("");
+    }
+
+    function removeSelectionSpans(root)
+    {
+        var checkMerge = new Array();
+        recurse(root);
+
+        for (var i = 0; i < checkMerge.length; i++) {
+            if (checkMerge[i].parentNode != null) { // if not already merged
+                Formatting_mergeWithNeighbours(checkMerge[i],{});
+            }
+        }
+
+        function recurse(node) {
+            if (isSelectionHighlight(node)) {
+                checkMerge.push(node.firstChild);
+                checkMerge.push(node.lastChild);
+                DOM_removeNodeButKeepChildren(node);
+            }
+            else {
+                var next;
+                for (var child = node.firstChild; child != null; child = next) {
+                    next = child.nextSibling;
+                    recurse(child);
+                }
+            }
+        }
+    }
+
+    function entityFix(str)
+    {
+        return str.replace(/\u00a0/g,"&nbsp;");
+    }
+
+    function singleDescendents(node)
+    {
+        var count = 0;
+        for (var child = node.firstChild; child != null; child = child.nextSibling) {
+            if ((child.nodeType == Node.TEXT_NODE) && (textNodeDisplayValue(child).length == 0))
+                continue;
+            count++;
+            if (count > 1)
+                return false;
+            if (!singleDescendents(child))
+                return false;
+        }
+        return true;
+    }
+
+    function sortCSSProperties(value)
+    {
+        // Make sure the CSS properties on the "style" attribute appear in a consistent order
+        var items = value.trim().split(/\s*;\s*/);
+        if ((items.length > 0) && (items[items.length-1] == ""))
+            items.length--;
+        items.sort();
+        return items.join("; ");
+    }
+
+    function attributeString(options,node)
+    {
+        // Make sure the attributes appear in a consistent order
+        var names = new Array();
+        for (var i = 0; i < node.attributes.length; i++) {
+            names.push(node.attributes[i].nodeName);
+        }
+        names.sort();
+        var str = "";
+        for (var i = 0; i < names.length; i++) {
+            var name = names[i];
+
+            var value = node.getAttribute(name);
+            if (name == "style")
+                value = sortCSSProperties(value);
+            var attr = node.getAttributeNode(name);
+            if (options.showNamespaceDetails) {
+                if ((attr.namespaceURI != null) || (attr.prefix != null))
+                    name = "{"+attr.namespaceURI+","+attr.prefix+","+attr.localName+"}"+name;
+            }
+            str += " "+name+"=\""+value+"\"";
+        }
+        return str;
+    }
+
+    function textNodeDisplayValue(node)
+    {
+        var value = entityFix(node.nodeValue);
+        if ((node.parentNode != null) &&
+            (node.parentNode.getAttribute("xml:space") != "preserve"))
+            value = value.trim();
+        return value;
+    }
+
+    function prettyPrintOneLine(output,options,node)
+    {
+        if ((node.nodeType == Node.ELEMENT_NODE) && (node.nodeName != "SCRIPT")) {
+            var name = options.preserveCase ? node.nodeName : node.nodeName.toLowerCase();
+            if (node.firstChild == null) {
+                output.push("<" + name + attributeString(options,node) + "/>");
+            }
+            else {
+                output.push("<" + name + attributeString(options,node) + ">");
+                for (var child = node.firstChild; child != null; child = child.nextSibling)
+                    prettyPrintOneLine(output,options,child);
+                output.push("</" + name + ">");
+            }
+        }
+        else if (node.nodeType == Node.TEXT_NODE) {
+            var value = textNodeDisplayValue(node);
+            if (value.length > 0)
+                output.push(value);
+        }
+        else if (node.nodeType == Node.COMMENT_NODE) {
+            output.push("<!--" + entityFix(node.nodeValue) + "-->\n");
+        }
+    }
+
+    function isContainer(node)
+    {
+        switch (node._type) {
+        case HTML_BODY:
+        case HTML_SECTION:
+        case HTML_FIGURE:
+        case HTML_TABLE:
+        case HTML_TBODY:
+        case HTML_THEAD:
+        case HTML_TFOOT:
+        case HTML_TR:
+        case HTML_DIV:
+        case HTML_UL:
+        case HTML_OL:
+        case HTML_NAV:
+        case HTML_COLGROUP:
+            return true;
+        default:
+            return false;
+        }
+    }
+
+    function prettyPrint(output,options,node,indent)
+    {
+        if ((node.nodeType == Node.ELEMENT_NODE) && (node.nodeName != "SCRIPT")) {
+            var name = options.preserveCase ? node.nodeName : node.nodeName.toLowerCase();
+            if (node.firstChild == null) {
+                output.push(indent + "<" + name + attributeString(options,node) + "/>\n");
+            }
+            else {
+                if (node._type == HTML_STYLE) {
+                    output.push(indent + "<" + name + attributeString(options,node) + ">\n");
+                    for (var child = node.firstChild; child != null; child = child.nextSibling)
+                        prettyPrint(output,options,child,"");
+                    output.push(indent + "</" + name + ">\n");
+                }
+                else if (!options.separateLines && singleDescendents(node) && !isContainer(node)) {
+                    output.push(indent);
+                    prettyPrintOneLine(output,options,node);
+                    output.push("\n");
+                }
+                else {
+                    output.push(indent + "<" + name + attributeString(options,node) + ">\n");
+                    for (var child = node.firstChild; child != null; child = child.nextSibling)
+                        prettyPrint(output,options,child,indent+"  ");
+                    output.push(indent + "</" + name + ">\n");
+                }
+            }
+        }
+        else if (node.nodeType == Node.TEXT_NODE) {
+            var value = textNodeDisplayValue(node);
+//            var value = JSON.stringify(node.nodeValue);
+            if (value.length > 0)
+                output.push(indent + value + "\n");
+        }
+        else if (node.nodeType == Node.COMMENT_NODE) {
+            output.push(indent + "<!--" + entityFix(node.nodeValue) + "-->\n");
+        }
+    }
+
+    window.PrettyPrinter = new Object();
+    window.PrettyPrinter.getHTML = getHTML;
+
+})();

http://git-wip-us.apache.org/repos/asf/incubator-corinthia/blob/0633908a/experiments/editorFramework/test/Layer0/autocorrect/AutoCorrectTests.js
----------------------------------------------------------------------
diff --git a/experiments/editorFramework/test/Layer0/autocorrect/AutoCorrectTests.js b/experiments/editorFramework/test/Layer0/autocorrect/AutoCorrectTests.js
new file mode 100644
index 0000000..fdc771d
--- /dev/null
+++ b/experiments/editorFramework/test/Layer0/autocorrect/AutoCorrectTests.js
@@ -0,0 +1,50 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements.  See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership.  The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License.  You may obtain a copy of the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied.  See the License for the
+// specific language governing permissions and limitations
+// under the License.
+
+function findTextMatching(re)
+{
+    return recurse(document.body);
+
+    function recurse(node)
+    {
+        if (node.nodeType == Node.TEXT_NODE) {
+            if (node.nodeValue.match(re))
+                return node;
+            else
+                return null;
+        }
+        else {
+            for (var child = node.firstChild; child != null; child = child.nextSibling) {
+                var result = recurse(child);
+                if (result != null)
+                    return result;
+            }
+            return null;
+        }
+    }
+}
+
+function showCorrections()
+{
+    var corrections = AutoCorrect_getCorrections();
+    var lines = new Array();
+    lines.push("Corrections:\n");
+    for (var i = 0; i < corrections.length; i++) {
+        lines.push("    "+corrections[i].original+" -> "+corrections[i].replacement+"\n");
+    }
+    return PrettyPrinter.getHTML(document.documentElement)+"\n"+lines.join("");
+}

http://git-wip-us.apache.org/repos/asf/incubator-corinthia/blob/0633908a/experiments/editorFramework/test/Layer0/autocorrect/acceptCorrection-undo-expected.html
----------------------------------------------------------------------
diff --git a/experiments/editorFramework/test/Layer0/autocorrect/acceptCorrection-undo-expected.html b/experiments/editorFramework/test/Layer0/autocorrect/acceptCorrection-undo-expected.html
new file mode 100644
index 0000000..3399e01
--- /dev/null
+++ b/experiments/editorFramework/test/Layer0/autocorrect/acceptCorrection-undo-expected.html
@@ -0,0 +1,50 @@
+<html>
+  <head>
+  </head>
+  <body>
+    ==================== Version 0 ====================
+    <body>
+      <p>
+        one
+        <span class="uxwrite-autocorrect" original="twox">two</span>
+        three
+        <span class="uxwrite-autocorrect" original="fourx">four</span>
+        five
+        <span class="uxwrite-autocorrect" original="sixx">six</span>
+        seven[]
+      </p>
+    </body>
+    ==================== Version 1 ====================
+    <body>
+      <p>
+        one
+        <span class="uxwrite-autocorrect" original="twox">two</span>
+        three
+        <span class="uxwrite-autocorrect" original="fourx">four</span>
+        five six seven[]
+      </p>
+    </body>
+    ==================== Version 2 ====================
+    <body>
+      <p>
+        one
+        <span class="uxwrite-autocorrect" original="twox">two</span>
+        three four five six seven[]
+      </p>
+    </body>
+    ==================== Version 3 ====================
+    <body>
+      <p>one two three four five six seven[]</p>
+    </body>
+    ===================================================
+    First undo to version 2: OK
+    First undo to version 1: OK
+    First undo to version 0: OK
+    Redo to version 1: OK
+    Redo to version 2: OK
+    Redo to version 3: OK
+    Second undo to version 2: OK
+    Second undo to version 1: OK
+    Second undo to version 0: OK
+  </body>
+</html>

http://git-wip-us.apache.org/repos/asf/incubator-corinthia/blob/0633908a/experiments/editorFramework/test/Layer0/autocorrect/acceptCorrection-undo-input.html
----------------------------------------------------------------------
diff --git a/experiments/editorFramework/test/Layer0/autocorrect/acceptCorrection-undo-input.html b/experiments/editorFramework/test/Layer0/autocorrect/acceptCorrection-undo-input.html
new file mode 100644
index 0000000..a0a703a
--- /dev/null
+++ b/experiments/editorFramework/test/Layer0/autocorrect/acceptCorrection-undo-input.html
@@ -0,0 +1,42 @@
+<!DOCTYPE html>
+<html>
+<head>
+<script src="AutoCorrectTests.js"></script>
+<script src="../undo/UndoTests.js"></script>
+<script>
+function performTest()
+{
+    Outline_init();
+    AutoCorrect_init();
+    PostponedActions_perform();
+
+    Cursor_insertCharacter("one");
+    Cursor_insertCharacter(" twox");
+    AutoCorrect_correctPrecedingWord(4,"two");
+    Cursor_insertCharacter(" three");
+    Cursor_insertCharacter(" fourx");
+    AutoCorrect_correctPrecedingWord(5,"four");
+    Cursor_insertCharacter(" five");
+    Cursor_insertCharacter(" sixx");
+    AutoCorrect_correctPrecedingWord(4,"six");
+    Cursor_insertCharacter(" seven");
+    PostponedActions_perform();
+    showSelection();
+
+    UndoManager_clear();
+    var versions = new Array();
+    versions.push(DOM_cloneNode(document.body,true));
+    for (var i = 0; i < 3; i++) {
+        AutoCorrect_acceptCorrection();
+        PostponedActions_perform();
+        versions.push(DOM_cloneNode(document.body,true));
+    }
+
+    testUndo(versions,document.body);
+}
+</script>
+</head>
+<body>
+<p>[]</p>
+</body>
+</html>

http://git-wip-us.apache.org/repos/asf/incubator-corinthia/blob/0633908a/experiments/editorFramework/test/Layer0/autocorrect/acceptCorrection01-expected.html
----------------------------------------------------------------------
diff --git a/experiments/editorFramework/test/Layer0/autocorrect/acceptCorrection01-expected.html b/experiments/editorFramework/test/Layer0/autocorrect/acceptCorrection01-expected.html
new file mode 100644
index 0000000..5311c9e
--- /dev/null
+++ b/experiments/editorFramework/test/Layer0/autocorrect/acceptCorrection01-expected.html
@@ -0,0 +1,14 @@
+<html>
+  <head>
+  </head>
+  <body>
+    <p>
+      one
+      <span class="uxwrite-autocorrect" original="twox">two</span>
+      three four five[]
+    </p>
+  </body>
+</html>
+
+Corrections:
+    twox -> two

http://git-wip-us.apache.org/repos/asf/incubator-corinthia/blob/0633908a/experiments/editorFramework/test/Layer0/autocorrect/acceptCorrection01-input.html
----------------------------------------------------------------------
diff --git a/experiments/editorFramework/test/Layer0/autocorrect/acceptCorrection01-input.html b/experiments/editorFramework/test/Layer0/autocorrect/acceptCorrection01-input.html
new file mode 100644
index 0000000..1fc0ff4
--- /dev/null
+++ b/experiments/editorFramework/test/Layer0/autocorrect/acceptCorrection01-input.html
@@ -0,0 +1,32 @@
+<!DOCTYPE html>
+<html>
+<head>
+<script src="AutoCorrectTests.js"></script>
+<script>
+function performTest()
+{
+    Outline_init();
+    AutoCorrect_init();
+    PostponedActions_perform();
+
+    Cursor_insertCharacter("one");
+    Cursor_insertCharacter(" twox");
+    AutoCorrect_correctPrecedingWord(4,"two");
+    Cursor_insertCharacter(" three");
+    Cursor_insertCharacter(" fourx");
+    AutoCorrect_correctPrecedingWord(5,"four");
+    Cursor_insertCharacter(" five");
+    PostponedActions_perform();
+    showSelection();
+
+    AutoCorrect_acceptCorrection();
+    PostponedActions_perform();
+
+    return showCorrections();
+}
+</script>
+</head>
+<body>
+<p>[]</p>
+</body>
+</html>

http://git-wip-us.apache.org/repos/asf/incubator-corinthia/blob/0633908a/experiments/editorFramework/test/Layer0/autocorrect/acceptCorrection02-expected.html
----------------------------------------------------------------------
diff --git a/experiments/editorFramework/test/Layer0/autocorrect/acceptCorrection02-expected.html b/experiments/editorFramework/test/Layer0/autocorrect/acceptCorrection02-expected.html
new file mode 100644
index 0000000..2257b03
--- /dev/null
+++ b/experiments/editorFramework/test/Layer0/autocorrect/acceptCorrection02-expected.html
@@ -0,0 +1,9 @@
+<html>
+  <head>
+  </head>
+  <body>
+    <p>one two three four five[]</p>
+  </body>
+</html>
+
+Corrections:

http://git-wip-us.apache.org/repos/asf/incubator-corinthia/blob/0633908a/experiments/editorFramework/test/Layer0/autocorrect/acceptCorrection02-input.html
----------------------------------------------------------------------
diff --git a/experiments/editorFramework/test/Layer0/autocorrect/acceptCorrection02-input.html b/experiments/editorFramework/test/Layer0/autocorrect/acceptCorrection02-input.html
new file mode 100644
index 0000000..96e9be0
--- /dev/null
+++ b/experiments/editorFramework/test/Layer0/autocorrect/acceptCorrection02-input.html
@@ -0,0 +1,33 @@
+<!DOCTYPE html>
+<html>
+<head>
+<script src="AutoCorrectTests.js"></script>
+<script>
+function performTest()
+{
+    Outline_init();
+    AutoCorrect_init();
+    PostponedActions_perform();
+
+    Cursor_insertCharacter("one");
+    Cursor_insertCharacter(" twox");
+    AutoCorrect_correctPrecedingWord(4,"two");
+    Cursor_insertCharacter(" three");
+    Cursor_insertCharacter(" fourx");
+    AutoCorrect_correctPrecedingWord(5,"four");
+    Cursor_insertCharacter(" five");
+    PostponedActions_perform();
+    showSelection();
+
+    AutoCorrect_acceptCorrection();
+    AutoCorrect_acceptCorrection();
+    PostponedActions_perform();
+
+    return showCorrections();
+}
+</script>
+</head>
+<body>
+<p>[]</p>
+</body>
+</html>

http://git-wip-us.apache.org/repos/asf/incubator-corinthia/blob/0633908a/experiments/editorFramework/test/Layer0/autocorrect/acceptCorrection03-expected.html
----------------------------------------------------------------------
diff --git a/experiments/editorFramework/test/Layer0/autocorrect/acceptCorrection03-expected.html b/experiments/editorFramework/test/Layer0/autocorrect/acceptCorrection03-expected.html
new file mode 100644
index 0000000..b1afd1f
--- /dev/null
+++ b/experiments/editorFramework/test/Layer0/autocorrect/acceptCorrection03-expected.html
@@ -0,0 +1,17 @@
+<html>
+  <head>
+  </head>
+  <body>
+    <p>
+      one two three
+      <span class="uxwrite-autocorrect" original="fourx">four</span>
+      five
+      <span class="uxwrite-autocorrect" original="sixx">six</span>
+      seven[]
+    </p>
+  </body>
+</html>
+
+Corrections:
+    fourx -> four
+    sixx -> six

http://git-wip-us.apache.org/repos/asf/incubator-corinthia/blob/0633908a/experiments/editorFramework/test/Layer0/autocorrect/acceptCorrection03-input.html
----------------------------------------------------------------------
diff --git a/experiments/editorFramework/test/Layer0/autocorrect/acceptCorrection03-input.html b/experiments/editorFramework/test/Layer0/autocorrect/acceptCorrection03-input.html
new file mode 100644
index 0000000..dc26563
--- /dev/null
+++ b/experiments/editorFramework/test/Layer0/autocorrect/acceptCorrection03-input.html
@@ -0,0 +1,38 @@
+<!DOCTYPE html>
+<html>
+<head>
+<script src="AutoCorrectTests.js"></script>
+<script>
+function performTest()
+{
+    Outline_init();
+    AutoCorrect_init();
+    PostponedActions_perform();
+
+    Cursor_insertCharacter("one");
+    Cursor_insertCharacter(" twox");
+    AutoCorrect_correctPrecedingWord(4,"two");
+    Cursor_insertCharacter(" three");
+    Cursor_insertCharacter(" fourx");
+    AutoCorrect_correctPrecedingWord(5,"four");
+    Cursor_insertCharacter(" five");
+    Cursor_insertCharacter(" sixx");
+    AutoCorrect_correctPrecedingWord(4,"six");
+    Cursor_insertCharacter(" seven");
+    PostponedActions_perform();
+    showSelection();
+
+    var text = findTextMatching("two");
+    Selection_set(text,0,text,0);
+
+    AutoCorrect_acceptCorrection();
+    PostponedActions_perform();
+
+    return showCorrections();
+}
+</script>
+</head>
+<body>
+<p>[]</p>
+</body>
+</html>

http://git-wip-us.apache.org/repos/asf/incubator-corinthia/blob/0633908a/experiments/editorFramework/test/Layer0/autocorrect/acceptCorrection04-expected.html
----------------------------------------------------------------------
diff --git a/experiments/editorFramework/test/Layer0/autocorrect/acceptCorrection04-expected.html b/experiments/editorFramework/test/Layer0/autocorrect/acceptCorrection04-expected.html
new file mode 100644
index 0000000..9671757
--- /dev/null
+++ b/experiments/editorFramework/test/Layer0/autocorrect/acceptCorrection04-expected.html
@@ -0,0 +1,17 @@
+<html>
+  <head>
+  </head>
+  <body>
+    <p>
+      one
+      <span class="uxwrite-autocorrect" original="twox">two</span>
+      three four five
+      <span class="uxwrite-autocorrect" original="sixx">six</span>
+      seven[]
+    </p>
+  </body>
+</html>
+
+Corrections:
+    twox -> two
+    sixx -> six

http://git-wip-us.apache.org/repos/asf/incubator-corinthia/blob/0633908a/experiments/editorFramework/test/Layer0/autocorrect/acceptCorrection04-input.html
----------------------------------------------------------------------
diff --git a/experiments/editorFramework/test/Layer0/autocorrect/acceptCorrection04-input.html b/experiments/editorFramework/test/Layer0/autocorrect/acceptCorrection04-input.html
new file mode 100644
index 0000000..8de93eb
--- /dev/null
+++ b/experiments/editorFramework/test/Layer0/autocorrect/acceptCorrection04-input.html
@@ -0,0 +1,38 @@
+<!DOCTYPE html>
+<html>
+<head>
+<script src="AutoCorrectTests.js"></script>
+<script>
+function performTest()
+{
+    Outline_init();
+    AutoCorrect_init();
+    PostponedActions_perform();
+
+    Cursor_insertCharacter("one");
+    Cursor_insertCharacter(" twox");
+    AutoCorrect_correctPrecedingWord(4,"two");
+    Cursor_insertCharacter(" three");
+    Cursor_insertCharacter(" fourx");
+    AutoCorrect_correctPrecedingWord(5,"four");
+    Cursor_insertCharacter(" five");
+    Cursor_insertCharacter(" sixx");
+    AutoCorrect_correctPrecedingWord(4,"six");
+    Cursor_insertCharacter(" seven");
+    PostponedActions_perform();
+    showSelection();
+
+    var text = findTextMatching("four");
+    Selection_set(text,0,text,0);
+
+    AutoCorrect_acceptCorrection();
+    PostponedActions_perform();
+
+    return showCorrections();
+}
+</script>
+</head>
+<body>
+<p>[]</p>
+</body>
+</html>

http://git-wip-us.apache.org/repos/asf/incubator-corinthia/blob/0633908a/experiments/editorFramework/test/Layer0/autocorrect/acceptCorrection05-expected.html
----------------------------------------------------------------------
diff --git a/experiments/editorFramework/test/Layer0/autocorrect/acceptCorrection05-expected.html b/experiments/editorFramework/test/Layer0/autocorrect/acceptCorrection05-expected.html
new file mode 100644
index 0000000..00fdf45
--- /dev/null
+++ b/experiments/editorFramework/test/Layer0/autocorrect/acceptCorrection05-expected.html
@@ -0,0 +1,17 @@
+<html>
+  <head>
+  </head>
+  <body>
+    <p>
+      one
+      <span class="uxwrite-autocorrect" original="twox">two</span>
+      three
+      <span class="uxwrite-autocorrect" original="fourx">four</span>
+      five six seven[]
+    </p>
+  </body>
+</html>
+
+Corrections:
+    twox -> two
+    fourx -> four

http://git-wip-us.apache.org/repos/asf/incubator-corinthia/blob/0633908a/experiments/editorFramework/test/Layer0/autocorrect/acceptCorrection05-input.html
----------------------------------------------------------------------
diff --git a/experiments/editorFramework/test/Layer0/autocorrect/acceptCorrection05-input.html b/experiments/editorFramework/test/Layer0/autocorrect/acceptCorrection05-input.html
new file mode 100644
index 0000000..6e724b7
--- /dev/null
+++ b/experiments/editorFramework/test/Layer0/autocorrect/acceptCorrection05-input.html
@@ -0,0 +1,38 @@
+<!DOCTYPE html>
+<html>
+<head>
+<script src="AutoCorrectTests.js"></script>
+<script>
+function performTest()
+{
+    Outline_init();
+    AutoCorrect_init();
+    PostponedActions_perform();
+
+    Cursor_insertCharacter("one");
+    Cursor_insertCharacter(" twox");
+    AutoCorrect_correctPrecedingWord(4,"two");
+    Cursor_insertCharacter(" three");
+    Cursor_insertCharacter(" fourx");
+    AutoCorrect_correctPrecedingWord(5,"four");
+    Cursor_insertCharacter(" five");
+    Cursor_insertCharacter(" sixx");
+    AutoCorrect_correctPrecedingWord(4,"six");
+    Cursor_insertCharacter(" seven");
+    PostponedActions_perform();
+    showSelection();
+
+    var text = findTextMatching("six");
+    Selection_set(text,0,text,0);
+
+    AutoCorrect_acceptCorrection();
+    PostponedActions_perform();
+
+    return showCorrections();
+}
+</script>
+</head>
+<body>
+<p>[]</p>
+</body>
+</html>

http://git-wip-us.apache.org/repos/asf/incubator-corinthia/blob/0633908a/experiments/editorFramework/test/Layer0/autocorrect/changeCorrection01-expected.html
----------------------------------------------------------------------
diff --git a/experiments/editorFramework/test/Layer0/autocorrect/changeCorrection01-expected.html b/experiments/editorFramework/test/Layer0/autocorrect/changeCorrection01-expected.html
new file mode 100644
index 0000000..9d04b6a
--- /dev/null
+++ b/experiments/editorFramework/test/Layer0/autocorrect/changeCorrection01-expected.html
@@ -0,0 +1,14 @@
+<html>
+  <head>
+  </head>
+  <body>
+    <p>
+      one a three
+      <span class="uxwrite-autocorrect" original="fourx">four</span>
+      five[]
+    </p>
+  </body>
+</html>
+
+Corrections:
+    fourx -> four

http://git-wip-us.apache.org/repos/asf/incubator-corinthia/blob/0633908a/experiments/editorFramework/test/Layer0/autocorrect/changeCorrection01-input.html
----------------------------------------------------------------------
diff --git a/experiments/editorFramework/test/Layer0/autocorrect/changeCorrection01-input.html b/experiments/editorFramework/test/Layer0/autocorrect/changeCorrection01-input.html
new file mode 100644
index 0000000..45e7519
--- /dev/null
+++ b/experiments/editorFramework/test/Layer0/autocorrect/changeCorrection01-input.html
@@ -0,0 +1,33 @@
+<!DOCTYPE html>
+<html>
+<head>
+<script src="AutoCorrectTests.js"></script>
+<script>
+function performTest()
+{
+    Outline_init();
+    AutoCorrect_init();
+    PostponedActions_perform();
+
+    Cursor_insertCharacter("one");
+    Cursor_insertCharacter(" twox");
+    AutoCorrect_correctPrecedingWord(4,"two");
+    Cursor_insertCharacter(" three");
+    Cursor_insertCharacter(" fourx");
+    AutoCorrect_correctPrecedingWord(5,"four");
+    Cursor_insertCharacter(" five");
+    PostponedActions_perform();
+    showSelection();
+
+    var text = findTextMatching(/two/);
+    text.nodeValue = "a";
+    PostponedActions_perform();
+
+    return showCorrections();
+}
+</script>
+</head>
+<body>
+<p>[]</p>
+</body>
+</html>

http://git-wip-us.apache.org/repos/asf/incubator-corinthia/blob/0633908a/experiments/editorFramework/test/Layer0/autocorrect/changeCorrection02-expected.html
----------------------------------------------------------------------
diff --git a/experiments/editorFramework/test/Layer0/autocorrect/changeCorrection02-expected.html b/experiments/editorFramework/test/Layer0/autocorrect/changeCorrection02-expected.html
new file mode 100644
index 0000000..717beb5
--- /dev/null
+++ b/experiments/editorFramework/test/Layer0/autocorrect/changeCorrection02-expected.html
@@ -0,0 +1,14 @@
+<html>
+  <head>
+  </head>
+  <body>
+    <p>
+      one
+      <span class="uxwrite-autocorrect" original="twox">two</span>
+      three a five[]
+    </p>
+  </body>
+</html>
+
+Corrections:
+    twox -> two

http://git-wip-us.apache.org/repos/asf/incubator-corinthia/blob/0633908a/experiments/editorFramework/test/Layer0/autocorrect/changeCorrection02-input.html
----------------------------------------------------------------------
diff --git a/experiments/editorFramework/test/Layer0/autocorrect/changeCorrection02-input.html b/experiments/editorFramework/test/Layer0/autocorrect/changeCorrection02-input.html
new file mode 100644
index 0000000..d3b1943
--- /dev/null
+++ b/experiments/editorFramework/test/Layer0/autocorrect/changeCorrection02-input.html
@@ -0,0 +1,33 @@
+<!DOCTYPE html>
+<html>
+<head>
+<script src="AutoCorrectTests.js"></script>
+<script>
+function performTest()
+{
+    Outline_init();
+    AutoCorrect_init();
+    PostponedActions_perform();
+
+    Cursor_insertCharacter("one");
+    Cursor_insertCharacter(" twox");
+    AutoCorrect_correctPrecedingWord(4,"two");
+    Cursor_insertCharacter(" three");
+    Cursor_insertCharacter(" fourx");
+    AutoCorrect_correctPrecedingWord(5,"four");
+    Cursor_insertCharacter(" five");
+    PostponedActions_perform();
+    showSelection();
+
+    var text = findTextMatching(/four/);
+    text.nodeValue = "a";
+    PostponedActions_perform();
+
+    return showCorrections();
+}
+</script>
+</head>
+<body>
+<p>[]</p>
+</body>
+</html>

http://git-wip-us.apache.org/repos/asf/incubator-corinthia/blob/0633908a/experiments/editorFramework/test/Layer0/autocorrect/correctPrecedingWord01-expected.html
----------------------------------------------------------------------
diff --git a/experiments/editorFramework/test/Layer0/autocorrect/correctPrecedingWord01-expected.html b/experiments/editorFramework/test/Layer0/autocorrect/correctPrecedingWord01-expected.html
new file mode 100644
index 0000000..f8ac7aa
--- /dev/null
+++ b/experiments/editorFramework/test/Layer0/autocorrect/correctPrecedingWord01-expected.html
@@ -0,0 +1,17 @@
+<html>
+  <head>
+  </head>
+  <body>
+    <p>
+      one
+      <span class="uxwrite-autocorrect" original="twox">two</span>
+      three
+      <span class="uxwrite-autocorrect" original="fourx">four</span>
+      five[]
+    </p>
+  </body>
+</html>
+
+Corrections:
+    twox -> two
+    fourx -> four

http://git-wip-us.apache.org/repos/asf/incubator-corinthia/blob/0633908a/experiments/editorFramework/test/Layer0/autocorrect/correctPrecedingWord01-input.html
----------------------------------------------------------------------
diff --git a/experiments/editorFramework/test/Layer0/autocorrect/correctPrecedingWord01-input.html b/experiments/editorFramework/test/Layer0/autocorrect/correctPrecedingWord01-input.html
new file mode 100644
index 0000000..7bb437e
--- /dev/null
+++ b/experiments/editorFramework/test/Layer0/autocorrect/correctPrecedingWord01-input.html
@@ -0,0 +1,29 @@
+<!DOCTYPE html>
+<html>
+<head>
+<script src="AutoCorrectTests.js"></script>
+<script>
+function performTest()
+{
+    Outline_init();
+    AutoCorrect_init();
+    PostponedActions_perform();
+
+    Cursor_insertCharacter("one");
+    Cursor_insertCharacter(" twox");
+    AutoCorrect_correctPrecedingWord(4,"two");
+    Cursor_insertCharacter(" three");
+    Cursor_insertCharacter(" fourx");
+    AutoCorrect_correctPrecedingWord(5,"four");
+    Cursor_insertCharacter(" five");
+    PostponedActions_perform();
+    showSelection();
+
+    return showCorrections();
+}
+</script>
+</head>
+<body>
+<p>[]</p>
+</body>
+</html>

http://git-wip-us.apache.org/repos/asf/incubator-corinthia/blob/0633908a/experiments/editorFramework/test/Layer0/autocorrect/removeCorrection01-expected.html
----------------------------------------------------------------------
diff --git a/experiments/editorFramework/test/Layer0/autocorrect/removeCorrection01-expected.html b/experiments/editorFramework/test/Layer0/autocorrect/removeCorrection01-expected.html
new file mode 100644
index 0000000..00dd985
--- /dev/null
+++ b/experiments/editorFramework/test/Layer0/autocorrect/removeCorrection01-expected.html
@@ -0,0 +1,15 @@
+<html>
+  <head>
+  </head>
+  <body>
+    <p>
+      one
+      three
+      <span class="uxwrite-autocorrect" original="fourx">four</span>
+      five[]
+    </p>
+  </body>
+</html>
+
+Corrections:
+    fourx -> four

http://git-wip-us.apache.org/repos/asf/incubator-corinthia/blob/0633908a/experiments/editorFramework/test/Layer0/autocorrect/removeCorrection01-input.html
----------------------------------------------------------------------
diff --git a/experiments/editorFramework/test/Layer0/autocorrect/removeCorrection01-input.html b/experiments/editorFramework/test/Layer0/autocorrect/removeCorrection01-input.html
new file mode 100644
index 0000000..929d768
--- /dev/null
+++ b/experiments/editorFramework/test/Layer0/autocorrect/removeCorrection01-input.html
@@ -0,0 +1,33 @@
+<!DOCTYPE html>
+<html>
+<head>
+<script src="AutoCorrectTests.js"></script>
+<script>
+function performTest()
+{
+    Outline_init();
+    AutoCorrect_init();
+    PostponedActions_perform();
+
+    Cursor_insertCharacter("one");
+    Cursor_insertCharacter(" twox");
+    AutoCorrect_correctPrecedingWord(4,"two");
+    Cursor_insertCharacter(" three");
+    Cursor_insertCharacter(" fourx");
+    AutoCorrect_correctPrecedingWord(5,"four");
+    Cursor_insertCharacter(" five");
+    PostponedActions_perform();
+    showSelection();
+
+    var text = findTextMatching(/two/);
+    DOM_deleteNode(text.parentNode);
+    PostponedActions_perform();
+
+    return showCorrections();
+}
+</script>
+</head>
+<body>
+<p>[]</p>
+</body>
+</html>

http://git-wip-us.apache.org/repos/asf/incubator-corinthia/blob/0633908a/experiments/editorFramework/test/Layer0/autocorrect/removeCorrection02-expected.html
----------------------------------------------------------------------
diff --git a/experiments/editorFramework/test/Layer0/autocorrect/removeCorrection02-expected.html b/experiments/editorFramework/test/Layer0/autocorrect/removeCorrection02-expected.html
new file mode 100644
index 0000000..350dd7d
--- /dev/null
+++ b/experiments/editorFramework/test/Layer0/autocorrect/removeCorrection02-expected.html
@@ -0,0 +1,15 @@
+<html>
+  <head>
+  </head>
+  <body>
+    <p>
+      one
+      <span class="uxwrite-autocorrect" original="twox">two</span>
+      three
+      five[]
+    </p>
+  </body>
+</html>
+
+Corrections:
+    twox -> two

http://git-wip-us.apache.org/repos/asf/incubator-corinthia/blob/0633908a/experiments/editorFramework/test/Layer0/autocorrect/removeCorrection02-input.html
----------------------------------------------------------------------
diff --git a/experiments/editorFramework/test/Layer0/autocorrect/removeCorrection02-input.html b/experiments/editorFramework/test/Layer0/autocorrect/removeCorrection02-input.html
new file mode 100644
index 0000000..59ce3db
--- /dev/null
+++ b/experiments/editorFramework/test/Layer0/autocorrect/removeCorrection02-input.html
@@ -0,0 +1,33 @@
+<!DOCTYPE html>
+<html>
+<head>
+<script src="AutoCorrectTests.js"></script>
+<script>
+function performTest()
+{
+    Outline_init();
+    AutoCorrect_init();
+    PostponedActions_perform();
+
+    Cursor_insertCharacter("one");
+    Cursor_insertCharacter(" twox");
+    AutoCorrect_correctPrecedingWord(4,"two");
+    Cursor_insertCharacter(" three");
+    Cursor_insertCharacter(" fourx");
+    AutoCorrect_correctPrecedingWord(5,"four");
+    Cursor_insertCharacter(" five");
+    PostponedActions_perform();
+    showSelection();
+
+    var text = findTextMatching(/four/);
+    DOM_deleteNode(text.parentNode);
+    PostponedActions_perform();
+
+    return showCorrections();
+}
+</script>
+</head>
+<body>
+<p>[]</p>
+</body>
+</html>

http://git-wip-us.apache.org/repos/asf/incubator-corinthia/blob/0633908a/experiments/editorFramework/test/Layer0/autocorrect/removedSpan01-expected.html
----------------------------------------------------------------------
diff --git a/experiments/editorFramework/test/Layer0/autocorrect/removedSpan01-expected.html b/experiments/editorFramework/test/Layer0/autocorrect/removedSpan01-expected.html
new file mode 100644
index 0000000..f56d240
--- /dev/null
+++ b/experiments/editorFramework/test/Layer0/autocorrect/removedSpan01-expected.html
@@ -0,0 +1,11 @@
+<html>
+  <head>
+  </head>
+  <body>
+    <p>the</p>
+    <p>
+      []
+      <br/>
+    </p>
+  </body>
+</html>

http://git-wip-us.apache.org/repos/asf/incubator-corinthia/blob/0633908a/experiments/editorFramework/test/Layer0/autocorrect/removedSpan01-input.html
----------------------------------------------------------------------
diff --git a/experiments/editorFramework/test/Layer0/autocorrect/removedSpan01-input.html b/experiments/editorFramework/test/Layer0/autocorrect/removedSpan01-input.html
new file mode 100644
index 0000000..4ce93b7
--- /dev/null
+++ b/experiments/editorFramework/test/Layer0/autocorrect/removedSpan01-input.html
@@ -0,0 +1,26 @@
+<!DOCTYPE html>
+<html>
+<head>
+<script src="AutoCorrectTests.js"></script>
+<script>
+function performTest()
+{
+    Outline_init();
+    AutoCorrect_init();
+    PostponedActions_perform();
+
+    Cursor_insertCharacter("teh");
+    AutoCorrect_correctPrecedingWord(3,"the");
+    Cursor_insertCharacter(" ");
+    PostponedActions_perform();
+    Cursor_deleteCharacter();
+    Cursor_enterPressed();
+    PostponedActions_perform();
+    showSelection();
+}
+</script>
+</head>
+<body>
+[]
+</body>
+</html>

http://git-wip-us.apache.org/repos/asf/incubator-corinthia/blob/0633908a/experiments/editorFramework/test/Layer0/autocorrect/removedSpan02-expected.html
----------------------------------------------------------------------
diff --git a/experiments/editorFramework/test/Layer0/autocorrect/removedSpan02-expected.html b/experiments/editorFramework/test/Layer0/autocorrect/removedSpan02-expected.html
new file mode 100644
index 0000000..1815348
--- /dev/null
+++ b/experiments/editorFramework/test/Layer0/autocorrect/removedSpan02-expected.html
@@ -0,0 +1,7 @@
+<html>
+  <head>
+  </head>
+  <body>
+    <p>th[]</p>
+  </body>
+</html>

http://git-wip-us.apache.org/repos/asf/incubator-corinthia/blob/0633908a/experiments/editorFramework/test/Layer0/autocorrect/removedSpan02-input.html
----------------------------------------------------------------------
diff --git a/experiments/editorFramework/test/Layer0/autocorrect/removedSpan02-input.html b/experiments/editorFramework/test/Layer0/autocorrect/removedSpan02-input.html
new file mode 100644
index 0000000..9870e03
--- /dev/null
+++ b/experiments/editorFramework/test/Layer0/autocorrect/removedSpan02-input.html
@@ -0,0 +1,27 @@
+<!DOCTYPE html>
+<html>
+<head>
+<script src="AutoCorrectTests.js"></script>
+<script>
+function performTest()
+{
+    Outline_init();
+    AutoCorrect_init();
+    PostponedActions_perform();
+
+    Cursor_insertCharacter("teh");
+    AutoCorrect_correctPrecedingWord(3,"the");
+    Cursor_insertCharacter(" ");
+    PostponedActions_perform();
+    Cursor_deleteCharacter();
+    PostponedActions_perform();
+    Cursor_deleteCharacter();
+    PostponedActions_perform();
+    showSelection();
+}
+</script>
+</head>
+<body>
+[]
+</body>
+</html>

http://git-wip-us.apache.org/repos/asf/incubator-corinthia/blob/0633908a/experiments/editorFramework/test/Layer0/autocorrect/removedSpan03-expected.html
----------------------------------------------------------------------
diff --git a/experiments/editorFramework/test/Layer0/autocorrect/removedSpan03-expected.html b/experiments/editorFramework/test/Layer0/autocorrect/removedSpan03-expected.html
new file mode 100644
index 0000000..b0c230d
--- /dev/null
+++ b/experiments/editorFramework/test/Layer0/autocorrect/removedSpan03-expected.html
@@ -0,0 +1,7 @@
+<html>
+  <head>
+  </head>
+  <body>
+    <p>thex[]</p>
+  </body>
+</html>

http://git-wip-us.apache.org/repos/asf/incubator-corinthia/blob/0633908a/experiments/editorFramework/test/Layer0/autocorrect/removedSpan03-input.html
----------------------------------------------------------------------
diff --git a/experiments/editorFramework/test/Layer0/autocorrect/removedSpan03-input.html b/experiments/editorFramework/test/Layer0/autocorrect/removedSpan03-input.html
new file mode 100644
index 0000000..71bcc2c
--- /dev/null
+++ b/experiments/editorFramework/test/Layer0/autocorrect/removedSpan03-input.html
@@ -0,0 +1,27 @@
+<!DOCTYPE html>
+<html>
+<head>
+<script src="AutoCorrectTests.js"></script>
+<script>
+function performTest()
+{
+    Outline_init();
+    AutoCorrect_init();
+    PostponedActions_perform();
+
+    Cursor_insertCharacter("teh");
+    AutoCorrect_correctPrecedingWord(3,"the");
+    Cursor_insertCharacter(" ");
+    PostponedActions_perform();
+    Cursor_deleteCharacter();
+    PostponedActions_perform();
+    Cursor_insertCharacter("x");
+    PostponedActions_perform();
+    showSelection();
+}
+</script>
+</head>
+<body>
+[]
+</body>
+</html>

http://git-wip-us.apache.org/repos/asf/incubator-corinthia/blob/0633908a/experiments/editorFramework/test/Layer0/autocorrect/replaceCorrection-undo-expected.html
----------------------------------------------------------------------
diff --git a/experiments/editorFramework/test/Layer0/autocorrect/replaceCorrection-undo-expected.html b/experiments/editorFramework/test/Layer0/autocorrect/replaceCorrection-undo-expected.html
new file mode 100644
index 0000000..badefe7
--- /dev/null
+++ b/experiments/editorFramework/test/Layer0/autocorrect/replaceCorrection-undo-expected.html
@@ -0,0 +1,50 @@
+<html>
+  <head>
+  </head>
+  <body>
+    ==================== Version 0 ====================
+    <body>
+      <p>
+        one
+        <span class="uxwrite-autocorrect" original="twox">two</span>
+        three
+        <span class="uxwrite-autocorrect" original="fourx">four</span>
+        five
+        <span class="uxwrite-autocorrect" original="sixx">six</span>
+        seven[]
+      </p>
+    </body>
+    ==================== Version 1 ====================
+    <body>
+      <p>
+        one
+        <span class="uxwrite-autocorrect" original="twox">two</span>
+        three
+        <span class="uxwrite-autocorrect" original="fourx">four</span>
+        five r1 seven[]
+      </p>
+    </body>
+    ==================== Version 2 ====================
+    <body>
+      <p>
+        one
+        <span class="uxwrite-autocorrect" original="twox">two</span>
+        three r2 five r1 seven[]
+      </p>
+    </body>
+    ==================== Version 3 ====================
+    <body>
+      <p>one r3 three r2 five r1 seven[]</p>
+    </body>
+    ===================================================
+    First undo to version 2: OK
+    First undo to version 1: OK
+    First undo to version 0: OK
+    Redo to version 1: OK
+    Redo to version 2: OK
+    Redo to version 3: OK
+    Second undo to version 2: OK
+    Second undo to version 1: OK
+    Second undo to version 0: OK
+  </body>
+</html>

http://git-wip-us.apache.org/repos/asf/incubator-corinthia/blob/0633908a/experiments/editorFramework/test/Layer0/autocorrect/replaceCorrection-undo-input.html
----------------------------------------------------------------------
diff --git a/experiments/editorFramework/test/Layer0/autocorrect/replaceCorrection-undo-input.html b/experiments/editorFramework/test/Layer0/autocorrect/replaceCorrection-undo-input.html
new file mode 100644
index 0000000..e08e838
--- /dev/null
+++ b/experiments/editorFramework/test/Layer0/autocorrect/replaceCorrection-undo-input.html
@@ -0,0 +1,42 @@
+<!DOCTYPE html>
+<html>
+<head>
+<script src="AutoCorrectTests.js"></script>
+<script src="../undo/UndoTests.js"></script>
+<script>
+function performTest()
+{
+    Outline_init();
+    AutoCorrect_init();
+    PostponedActions_perform();
+
+    Cursor_insertCharacter("one");
+    Cursor_insertCharacter(" twox");
+    AutoCorrect_correctPrecedingWord(4,"two");
+    Cursor_insertCharacter(" three");
+    Cursor_insertCharacter(" fourx");
+    AutoCorrect_correctPrecedingWord(5,"four");
+    Cursor_insertCharacter(" five");
+    Cursor_insertCharacter(" sixx");
+    AutoCorrect_correctPrecedingWord(4,"six");
+    Cursor_insertCharacter(" seven");
+    PostponedActions_perform();
+    showSelection();
+
+    UndoManager_clear();
+    var versions = new Array();
+    versions.push(DOM_cloneNode(document.body,true));
+    for (var i = 0; i < 3; i++) {
+        AutoCorrect_replaceCorrection("r"+(i+1));
+        PostponedActions_perform();
+        versions.push(DOM_cloneNode(document.body,true));
+    }
+
+    testUndo(versions,document.body);
+}
+</script>
+</head>
+<body>
+<p>[]</p>
+</body>
+</html>

http://git-wip-us.apache.org/repos/asf/incubator-corinthia/blob/0633908a/experiments/editorFramework/test/Layer0/autocorrect/replaceCorrection01-expected.html
----------------------------------------------------------------------
diff --git a/experiments/editorFramework/test/Layer0/autocorrect/replaceCorrection01-expected.html b/experiments/editorFramework/test/Layer0/autocorrect/replaceCorrection01-expected.html
new file mode 100644
index 0000000..c253fcd
--- /dev/null
+++ b/experiments/editorFramework/test/Layer0/autocorrect/replaceCorrection01-expected.html
@@ -0,0 +1,14 @@
+<html>
+  <head>
+  </head>
+  <body>
+    <p>
+      one
+      <span class="uxwrite-autocorrect" original="twox">two</span>
+      three A five[]
+    </p>
+  </body>
+</html>
+
+Corrections:
+    twox -> two

http://git-wip-us.apache.org/repos/asf/incubator-corinthia/blob/0633908a/experiments/editorFramework/test/Layer0/autocorrect/replaceCorrection01-input.html
----------------------------------------------------------------------
diff --git a/experiments/editorFramework/test/Layer0/autocorrect/replaceCorrection01-input.html b/experiments/editorFramework/test/Layer0/autocorrect/replaceCorrection01-input.html
new file mode 100644
index 0000000..04574d8
--- /dev/null
+++ b/experiments/editorFramework/test/Layer0/autocorrect/replaceCorrection01-input.html
@@ -0,0 +1,32 @@
+<!DOCTYPE html>
+<html>
+<head>
+<script src="AutoCorrectTests.js"></script>
+<script>
+function performTest()
+{
+    Outline_init();
+    AutoCorrect_init();
+    PostponedActions_perform();
+
+    Cursor_insertCharacter("one");
+    Cursor_insertCharacter(" twox");
+    AutoCorrect_correctPrecedingWord(4,"two");
+    Cursor_insertCharacter(" three");
+    Cursor_insertCharacter(" fourx");
+    AutoCorrect_correctPrecedingWord(5,"four");
+    Cursor_insertCharacter(" five");
+    PostponedActions_perform();
+    showSelection();
+
+    AutoCorrect_replaceCorrection("A");
+    PostponedActions_perform();
+
+    return showCorrections();
+}
+</script>
+</head>
+<body>
+<p>[]</p>
+</body>
+</html>

http://git-wip-us.apache.org/repos/asf/incubator-corinthia/blob/0633908a/experiments/editorFramework/test/Layer0/autocorrect/replaceCorrection02-expected.html
----------------------------------------------------------------------
diff --git a/experiments/editorFramework/test/Layer0/autocorrect/replaceCorrection02-expected.html b/experiments/editorFramework/test/Layer0/autocorrect/replaceCorrection02-expected.html
new file mode 100644
index 0000000..659ad6f
--- /dev/null
+++ b/experiments/editorFramework/test/Layer0/autocorrect/replaceCorrection02-expected.html
@@ -0,0 +1,9 @@
+<html>
+  <head>
+  </head>
+  <body>
+    <p>one B three A five[]</p>
+  </body>
+</html>
+
+Corrections:

http://git-wip-us.apache.org/repos/asf/incubator-corinthia/blob/0633908a/experiments/editorFramework/test/Layer0/autocorrect/replaceCorrection02-input.html
----------------------------------------------------------------------
diff --git a/experiments/editorFramework/test/Layer0/autocorrect/replaceCorrection02-input.html b/experiments/editorFramework/test/Layer0/autocorrect/replaceCorrection02-input.html
new file mode 100644
index 0000000..d6fb6d0
--- /dev/null
+++ b/experiments/editorFramework/test/Layer0/autocorrect/replaceCorrection02-input.html
@@ -0,0 +1,33 @@
+<!DOCTYPE html>
+<html>
+<head>
+<script src="AutoCorrectTests.js"></script>
+<script>
+function performTest()
+{
+    Outline_init();
+    AutoCorrect_init();
+    PostponedActions_perform();
+
+    Cursor_insertCharacter("one");
+    Cursor_insertCharacter(" twox");
+    AutoCorrect_correctPrecedingWord(4,"two");
+    Cursor_insertCharacter(" three");
+    Cursor_insertCharacter(" fourx");
+    AutoCorrect_correctPrecedingWord(5,"four");
+    Cursor_insertCharacter(" five");
+    PostponedActions_perform();
+    showSelection();
+
+    AutoCorrect_replaceCorrection("A");
+    AutoCorrect_replaceCorrection("B");
+    PostponedActions_perform();
+
+    return showCorrections();
+}
+</script>
+</head>
+<body>
+<p>[]</p>
+</body>
+</html>

http://git-wip-us.apache.org/repos/asf/incubator-corinthia/blob/0633908a/experiments/editorFramework/test/Layer0/autocorrect/replaceCorrection03-expected.html
----------------------------------------------------------------------
diff --git a/experiments/editorFramework/test/Layer0/autocorrect/replaceCorrection03-expected.html b/experiments/editorFramework/test/Layer0/autocorrect/replaceCorrection03-expected.html
new file mode 100644
index 0000000..024b644
--- /dev/null
+++ b/experiments/editorFramework/test/Layer0/autocorrect/replaceCorrection03-expected.html
@@ -0,0 +1,17 @@
+<html>
+  <head>
+  </head>
+  <body>
+    <p>
+      one A three
+      <span class="uxwrite-autocorrect" original="fourx">four</span>
+      five
+      <span class="uxwrite-autocorrect" original="sixx">six</span>
+      seven[]
+    </p>
+  </body>
+</html>
+
+Corrections:
+    fourx -> four
+    sixx -> six

http://git-wip-us.apache.org/repos/asf/incubator-corinthia/blob/0633908a/experiments/editorFramework/test/Layer0/autocorrect/replaceCorrection03-input.html
----------------------------------------------------------------------
diff --git a/experiments/editorFramework/test/Layer0/autocorrect/replaceCorrection03-input.html b/experiments/editorFramework/test/Layer0/autocorrect/replaceCorrection03-input.html
new file mode 100644
index 0000000..7e49201
--- /dev/null
+++ b/experiments/editorFramework/test/Layer0/autocorrect/replaceCorrection03-input.html
@@ -0,0 +1,38 @@
+<!DOCTYPE html>
+<html>
+<head>
+<script src="AutoCorrectTests.js"></script>
+<script>
+function performTest()
+{
+    Outline_init();
+    AutoCorrect_init();
+    PostponedActions_perform();
+
+    Cursor_insertCharacter("one");
+    Cursor_insertCharacter(" twox");
+    AutoCorrect_correctPrecedingWord(4,"two");
+    Cursor_insertCharacter(" three");
+    Cursor_insertCharacter(" fourx");
+    AutoCorrect_correctPrecedingWord(5,"four");
+    Cursor_insertCharacter(" five");
+    Cursor_insertCharacter(" sixx");
+    AutoCorrect_correctPrecedingWord(4,"six");
+    Cursor_insertCharacter(" seven");
+    PostponedActions_perform();
+    showSelection();
+
+    var text = findTextMatching("two");
+    Selection_set(text,0,text,0);
+
+    AutoCorrect_replaceCorrection("A");
+    PostponedActions_perform();
+
+    return showCorrections();
+}
+</script>
+</head>
+<body>
+<p>[]</p>
+</body>
+</html>

http://git-wip-us.apache.org/repos/asf/incubator-corinthia/blob/0633908a/experiments/editorFramework/test/Layer0/autocorrect/replaceCorrection04-expected.html
----------------------------------------------------------------------
diff --git a/experiments/editorFramework/test/Layer0/autocorrect/replaceCorrection04-expected.html b/experiments/editorFramework/test/Layer0/autocorrect/replaceCorrection04-expected.html
new file mode 100644
index 0000000..ebc4b54
--- /dev/null
+++ b/experiments/editorFramework/test/Layer0/autocorrect/replaceCorrection04-expected.html
@@ -0,0 +1,17 @@
+<html>
+  <head>
+  </head>
+  <body>
+    <p>
+      one
+      <span class="uxwrite-autocorrect" original="twox">two</span>
+      three A five
+      <span class="uxwrite-autocorrect" original="sixx">six</span>
+      seven[]
+    </p>
+  </body>
+</html>
+
+Corrections:
+    twox -> two
+    sixx -> six

http://git-wip-us.apache.org/repos/asf/incubator-corinthia/blob/0633908a/experiments/editorFramework/test/Layer0/autocorrect/replaceCorrection04-input.html
----------------------------------------------------------------------
diff --git a/experiments/editorFramework/test/Layer0/autocorrect/replaceCorrection04-input.html b/experiments/editorFramework/test/Layer0/autocorrect/replaceCorrection04-input.html
new file mode 100644
index 0000000..9a47a03
--- /dev/null
+++ b/experiments/editorFramework/test/Layer0/autocorrect/replaceCorrection04-input.html
@@ -0,0 +1,38 @@
+<!DOCTYPE html>
+<html>
+<head>
+<script src="AutoCorrectTests.js"></script>
+<script>
+function performTest()
+{
+    Outline_init();
+    AutoCorrect_init();
+    PostponedActions_perform();
+
+    Cursor_insertCharacter("one");
+    Cursor_insertCharacter(" twox");
+    AutoCorrect_correctPrecedingWord(4,"two");
+    Cursor_insertCharacter(" three");
+    Cursor_insertCharacter(" fourx");
+    AutoCorrect_correctPrecedingWord(5,"four");
+    Cursor_insertCharacter(" five");
+    Cursor_insertCharacter(" sixx");
+    AutoCorrect_correctPrecedingWord(4,"six");
+    Cursor_insertCharacter(" seven");
+    PostponedActions_perform();
+    showSelection();
+
+    var text = findTextMatching("four");
+    Selection_set(text,0,text,0);
+
+    AutoCorrect_replaceCorrection("A");
+    PostponedActions_perform();
+
+    return showCorrections();
+}
+</script>
+</head>
+<body>
+<p>[]</p>
+</body>
+</html>

http://git-wip-us.apache.org/repos/asf/incubator-corinthia/blob/0633908a/experiments/editorFramework/test/Layer0/autocorrect/replaceCorrection05-expected.html
----------------------------------------------------------------------
diff --git a/experiments/editorFramework/test/Layer0/autocorrect/replaceCorrection05-expected.html b/experiments/editorFramework/test/Layer0/autocorrect/replaceCorrection05-expected.html
new file mode 100644
index 0000000..5650843
--- /dev/null
+++ b/experiments/editorFramework/test/Layer0/autocorrect/replaceCorrection05-expected.html
@@ -0,0 +1,17 @@
+<html>
+  <head>
+  </head>
+  <body>
+    <p>
+      one
+      <span class="uxwrite-autocorrect" original="twox">two</span>
+      three
+      <span class="uxwrite-autocorrect" original="fourx">four</span>
+      five A seven[]
+    </p>
+  </body>
+</html>
+
+Corrections:
+    twox -> two
+    fourx -> four

http://git-wip-us.apache.org/repos/asf/incubator-corinthia/blob/0633908a/experiments/editorFramework/test/Layer0/autocorrect/replaceCorrection05-input.html
----------------------------------------------------------------------
diff --git a/experiments/editorFramework/test/Layer0/autocorrect/replaceCorrection05-input.html b/experiments/editorFramework/test/Layer0/autocorrect/replaceCorrection05-input.html
new file mode 100644
index 0000000..1d3b2ea
--- /dev/null
+++ b/experiments/editorFramework/test/Layer0/autocorrect/replaceCorrection05-input.html
@@ -0,0 +1,38 @@
+<!DOCTYPE html>
+<html>
+<head>
+<script src="AutoCorrectTests.js"></script>
+<script>
+function performTest()
+{
+    Outline_init();
+    AutoCorrect_init();
+    PostponedActions_perform();
+
+    Cursor_insertCharacter("one");
+    Cursor_insertCharacter(" twox");
+    AutoCorrect_correctPrecedingWord(4,"two");
+    Cursor_insertCharacter(" three");
+    Cursor_insertCharacter(" fourx");
+    AutoCorrect_correctPrecedingWord(5,"four");
+    Cursor_insertCharacter(" five");
+    Cursor_insertCharacter(" sixx");
+    AutoCorrect_correctPrecedingWord(4,"six");
+    Cursor_insertCharacter(" seven");
+    PostponedActions_perform();
+    showSelection();
+
+    var text = findTextMatching("six");
+    Selection_set(text,0,text,0);
+
+    AutoCorrect_replaceCorrection("A");
+    PostponedActions_perform();
+
+    return showCorrections();
+}
+</script>
+</head>
+<body>
+<p>[]</p>
+</body>
+</html>

http://git-wip-us.apache.org/repos/asf/incubator-corinthia/blob/0633908a/experiments/editorFramework/test/Layer0/autocorrect/undo01-expected.html
----------------------------------------------------------------------
diff --git a/experiments/editorFramework/test/Layer0/autocorrect/undo01-expected.html b/experiments/editorFramework/test/Layer0/autocorrect/undo01-expected.html
new file mode 100644
index 0000000..f8ac7aa
--- /dev/null
+++ b/experiments/editorFramework/test/Layer0/autocorrect/undo01-expected.html
@@ -0,0 +1,17 @@
+<html>
+  <head>
+  </head>
+  <body>
+    <p>
+      one
+      <span class="uxwrite-autocorrect" original="twox">two</span>
+      three
+      <span class="uxwrite-autocorrect" original="fourx">four</span>
+      five[]
+    </p>
+  </body>
+</html>
+
+Corrections:
+    twox -> two
+    fourx -> four

http://git-wip-us.apache.org/repos/asf/incubator-corinthia/blob/0633908a/experiments/editorFramework/test/Layer0/autocorrect/undo01-input.html
----------------------------------------------------------------------
diff --git a/experiments/editorFramework/test/Layer0/autocorrect/undo01-input.html b/experiments/editorFramework/test/Layer0/autocorrect/undo01-input.html
new file mode 100644
index 0000000..35900a2
--- /dev/null
+++ b/experiments/editorFramework/test/Layer0/autocorrect/undo01-input.html
@@ -0,0 +1,35 @@
+<!DOCTYPE html>
+<html>
+<head>
+<script src="AutoCorrectTests.js"></script>
+<script>
+function performTest()
+{
+    Outline_init();
+    AutoCorrect_init();
+    PostponedActions_perform();
+
+    Cursor_insertCharacter("one");
+    Cursor_insertCharacter(" twox");
+    AutoCorrect_correctPrecedingWord(4,"two");
+    PostponedActions_perform();
+    Cursor_insertCharacter(" three");
+    Cursor_insertCharacter(" fourx");
+    AutoCorrect_correctPrecedingWord(5,"four");
+    PostponedActions_perform();
+    Cursor_insertCharacter(" five");
+
+    for (var i = 0; i < 0; i++) {
+        UndoManager_undo();
+    }
+
+    showSelection();
+
+    return showCorrections();
+}
+</script>
+</head>
+<body>
+<p>[]</p>
+</body>
+</html>

http://git-wip-us.apache.org/repos/asf/incubator-corinthia/blob/0633908a/experiments/editorFramework/test/Layer0/autocorrect/undo02-expected.html
----------------------------------------------------------------------
diff --git a/experiments/editorFramework/test/Layer0/autocorrect/undo02-expected.html b/experiments/editorFramework/test/Layer0/autocorrect/undo02-expected.html
new file mode 100644
index 0000000..52d8d22
--- /dev/null
+++ b/experiments/editorFramework/test/Layer0/autocorrect/undo02-expected.html
@@ -0,0 +1,14 @@
+<html>
+  <head>
+  </head>
+  <body>
+    <p>
+      one
+      <span class="uxwrite-autocorrect" original="twox">two</span>
+      []
+    </p>
+  </body>
+</html>
+
+Corrections:
+    twox -> two

http://git-wip-us.apache.org/repos/asf/incubator-corinthia/blob/0633908a/experiments/editorFramework/test/Layer0/autocorrect/undo02-input.html
----------------------------------------------------------------------
diff --git a/experiments/editorFramework/test/Layer0/autocorrect/undo02-input.html b/experiments/editorFramework/test/Layer0/autocorrect/undo02-input.html
new file mode 100644
index 0000000..5dc1bc8
--- /dev/null
+++ b/experiments/editorFramework/test/Layer0/autocorrect/undo02-input.html
@@ -0,0 +1,35 @@
+<!DOCTYPE html>
+<html>
+<head>
+<script src="AutoCorrectTests.js"></script>
+<script>
+function performTest()
+{
+    Outline_init();
+    AutoCorrect_init();
+    PostponedActions_perform();
+
+    Cursor_insertCharacter("one");
+    Cursor_insertCharacter(" twox");
+    AutoCorrect_correctPrecedingWord(4,"two");
+    PostponedActions_perform();
+    Cursor_insertCharacter(" three");
+    Cursor_insertCharacter(" fourx");
+    AutoCorrect_correctPrecedingWord(5,"four");
+    PostponedActions_perform();
+    Cursor_insertCharacter(" five");
+
+    for (var i = 0; i < 3; i++) {
+        UndoManager_undo();
+    }
+
+    showSelection();
+
+    return showCorrections();
+}
+</script>
+</head>
+<body>
+<p>[]</p>
+</body>
+</html>

http://git-wip-us.apache.org/repos/asf/incubator-corinthia/blob/0633908a/experiments/editorFramework/test/Layer0/autocorrect/undo03-expected.html
----------------------------------------------------------------------
diff --git a/experiments/editorFramework/test/Layer0/autocorrect/undo03-expected.html b/experiments/editorFramework/test/Layer0/autocorrect/undo03-expected.html
new file mode 100644
index 0000000..0280119
--- /dev/null
+++ b/experiments/editorFramework/test/Layer0/autocorrect/undo03-expected.html
@@ -0,0 +1,9 @@
+<html>
+  <head>
+  </head>
+  <body>
+    <p>one twox[]</p>
+  </body>
+</html>
+
+Corrections:

http://git-wip-us.apache.org/repos/asf/incubator-corinthia/blob/0633908a/experiments/editorFramework/test/Layer0/autocorrect/undo03-input.html
----------------------------------------------------------------------
diff --git a/experiments/editorFramework/test/Layer0/autocorrect/undo03-input.html b/experiments/editorFramework/test/Layer0/autocorrect/undo03-input.html
new file mode 100644
index 0000000..3e14c8d
--- /dev/null
+++ b/experiments/editorFramework/test/Layer0/autocorrect/undo03-input.html
@@ -0,0 +1,35 @@
+<!DOCTYPE html>
+<html>
+<head>
+<script src="AutoCorrectTests.js"></script>
+<script>
+function performTest()
+{
+    Outline_init();
+    AutoCorrect_init();
+    PostponedActions_perform();
+
+    Cursor_insertCharacter("one");
+    Cursor_insertCharacter(" twox");
+    AutoCorrect_correctPrecedingWord(4,"two");
+    PostponedActions_perform();
+    Cursor_insertCharacter(" three");
+    Cursor_insertCharacter(" fourx");
+    AutoCorrect_correctPrecedingWord(5,"four");
+    PostponedActions_perform();
+    Cursor_insertCharacter(" five");
+
+    for (var i = 0; i < 4; i++) {
+        UndoManager_undo();
+    }
+
+    showSelection();
+
+    return showCorrections();
+}
+</script>
+</head>
+<body>
+<p>[]</p>
+</body>
+</html>

http://git-wip-us.apache.org/repos/asf/incubator-corinthia/blob/0633908a/experiments/editorFramework/test/Layer0/autocorrect/undo04-expected.html
----------------------------------------------------------------------
diff --git a/experiments/editorFramework/test/Layer0/autocorrect/undo04-expected.html b/experiments/editorFramework/test/Layer0/autocorrect/undo04-expected.html
new file mode 100644
index 0000000..f8ac7aa
--- /dev/null
+++ b/experiments/editorFramework/test/Layer0/autocorrect/undo04-expected.html
@@ -0,0 +1,17 @@
+<html>
+  <head>
+  </head>
+  <body>
+    <p>
+      one
+      <span class="uxwrite-autocorrect" original="twox">two</span>
+      three
+      <span class="uxwrite-autocorrect" original="fourx">four</span>
+      five[]
+    </p>
+  </body>
+</html>
+
+Corrections:
+    twox -> two
+    fourx -> four

http://git-wip-us.apache.org/repos/asf/incubator-corinthia/blob/0633908a/experiments/editorFramework/test/Layer0/autocorrect/undo04-input.html
----------------------------------------------------------------------
diff --git a/experiments/editorFramework/test/Layer0/autocorrect/undo04-input.html b/experiments/editorFramework/test/Layer0/autocorrect/undo04-input.html
new file mode 100644
index 0000000..84b9809
--- /dev/null
+++ b/experiments/editorFramework/test/Layer0/autocorrect/undo04-input.html
@@ -0,0 +1,38 @@
+<!DOCTYPE html>
+<html>
+<head>
+<script src="AutoCorrectTests.js"></script>
+<script>
+function performTest()
+{
+    Outline_init();
+    AutoCorrect_init();
+    PostponedActions_perform();
+
+    Cursor_insertCharacter("one");
+    Cursor_insertCharacter(" twox");
+    AutoCorrect_correctPrecedingWord(4,"two");
+    PostponedActions_perform();
+    Cursor_insertCharacter(" three");
+    Cursor_insertCharacter(" fourx");
+    AutoCorrect_correctPrecedingWord(5,"four");
+    PostponedActions_perform();
+    Cursor_insertCharacter(" five");
+
+    for (var i = 0; i < 4; i++) {
+        UndoManager_undo();
+    }
+    for (var i = 0; i < 4; i++) {
+        UndoManager_redo();
+    }
+
+    showSelection();
+
+    return showCorrections();
+}
+</script>
+</head>
+<body>
+<p>[]</p>
+</body>
+</html>

http://git-wip-us.apache.org/repos/asf/incubator-corinthia/blob/0633908a/experiments/editorFramework/test/Layer0/autocorrect/undo05-expected.html
----------------------------------------------------------------------
diff --git a/experiments/editorFramework/test/Layer0/autocorrect/undo05-expected.html b/experiments/editorFramework/test/Layer0/autocorrect/undo05-expected.html
new file mode 100644
index 0000000..c664a24
--- /dev/null
+++ b/experiments/editorFramework/test/Layer0/autocorrect/undo05-expected.html
@@ -0,0 +1,52 @@
+<html>
+  <head>
+  </head>
+  <body>
+    ==================== Version 0 ====================
+    <p></p>
+    ==================== Version 1 ====================
+    <p>one twox</p>
+    ==================== Version 2 ====================
+    <p>
+      one
+      <span class="uxwrite-autocorrect" original="twox">two</span>
+    </p>
+    ==================== Version 3 ====================
+    <p>
+      one
+      <span class="uxwrite-autocorrect" original="twox">two</span>
+      three fourx
+    </p>
+    ==================== Version 4 ====================
+    <p>
+      one
+      <span class="uxwrite-autocorrect" original="twox">two</span>
+      three
+      <span class="uxwrite-autocorrect" original="fourx">four</span>
+    </p>
+    ==================== Version 5 ====================
+    <p>
+      one
+      <span class="uxwrite-autocorrect" original="twox">two</span>
+      three
+      <span class="uxwrite-autocorrect" original="fourx">four</span>
+      five
+    </p>
+    ===================================================
+    First undo to version 4: OK
+    First undo to version 3: OK
+    First undo to version 2: OK
+    First undo to version 1: OK
+    First undo to version 0: OK
+    Redo to version 1: OK
+    Redo to version 2: OK
+    Redo to version 3: OK
+    Redo to version 4: OK
+    Redo to version 5: OK
+    Second undo to version 4: OK
+    Second undo to version 3: OK
+    Second undo to version 2: OK
+    Second undo to version 1: OK
+    Second undo to version 0: OK
+  </body>
+</html>

http://git-wip-us.apache.org/repos/asf/incubator-corinthia/blob/0633908a/experiments/editorFramework/test/Layer0/autocorrect/undo05-input.html
----------------------------------------------------------------------
diff --git a/experiments/editorFramework/test/Layer0/autocorrect/undo05-input.html b/experiments/editorFramework/test/Layer0/autocorrect/undo05-input.html
new file mode 100644
index 0000000..9acc3db
--- /dev/null
+++ b/experiments/editorFramework/test/Layer0/autocorrect/undo05-input.html
@@ -0,0 +1,39 @@
+<!DOCTYPE html>
+<html>
+<head>
+<script src="AutoCorrectTests.js"></script>
+<script src="../undo/UndoTests.js"></script>
+<script>
+function performTest()
+{
+    Outline_init();
+    AutoCorrect_init();
+    PostponedActions_perform();
+
+    UndoManager_clear();
+    var p = document.getElementsByTagName("P")[0];
+    var versions = new Array();
+    versions.push(DOM_cloneNode(p,true));
+    Cursor_insertCharacter("one");
+    Cursor_insertCharacter(" twox");
+    versions.push(DOM_cloneNode(p,true));
+    AutoCorrect_correctPrecedingWord(4,"two");
+    PostponedActions_perform();
+    versions.push(DOM_cloneNode(p,true));
+    Cursor_insertCharacter(" three");
+    Cursor_insertCharacter(" fourx");
+    versions.push(DOM_cloneNode(p,true));
+    AutoCorrect_correctPrecedingWord(5,"four");
+    PostponedActions_perform();
+    versions.push(DOM_cloneNode(p,true));
+    Cursor_insertCharacter(" five");
+    versions.push(DOM_cloneNode(p,true));
+
+    testUndo(versions,p);
+}
+</script>
+</head>
+<body>
+<p>[]</p>
+</body>
+</html>

http://git-wip-us.apache.org/repos/asf/incubator-corinthia/blob/0633908a/experiments/editorFramework/test/Layer0/autocorrect/undo06-expected.html
----------------------------------------------------------------------
diff --git a/experiments/editorFramework/test/Layer0/autocorrect/undo06-expected.html b/experiments/editorFramework/test/Layer0/autocorrect/undo06-expected.html
new file mode 100644
index 0000000..1e48a4f
--- /dev/null
+++ b/experiments/editorFramework/test/Layer0/autocorrect/undo06-expected.html
@@ -0,0 +1,62 @@
+<html>
+  <head>
+  </head>
+  <body>
+    ==================== Version 0 ====================
+    <p></p>
+    ==================== Version 1 ====================
+    <p>one twox</p>
+    ==================== Version 2 ====================
+    <p>
+      one
+      <span class="uxwrite-autocorrect" original="twox">two</span>
+    </p>
+    ==================== Version 3 ====================
+    <p>
+      one
+      <span class="uxwrite-autocorrect" original="twox">two</span>
+      three fourx
+    </p>
+    ==================== Version 4 ====================
+    <p>
+      one
+      <span class="uxwrite-autocorrect" original="twox">two</span>
+      three
+      <span class="uxwrite-autocorrect" original="fourx">four</span>
+    </p>
+    ==================== Version 5 ====================
+    <p>
+      one
+      <span class="uxwrite-autocorrect" original="twox">two</span>
+      three
+      <span class="uxwrite-autocorrect" original="fourx">four</span>
+      five
+    </p>
+    ==================== Version 6 ====================
+    <p><br/></p>
+    ==================== Version 7 ====================
+    <p>one two three four five</p>
+    ===================================================
+    First undo to version 6: OK
+    First undo to version 5: OK
+    First undo to version 4: OK
+    First undo to version 3: OK
+    First undo to version 2: OK
+    First undo to version 1: OK
+    First undo to version 0: OK
+    Redo to version 1: OK
+    Redo to version 2: OK
+    Redo to version 3: OK
+    Redo to version 4: OK
+    Redo to version 5: OK
+    Redo to version 6: OK
+    Redo to version 7: OK
+    Second undo to version 6: OK
+    Second undo to version 5: OK
+    Second undo to version 4: OK
+    Second undo to version 3: OK
+    Second undo to version 2: OK
+    Second undo to version 1: OK
+    Second undo to version 0: OK
+  </body>
+</html>

http://git-wip-us.apache.org/repos/asf/incubator-corinthia/blob/0633908a/experiments/editorFramework/test/Layer0/autocorrect/undo06-input.html
----------------------------------------------------------------------
diff --git a/experiments/editorFramework/test/Layer0/autocorrect/undo06-input.html b/experiments/editorFramework/test/Layer0/autocorrect/undo06-input.html
new file mode 100644
index 0000000..0a09004
--- /dev/null
+++ b/experiments/editorFramework/test/Layer0/autocorrect/undo06-input.html
@@ -0,0 +1,45 @@
+<!DOCTYPE html>
+<html>
+<head>
+<script src="AutoCorrectTests.js"></script>
+<script src="../undo/UndoTests.js"></script>
+<script>
+function performTest()
+{
+    Outline_init();
+    AutoCorrect_init();
+    PostponedActions_perform();
+
+    UndoManager_clear();
+    var versions = new Array();
+    var p = document.getElementsByTagName("P")[0];
+    versions.push(DOM_cloneNode(p,true));
+    Cursor_insertCharacter("one");
+    Cursor_insertCharacter(" twox");
+    versions.push(DOM_cloneNode(p,true));
+    AutoCorrect_correctPrecedingWord(4,"two");
+    PostponedActions_perform();
+    versions.push(DOM_cloneNode(p,true));
+    Cursor_insertCharacter(" three");
+    Cursor_insertCharacter(" fourx");
+    versions.push(DOM_cloneNode(p,true));
+    AutoCorrect_correctPrecedingWord(5,"four");
+    PostponedActions_perform();
+    versions.push(DOM_cloneNode(p,true));
+    Cursor_insertCharacter(" five");
+
+    Selection_set(p,0,p,p.childNodes.length);
+    versions.push(DOM_cloneNode(p,true));
+    var clip = Clipboard_cut();
+    versions.push(DOM_cloneNode(p,true));
+    Clipboard_pasteHTML(clip["text/html"]);
+    versions.push(DOM_cloneNode(p,true));
+
+    testUndo(versions,p);
+}
+</script>
+</head>
+<body>
+<p>[]</p>
+</body>
+</html>

http://git-wip-us.apache.org/repos/asf/incubator-corinthia/blob/0633908a/experiments/editorFramework/test/Layer0/changetracking/acceptDel-list01-expected.html
----------------------------------------------------------------------
diff --git a/experiments/editorFramework/test/Layer0/changetracking/acceptDel-list01-expected.html b/experiments/editorFramework/test/Layer0/changetracking/acceptDel-list01-expected.html
new file mode 100644
index 0000000..3138070
--- /dev/null
+++ b/experiments/editorFramework/test/Layer0/changetracking/acceptDel-list01-expected.html
@@ -0,0 +1,16 @@
+<html>
+  <head>
+    <link href="changetracking.css" rel="stylesheet"/>
+  </head>
+  <body>
+    <ul>
+      <li>[one</li>
+      <li>three]</li>
+    </ul>
+    <ul>
+      <li>ONE</li>
+      <li><del>TWO</del></li>
+      <li>THREE</li>
+    </ul>
+  </body>
+</html>

http://git-wip-us.apache.org/repos/asf/incubator-corinthia/blob/0633908a/experiments/editorFramework/test/Layer0/changetracking/acceptDel-list01-input.html
----------------------------------------------------------------------
diff --git a/experiments/editorFramework/test/Layer0/changetracking/acceptDel-list01-input.html b/experiments/editorFramework/test/Layer0/changetracking/acceptDel-list01-input.html
new file mode 100644
index 0000000..bb27cb2
--- /dev/null
+++ b/experiments/editorFramework/test/Layer0/changetracking/acceptDel-list01-input.html
@@ -0,0 +1,25 @@
+<!DOCTYPE html>
+<html>
+<head>
+<link href="changetracking.css" rel="stylesheet"/>
+<script>
+function performTest()
+{
+    ChangeTracking_acceptSelectedChanges();
+    showSelection();
+}
+</script>
+</head>
+<body>
+  <ul>
+    <li>[one</li>
+    <li><del>two</del></li>
+    <li>three]</li>
+  </ul>
+  <ul>
+    <li>ONE</li>
+    <li><del>TWO</del></li>
+    <li>THREE</li>
+  </ul>
+</body>
+</html>

http://git-wip-us.apache.org/repos/asf/incubator-corinthia/blob/0633908a/experiments/editorFramework/test/Layer0/changetracking/acceptDel-list02-expected.html
----------------------------------------------------------------------
diff --git a/experiments/editorFramework/test/Layer0/changetracking/acceptDel-list02-expected.html b/experiments/editorFramework/test/Layer0/changetracking/acceptDel-list02-expected.html
new file mode 100644
index 0000000..18ac9e8
--- /dev/null
+++ b/experiments/editorFramework/test/Layer0/changetracking/acceptDel-list02-expected.html
@@ -0,0 +1,16 @@
+<html>
+  <head>
+    <link href="changetracking.css" rel="stylesheet"/>
+  </head>
+  <body>
+    <ul>
+      <li>one</li>
+      <li><del>two</del></li>
+      <li>three</li>
+    </ul>
+    <ul>
+      <li>[ONE</li>
+      <li>THREE]</li>
+    </ul>
+  </body>
+</html>

http://git-wip-us.apache.org/repos/asf/incubator-corinthia/blob/0633908a/experiments/editorFramework/test/Layer0/changetracking/acceptDel-list02-input.html
----------------------------------------------------------------------
diff --git a/experiments/editorFramework/test/Layer0/changetracking/acceptDel-list02-input.html b/experiments/editorFramework/test/Layer0/changetracking/acceptDel-list02-input.html
new file mode 100644
index 0000000..8cd021d
--- /dev/null
+++ b/experiments/editorFramework/test/Layer0/changetracking/acceptDel-list02-input.html
@@ -0,0 +1,25 @@
+<!DOCTYPE html>
+<html>
+<head>
+<link href="changetracking.css" rel="stylesheet"/>
+<script>
+function performTest()
+{
+    ChangeTracking_acceptSelectedChanges();
+    showSelection();
+}
+</script>
+</head>
+<body>
+  <ul>
+    <li>one</li>
+    <li><del>two</del></li>
+    <li>three</li>
+  </ul>
+  <ul>
+    <li>[ONE</li>
+    <li><del>TWO</del></li>
+    <li>THREE]</li>
+  </ul>
+</body>
+</html>

http://git-wip-us.apache.org/repos/asf/incubator-corinthia/blob/0633908a/experiments/editorFramework/test/Layer0/changetracking/acceptDel-list03-expected.html
----------------------------------------------------------------------
diff --git a/experiments/editorFramework/test/Layer0/changetracking/acceptDel-list03-expected.html b/experiments/editorFramework/test/Layer0/changetracking/acceptDel-list03-expected.html
new file mode 100644
index 0000000..dd80260
--- /dev/null
+++ b/experiments/editorFramework/test/Layer0/changetracking/acceptDel-list03-expected.html
@@ -0,0 +1,16 @@
+<html>
+  <head>
+    <link href="changetracking.css" rel="stylesheet"/>
+  </head>
+  <body>
+    <ul>
+      <li>one</li>
+      <li>[]three</li>
+    </ul>
+    <ul>
+      <li>ONE</li>
+      <li><del>TWO</del></li>
+      <li>THREE</li>
+    </ul>
+  </body>
+</html>

http://git-wip-us.apache.org/repos/asf/incubator-corinthia/blob/0633908a/experiments/editorFramework/test/Layer0/changetracking/acceptDel-list03-input.html
----------------------------------------------------------------------
diff --git a/experiments/editorFramework/test/Layer0/changetracking/acceptDel-list03-input.html b/experiments/editorFramework/test/Layer0/changetracking/acceptDel-list03-input.html
new file mode 100644
index 0000000..0059061
--- /dev/null
+++ b/experiments/editorFramework/test/Layer0/changetracking/acceptDel-list03-input.html
@@ -0,0 +1,25 @@
+<!DOCTYPE html>
+<html>
+<head>
+<link href="changetracking.css" rel="stylesheet"/>
+<script>
+function performTest()
+{
+    ChangeTracking_acceptSelectedChanges();
+    showSelection();
+}
+</script>
+</head>
+<body>
+  <ul>
+    <li>one</li>
+    <li><del>[]two</del></li>
+    <li>three</li>
+  </ul>
+  <ul>
+    <li>ONE</li>
+    <li><del>TWO</del></li>
+    <li>THREE</li>
+  </ul>
+</body>
+</html>

http://git-wip-us.apache.org/repos/asf/incubator-corinthia/blob/0633908a/experiments/editorFramework/test/Layer0/changetracking/acceptDel-list04-expected.html
----------------------------------------------------------------------
diff --git a/experiments/editorFramework/test/Layer0/changetracking/acceptDel-list04-expected.html b/experiments/editorFramework/test/Layer0/changetracking/acceptDel-list04-expected.html
new file mode 100644
index 0000000..862fec6
--- /dev/null
+++ b/experiments/editorFramework/test/Layer0/changetracking/acceptDel-list04-expected.html
@@ -0,0 +1,15 @@
+<html>
+  <head>
+    <link href="changetracking.css" rel="stylesheet"/>
+  </head>
+  <body>
+    <ul>
+      <li>[one</li>
+      <li>three</li>
+    </ul>
+    <ul>
+      <li>ONE</li>
+      <li>THREE]</li>
+    </ul>
+  </body>
+</html>

http://git-wip-us.apache.org/repos/asf/incubator-corinthia/blob/0633908a/experiments/editorFramework/test/Layer0/changetracking/acceptDel-list04-input.html
----------------------------------------------------------------------
diff --git a/experiments/editorFramework/test/Layer0/changetracking/acceptDel-list04-input.html b/experiments/editorFramework/test/Layer0/changetracking/acceptDel-list04-input.html
new file mode 100644
index 0000000..e466ec8
--- /dev/null
+++ b/experiments/editorFramework/test/Layer0/changetracking/acceptDel-list04-input.html
@@ -0,0 +1,25 @@
+<!DOCTYPE html>
+<html>
+<head>
+<link href="changetracking.css" rel="stylesheet"/>
+<script>
+function performTest()
+{
+    ChangeTracking_acceptSelectedChanges();
+    showSelection();
+}
+</script>
+</head>
+<body>
+  [<ul>
+    <li>one</li>
+    <li><del>two</del></li>
+    <li>three</li>
+  </ul>
+  <ul>
+    <li>ONE</li>
+    <li><del>TWO</del></li>
+    <li>THREE</li>
+  </ul>]
+</body>
+</html>

http://git-wip-us.apache.org/repos/asf/incubator-corinthia/blob/0633908a/experiments/editorFramework/test/Layer0/changetracking/acceptDel-list05-expected.html
----------------------------------------------------------------------
diff --git a/experiments/editorFramework/test/Layer0/changetracking/acceptDel-list05-expected.html b/experiments/editorFramework/test/Layer0/changetracking/acceptDel-list05-expected.html
new file mode 100644
index 0000000..e23add4
--- /dev/null
+++ b/experiments/editorFramework/test/Layer0/changetracking/acceptDel-list05-expected.html
@@ -0,0 +1,16 @@
+<html>
+  <head>
+    <link href="changetracking.css" rel="stylesheet"/>
+  </head>
+  <body>
+    <ul>
+      <li>one</li>
+      <li>[]three</li>
+    </ul>
+    <ul>
+      <li>ONE</li>
+      <li><del><b><i>TWO</i></b></del></li>
+      <li>THREE</li>
+    </ul>
+  </body>
+</html>

http://git-wip-us.apache.org/repos/asf/incubator-corinthia/blob/0633908a/experiments/editorFramework/test/Layer0/changetracking/acceptDel-list05-input.html
----------------------------------------------------------------------
diff --git a/experiments/editorFramework/test/Layer0/changetracking/acceptDel-list05-input.html b/experiments/editorFramework/test/Layer0/changetracking/acceptDel-list05-input.html
new file mode 100644
index 0000000..84e6011
--- /dev/null
+++ b/experiments/editorFramework/test/Layer0/changetracking/acceptDel-list05-input.html
@@ -0,0 +1,25 @@
+<!DOCTYPE html>
+<html>
+<head>
+<link href="changetracking.css" rel="stylesheet"/>
+<script>
+function performTest()
+{
+    ChangeTracking_acceptSelectedChanges();
+    showSelection();
+}
+</script>
+</head>
+<body>
+  <ul>
+    <li>one</li>
+    <li><del><b><i>t[]wo</i></b></del></li>
+    <li>three</li>
+  </ul>
+  <ul>
+    <li>ONE</li>
+    <li><del><b><i>TWO</i></b></del></li>
+    <li>THREE</li>
+  </ul>
+</body>
+</html>

http://git-wip-us.apache.org/repos/asf/incubator-corinthia/blob/0633908a/experiments/editorFramework/test/Layer0/changetracking/acceptDel-list06-expected.html
----------------------------------------------------------------------
diff --git a/experiments/editorFramework/test/Layer0/changetracking/acceptDel-list06-expected.html b/experiments/editorFramework/test/Layer0/changetracking/acceptDel-list06-expected.html
new file mode 100644
index 0000000..9facef5
--- /dev/null
+++ b/experiments/editorFramework/test/Layer0/changetracking/acceptDel-list06-expected.html
@@ -0,0 +1,19 @@
+<html>
+  <head>
+    <link href="changetracking.css" rel="stylesheet"/>
+  </head>
+  <body>
+    <ul>
+      <li>one</li>
+      <li>[three]</li>
+      <li>five</li>
+    </ul>
+    <ul>
+      <li>ONE</li>
+      <li><del>TWO</del></li>
+      <li>THREE</li>
+      <li><del>FOUR</del></li>
+      <li>FIVE</li>
+    </ul>
+  </body>
+</html>

http://git-wip-us.apache.org/repos/asf/incubator-corinthia/blob/0633908a/experiments/editorFramework/test/Layer0/changetracking/acceptDel-list06-input.html
----------------------------------------------------------------------
diff --git a/experiments/editorFramework/test/Layer0/changetracking/acceptDel-list06-input.html b/experiments/editorFramework/test/Layer0/changetracking/acceptDel-list06-input.html
new file mode 100644
index 0000000..2ead4cf
--- /dev/null
+++ b/experiments/editorFramework/test/Layer0/changetracking/acceptDel-list06-input.html
@@ -0,0 +1,29 @@
+<!DOCTYPE html>
+<html>
+<head>
+<link href="changetracking.css" rel="stylesheet"/>
+<script>
+function performTest()
+{
+    ChangeTracking_acceptSelectedChanges();
+    showSelection();
+}
+</script>
+</head>
+<body>
+  <ul>
+    <li>one</li>
+    <li><del>t[wo</del></li>
+    <li>three</li>
+    <li><del>fo]ur</del></li>
+    <li>five</li>
+  </ul>
+  <ul>
+    <li>ONE</li>
+    <li><del>TWO</del></li>
+    <li>THREE</li>
+    <li><del>FOUR</del></li>
+    <li>FIVE</li>
+  </ul>
+</body>
+</html>

http://git-wip-us.apache.org/repos/asf/incubator-corinthia/blob/0633908a/experiments/editorFramework/test/Layer0/changetracking/acceptDel-list07-expected.html
----------------------------------------------------------------------
diff --git a/experiments/editorFramework/test/Layer0/changetracking/acceptDel-list07-expected.html b/experiments/editorFramework/test/Layer0/changetracking/acceptDel-list07-expected.html
new file mode 100644
index 0000000..2f4a21f
--- /dev/null
+++ b/experiments/editorFramework/test/Layer0/changetracking/acceptDel-list07-expected.html
@@ -0,0 +1,12 @@
+<html>
+  <head>
+    <link href="changetracking.css" rel="stylesheet"/>
+  </head>
+  <body>
+    <ul>
+      <li>[]ONE</li>
+      <li><del>TWO</del></li>
+      <li>THREE</li>
+    </ul>
+  </body>
+</html>

http://git-wip-us.apache.org/repos/asf/incubator-corinthia/blob/0633908a/experiments/editorFramework/test/Layer0/changetracking/acceptDel-list07-input.html
----------------------------------------------------------------------
diff --git a/experiments/editorFramework/test/Layer0/changetracking/acceptDel-list07-input.html b/experiments/editorFramework/test/Layer0/changetracking/acceptDel-list07-input.html
new file mode 100644
index 0000000..2c8f282
--- /dev/null
+++ b/experiments/editorFramework/test/Layer0/changetracking/acceptDel-list07-input.html
@@ -0,0 +1,25 @@
+<!DOCTYPE html>
+<html>
+<head>
+<link href="changetracking.css" rel="stylesheet"/>
+<script>
+function performTest()
+{
+    ChangeTracking_acceptSelectedChanges();
+    showSelection();
+}
+</script>
+</head>
+<body>
+  <ul>
+    <li><del>[one</del></li>
+    <li><del>two</del></li>
+    <li><del>three]</del></li>
+  </ul>
+  <ul>
+    <li>ONE</li>
+    <li><del>TWO</del></li>
+    <li>THREE</li>
+  </ul>
+</body>
+</html>

http://git-wip-us.apache.org/repos/asf/incubator-corinthia/blob/0633908a/experiments/editorFramework/test/Layer0/changetracking/acceptDel-list08-expected.html
----------------------------------------------------------------------
diff --git a/experiments/editorFramework/test/Layer0/changetracking/acceptDel-list08-expected.html b/experiments/editorFramework/test/Layer0/changetracking/acceptDel-list08-expected.html
new file mode 100644
index 0000000..2f4a21f
--- /dev/null
+++ b/experiments/editorFramework/test/Layer0/changetracking/acceptDel-list08-expected.html
@@ -0,0 +1,12 @@
+<html>
+  <head>
+    <link href="changetracking.css" rel="stylesheet"/>
+  </head>
+  <body>
+    <ul>
+      <li>[]ONE</li>
+      <li><del>TWO</del></li>
+      <li>THREE</li>
+    </ul>
+  </body>
+</html>

http://git-wip-us.apache.org/repos/asf/incubator-corinthia/blob/0633908a/experiments/editorFramework/test/Layer0/changetracking/acceptDel-list08-input.html
----------------------------------------------------------------------
diff --git a/experiments/editorFramework/test/Layer0/changetracking/acceptDel-list08-input.html b/experiments/editorFramework/test/Layer0/changetracking/acceptDel-list08-input.html
new file mode 100644
index 0000000..12050e3
--- /dev/null
+++ b/experiments/editorFramework/test/Layer0/changetracking/acceptDel-list08-input.html
@@ -0,0 +1,25 @@
+<!DOCTYPE html>
+<html>
+<head>
+<link href="changetracking.css" rel="stylesheet"/>
+<script>
+function performTest()
+{
+    ChangeTracking_acceptSelectedChanges();
+    showSelection();
+}
+</script>
+</head>
+<body>
+  [<ul>
+    <li><del>one</del></li>
+    <li><del>two</del></li>
+    <li><del>three</del></li>
+  </ul>]
+  <ul>
+    <li>ONE</li>
+    <li><del>TWO</del></li>
+    <li>THREE</li>
+  </ul>
+</body>
+</html>

http://git-wip-us.apache.org/repos/asf/incubator-corinthia/blob/0633908a/experiments/editorFramework/test/Layer0/changetracking/acceptDel-list09-expected.html
----------------------------------------------------------------------
diff --git a/experiments/editorFramework/test/Layer0/changetracking/acceptDel-list09-expected.html b/experiments/editorFramework/test/Layer0/changetracking/acceptDel-list09-expected.html
new file mode 100644
index 0000000..2974258
--- /dev/null
+++ b/experiments/editorFramework/test/Layer0/changetracking/acceptDel-list09-expected.html
@@ -0,0 +1,11 @@
+<html>
+  <head>
+    <link href="changetracking.css" rel="stylesheet"/>
+  </head>
+  <body>
+    <ul>
+      <li>[ONE</li>
+      <li>THREE]</li>
+    </ul>
+  </body>
+</html>

http://git-wip-us.apache.org/repos/asf/incubator-corinthia/blob/0633908a/experiments/editorFramework/test/Layer0/changetracking/acceptDel-list09-input.html
----------------------------------------------------------------------
diff --git a/experiments/editorFramework/test/Layer0/changetracking/acceptDel-list09-input.html b/experiments/editorFramework/test/Layer0/changetracking/acceptDel-list09-input.html
new file mode 100644
index 0000000..0feec5d
--- /dev/null
+++ b/experiments/editorFramework/test/Layer0/changetracking/acceptDel-list09-input.html
@@ -0,0 +1,25 @@
+<!DOCTYPE html>
+<html>
+<head>
+<link href="changetracking.css" rel="stylesheet"/>
+<script>
+function performTest()
+{
+    ChangeTracking_acceptSelectedChanges();
+    showSelection();
+}
+</script>
+</head>
+<body>
+  [<ul>
+    <li><del>one</del></li>
+    <li><del>two</del></li>
+    <li><del>three</del></li>
+  </ul>
+  <ul>
+    <li>ONE</li>
+    <li><del>TWO</del></li>
+    <li>THREE</li>
+  </ul>]
+</body>
+</html>



Mime
View raw message