You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@corinthia.apache.org by ja...@apache.org on 2015/02/23 12:39:23 UTC

[20/31] incubator-corinthia git commit: Fix cursor positioning around footnotes/endnotes

Fix cursor positioning around footnotes/endnotes

Since footnotes and endnotes are just spans with a special class name
set, the cursor positioning logic would consider the position directly
before the note and directly inside the start of the node (and similarly
at the end) as being equivalent. This commit treats them as separate for
the purposes of cursor placement.


Project: http://git-wip-us.apache.org/repos/asf/incubator-corinthia/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-corinthia/commit/8d49faa5
Tree: http://git-wip-us.apache.org/repos/asf/incubator-corinthia/tree/8d49faa5
Diff: http://git-wip-us.apache.org/repos/asf/incubator-corinthia/diff/8d49faa5

Branch: refs/heads/experimentzip
Commit: 8d49faa59ef8fa61f31d35693ad5197809a5c068
Parents: 05e1f1c
Author: Peter Kelly <pe...@uxproductivity.com>
Authored: Wed Feb 18 12:20:05 2015 +0700
Committer: Peter Kelly <pe...@uxproductivity.com>
Committed: Wed Feb 18 12:20:23 2015 +0700

----------------------------------------------------------------------
 Editor/src/Position.js                          | 11 ++++++++++
 Editor/src/types.js                             |  8 +++++++
 Editor/tests/genindex.sh                        |  2 +-
 Editor/tests/index.js                           | 22 +++++++++++++++++++-
 ...sValidCursorPosition-endnote01-expected.html | 11 ++++++++++
 .../isValidCursorPosition-endnote01-input.html  | 15 +++++++++++++
 ...sValidCursorPosition-endnote02-expected.html | 11 ++++++++++
 .../isValidCursorPosition-endnote02-input.html  | 15 +++++++++++++
 ...sValidCursorPosition-endnote03-expected.html | 11 ++++++++++
 .../isValidCursorPosition-endnote03-input.html  | 15 +++++++++++++
 ...sValidCursorPosition-endnote04-expected.html | 11 ++++++++++
 .../isValidCursorPosition-endnote04-input.html  | 15 +++++++++++++
 ...sValidCursorPosition-endnote05-expected.html | 13 ++++++++++++
 .../isValidCursorPosition-endnote05-input.html  | 15 +++++++++++++
 ...sValidCursorPosition-endnote06-expected.html | 11 ++++++++++
 .../isValidCursorPosition-endnote06-input.html  | 15 +++++++++++++
 ...sValidCursorPosition-endnote07-expected.html | 11 ++++++++++
 .../isValidCursorPosition-endnote07-input.html  | 15 +++++++++++++
 ...sValidCursorPosition-endnote08-expected.html | 11 ++++++++++
 .../isValidCursorPosition-endnote08-input.html  | 15 +++++++++++++
 ...sValidCursorPosition-endnote09-expected.html | 11 ++++++++++
 .../isValidCursorPosition-endnote09-input.html  | 15 +++++++++++++
 ...sValidCursorPosition-endnote10-expected.html | 13 ++++++++++++
 .../isValidCursorPosition-endnote10-input.html  | 15 +++++++++++++
 ...ValidCursorPosition-footnote01-expected.html | 11 ++++++++++
 .../isValidCursorPosition-footnote01-input.html | 15 +++++++++++++
 ...ValidCursorPosition-footnote02-expected.html | 11 ++++++++++
 .../isValidCursorPosition-footnote02-input.html | 15 +++++++++++++
 ...ValidCursorPosition-footnote03-expected.html | 11 ++++++++++
 .../isValidCursorPosition-footnote03-input.html | 15 +++++++++++++
 ...ValidCursorPosition-footnote04-expected.html | 11 ++++++++++
 .../isValidCursorPosition-footnote04-input.html | 15 +++++++++++++
 ...ValidCursorPosition-footnote05-expected.html | 13 ++++++++++++
 .../isValidCursorPosition-footnote05-input.html | 15 +++++++++++++
 ...ValidCursorPosition-footnote06-expected.html | 11 ++++++++++
 .../isValidCursorPosition-footnote06-input.html | 15 +++++++++++++
 ...ValidCursorPosition-footnote07-expected.html | 11 ++++++++++
 .../isValidCursorPosition-footnote07-input.html | 15 +++++++++++++
 ...ValidCursorPosition-footnote08-expected.html | 11 ++++++++++
 .../isValidCursorPosition-footnote08-input.html | 15 +++++++++++++
 ...ValidCursorPosition-footnote09-expected.html | 11 ++++++++++
 .../isValidCursorPosition-footnote09-input.html | 15 +++++++++++++
 ...ValidCursorPosition-footnote10-expected.html | 13 ++++++++++++
 .../isValidCursorPosition-footnote10-input.html | 15 +++++++++++++
 44 files changed, 569 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-corinthia/blob/8d49faa5/Editor/src/Position.js
----------------------------------------------------------------------
diff --git a/Editor/src/Position.js b/Editor/src/Position.js
index 7832835..ab5cfca 100644
--- a/Editor/src/Position.js
+++ b/Editor/src/Position.js
@@ -443,6 +443,7 @@ var Position_atPoint;
                 return (haveNextChar &&
                         ((node.previousSibling == null) ||
                          (node.previousSibling._type == HTML_BR) ||
+                         isNoteNode(node.previousSibling) ||
                          (isParagraphNode(node.previousSibling)) ||
                          (getNodeText(node.previousSibling).match(/\s$/)) ||
                          isItemNumber(node.previousSibling) ||
@@ -453,6 +454,7 @@ var Position_atPoint;
             if (isWhitespaceString(followingText)) {
                 return (havePrevChar &&
                         ((node.nextSibling == null) ||
+                         isNoteNode(node.nextSibling) ||
                          (followingText.length > 0) ||
                          (spacesUntilNextContent(node) != 0)));
             }
@@ -479,6 +481,15 @@ var Position_atPoint;
             var prevType = (prevNode != null) ? prevNode._type : 0;
             var nextType = (nextNode != null) ? nextNode._type : 0;
 
+            var prevIsNote = (prevNode != null) && isNoteNode(prevNode);
+            var nextIsNote = (nextNode != null) && isNoteNode(nextNode);
+            if ((nextNode == null) && prevIsNote)
+                return true;
+            if ((prevNode == null) && nextIsNote)
+                return true;
+            if (prevIsNote && nextIsNote)
+                return true;
+
             if ((prevNode == null) && (nextNode == null) &&
                 (CONTAINERS_ALLOWING_CHILDREN[type] ||
                 (isInlineNode(node) && !isOpaqueNode(node) && (type != HTML_BR))))

http://git-wip-us.apache.org/repos/asf/incubator-corinthia/blob/8d49faa5/Editor/src/types.js
----------------------------------------------------------------------
diff --git a/Editor/src/types.js b/Editor/src/types.js
index 5e025d6..392852f 100644
--- a/Editor/src/types.js
+++ b/Editor/src/types.js
@@ -167,6 +167,14 @@ function isRefNode(node)
             node.getAttribute("href").charAt(0) == "#");
 }
 
+function isNoteNode(node)
+{
+    if (node._type != HTML_SPAN)
+        return false;
+    var className = DOM_getAttribute(node,"class");
+    return ((className == "footnote") || (className == "endnote"));
+}
+
 function isItemNumber(node)
 {
     if (node.nodeType == Node.TEXT_NODE) {

http://git-wip-us.apache.org/repos/asf/incubator-corinthia/blob/8d49faa5/Editor/tests/genindex.sh
----------------------------------------------------------------------
diff --git a/Editor/tests/genindex.sh b/Editor/tests/genindex.sh
index eece866..3c99da3 100755
--- a/Editor/tests/genindex.sh
+++ b/Editor/tests/genindex.sh
@@ -1,7 +1,7 @@
 #!/bin/bash
 (
 prevdir=""
-echo "// This file was generated by genindex.sh on `date`"
+echo "// This file was generated by genindex.sh"
 echo "var tests = [";
 for dir in *; do
     if [ -d $dir ]; then

http://git-wip-us.apache.org/repos/asf/incubator-corinthia/blob/8d49faa5/Editor/tests/index.js
----------------------------------------------------------------------
diff --git a/Editor/tests/index.js b/Editor/tests/index.js
index c26d2d1..d0608f9 100644
--- a/Editor/tests/index.js
+++ b/Editor/tests/index.js
@@ -1,4 +1,4 @@
-// This file was generated by genindex.sh on Thu 27 Nov 2014 10:34:42 ICT
+// This file was generated by genindex.sh
 var tests = [
   { dir: "autocorrect",
     files: ["acceptCorrection-undo",
@@ -1571,9 +1571,29 @@ var tests = [
             "isValidCursorPosition-caption01a",
             "isValidCursorPosition-caption01b",
             "isValidCursorPosition-caption01c",
+            "isValidCursorPosition-endnote01",
+            "isValidCursorPosition-endnote02",
+            "isValidCursorPosition-endnote03",
+            "isValidCursorPosition-endnote04",
+            "isValidCursorPosition-endnote05",
+            "isValidCursorPosition-endnote06",
+            "isValidCursorPosition-endnote07",
+            "isValidCursorPosition-endnote08",
+            "isValidCursorPosition-endnote09",
+            "isValidCursorPosition-endnote10",
             "isValidCursorPosition-figure01a",
             "isValidCursorPosition-figure01b",
             "isValidCursorPosition-figure01c",
+            "isValidCursorPosition-footnote01",
+            "isValidCursorPosition-footnote02",
+            "isValidCursorPosition-footnote03",
+            "isValidCursorPosition-footnote04",
+            "isValidCursorPosition-footnote05",
+            "isValidCursorPosition-footnote06",
+            "isValidCursorPosition-footnote07",
+            "isValidCursorPosition-footnote08",
+            "isValidCursorPosition-footnote09",
+            "isValidCursorPosition-footnote10",
             "isValidCursorPosition-heading01a",
             "isValidCursorPosition-heading01b",
             "isValidCursorPosition-heading01c",

http://git-wip-us.apache.org/repos/asf/incubator-corinthia/blob/8d49faa5/Editor/tests/position/isValidCursorPosition-endnote01-expected.html
----------------------------------------------------------------------
diff --git a/Editor/tests/position/isValidCursorPosition-endnote01-expected.html b/Editor/tests/position/isValidCursorPosition-endnote01-expected.html
new file mode 100644
index 0000000..cb7614e
--- /dev/null
+++ b/Editor/tests/position/isValidCursorPosition-endnote01-expected.html
@@ -0,0 +1,11 @@
+<html>
+  <head>
+  </head>
+  <body>
+    <p>
+      .b.e.f.o.r.e.
+      <span class="endnote">.e.n.d.n.o.t.e.</span>
+      .a.f.t.e.r.
+    </p>
+  </body>
+</html>

http://git-wip-us.apache.org/repos/asf/incubator-corinthia/blob/8d49faa5/Editor/tests/position/isValidCursorPosition-endnote01-input.html
----------------------------------------------------------------------
diff --git a/Editor/tests/position/isValidCursorPosition-endnote01-input.html b/Editor/tests/position/isValidCursorPosition-endnote01-input.html
new file mode 100644
index 0000000..3254c5e
--- /dev/null
+++ b/Editor/tests/position/isValidCursorPosition-endnote01-input.html
@@ -0,0 +1,15 @@
+<!DOCTYPE html>
+<html>
+<head>
+<script src="validPositions.js"></script>
+<script>
+function performTest()
+{
+    showValidPositions();
+}
+</script>
+</head>
+<body>
+  <p>before<span class="endnote">endnote</span>after</p>
+</body>
+</html>

http://git-wip-us.apache.org/repos/asf/incubator-corinthia/blob/8d49faa5/Editor/tests/position/isValidCursorPosition-endnote02-expected.html
----------------------------------------------------------------------
diff --git a/Editor/tests/position/isValidCursorPosition-endnote02-expected.html b/Editor/tests/position/isValidCursorPosition-endnote02-expected.html
new file mode 100644
index 0000000..220a4e2
--- /dev/null
+++ b/Editor/tests/position/isValidCursorPosition-endnote02-expected.html
@@ -0,0 +1,11 @@
+<html>
+  <head>
+  </head>
+  <body>
+    <p>
+      .b.e.f.o.r.e.
+      <span class="endnote">.e.n.d.n.o.t.e.</span>
+      .
+    </p>
+  </body>
+</html>

http://git-wip-us.apache.org/repos/asf/incubator-corinthia/blob/8d49faa5/Editor/tests/position/isValidCursorPosition-endnote02-input.html
----------------------------------------------------------------------
diff --git a/Editor/tests/position/isValidCursorPosition-endnote02-input.html b/Editor/tests/position/isValidCursorPosition-endnote02-input.html
new file mode 100644
index 0000000..ee67b8a
--- /dev/null
+++ b/Editor/tests/position/isValidCursorPosition-endnote02-input.html
@@ -0,0 +1,15 @@
+<!DOCTYPE html>
+<html>
+<head>
+<script src="validPositions.js"></script>
+<script>
+function performTest()
+{
+    showValidPositions();
+}
+</script>
+</head>
+<body>
+  <p>before<span class="endnote">endnote</span></p>
+</body>
+</html>

http://git-wip-us.apache.org/repos/asf/incubator-corinthia/blob/8d49faa5/Editor/tests/position/isValidCursorPosition-endnote03-expected.html
----------------------------------------------------------------------
diff --git a/Editor/tests/position/isValidCursorPosition-endnote03-expected.html b/Editor/tests/position/isValidCursorPosition-endnote03-expected.html
new file mode 100644
index 0000000..56b5550
--- /dev/null
+++ b/Editor/tests/position/isValidCursorPosition-endnote03-expected.html
@@ -0,0 +1,11 @@
+<html>
+  <head>
+  </head>
+  <body>
+    <p>
+      .
+      <span class="endnote">.e.n.d.n.o.t.e.</span>
+      .a.f.t.e.r.
+    </p>
+  </body>
+</html>

http://git-wip-us.apache.org/repos/asf/incubator-corinthia/blob/8d49faa5/Editor/tests/position/isValidCursorPosition-endnote03-input.html
----------------------------------------------------------------------
diff --git a/Editor/tests/position/isValidCursorPosition-endnote03-input.html b/Editor/tests/position/isValidCursorPosition-endnote03-input.html
new file mode 100644
index 0000000..f4b15ab
--- /dev/null
+++ b/Editor/tests/position/isValidCursorPosition-endnote03-input.html
@@ -0,0 +1,15 @@
+<!DOCTYPE html>
+<html>
+<head>
+<script src="validPositions.js"></script>
+<script>
+function performTest()
+{
+    showValidPositions();
+}
+</script>
+</head>
+<body>
+  <p><span class="endnote">endnote</span>after</p>
+</body>
+</html>

http://git-wip-us.apache.org/repos/asf/incubator-corinthia/blob/8d49faa5/Editor/tests/position/isValidCursorPosition-endnote04-expected.html
----------------------------------------------------------------------
diff --git a/Editor/tests/position/isValidCursorPosition-endnote04-expected.html b/Editor/tests/position/isValidCursorPosition-endnote04-expected.html
new file mode 100644
index 0000000..f2e6bfa
--- /dev/null
+++ b/Editor/tests/position/isValidCursorPosition-endnote04-expected.html
@@ -0,0 +1,11 @@
+<html>
+  <head>
+  </head>
+  <body>
+    <p>
+      .
+      <span class="endnote">.e.n.d.n.o.t.e.</span>
+      .
+    </p>
+  </body>
+</html>

http://git-wip-us.apache.org/repos/asf/incubator-corinthia/blob/8d49faa5/Editor/tests/position/isValidCursorPosition-endnote04-input.html
----------------------------------------------------------------------
diff --git a/Editor/tests/position/isValidCursorPosition-endnote04-input.html b/Editor/tests/position/isValidCursorPosition-endnote04-input.html
new file mode 100644
index 0000000..74a8606
--- /dev/null
+++ b/Editor/tests/position/isValidCursorPosition-endnote04-input.html
@@ -0,0 +1,15 @@
+<!DOCTYPE html>
+<html>
+<head>
+<script src="validPositions.js"></script>
+<script>
+function performTest()
+{
+    showValidPositions();
+}
+</script>
+</head>
+<body>
+  <p><span class="endnote">endnote</span></p>
+</body>
+</html>

http://git-wip-us.apache.org/repos/asf/incubator-corinthia/blob/8d49faa5/Editor/tests/position/isValidCursorPosition-endnote05-expected.html
----------------------------------------------------------------------
diff --git a/Editor/tests/position/isValidCursorPosition-endnote05-expected.html b/Editor/tests/position/isValidCursorPosition-endnote05-expected.html
new file mode 100644
index 0000000..735a24f
--- /dev/null
+++ b/Editor/tests/position/isValidCursorPosition-endnote05-expected.html
@@ -0,0 +1,13 @@
+<html>
+  <head>
+  </head>
+  <body>
+    <p>
+      .b.e.f.o.r.e.
+      <span class="endnote">.f.i.r.s.t.</span>
+      .
+      <span class="endnote">.s.e.c.o.n.d.</span>
+      .a.f.t.e.r.
+    </p>
+  </body>
+</html>

http://git-wip-us.apache.org/repos/asf/incubator-corinthia/blob/8d49faa5/Editor/tests/position/isValidCursorPosition-endnote05-input.html
----------------------------------------------------------------------
diff --git a/Editor/tests/position/isValidCursorPosition-endnote05-input.html b/Editor/tests/position/isValidCursorPosition-endnote05-input.html
new file mode 100644
index 0000000..91277c9
--- /dev/null
+++ b/Editor/tests/position/isValidCursorPosition-endnote05-input.html
@@ -0,0 +1,15 @@
+<!DOCTYPE html>
+<html>
+<head>
+<script src="validPositions.js"></script>
+<script>
+function performTest()
+{
+    showValidPositions();
+}
+</script>
+</head>
+<body>
+  <p>before<span class="endnote">first</span><span class="endnote">second</span>after</p>
+</body>
+</html>

http://git-wip-us.apache.org/repos/asf/incubator-corinthia/blob/8d49faa5/Editor/tests/position/isValidCursorPosition-endnote06-expected.html
----------------------------------------------------------------------
diff --git a/Editor/tests/position/isValidCursorPosition-endnote06-expected.html b/Editor/tests/position/isValidCursorPosition-endnote06-expected.html
new file mode 100644
index 0000000..4b5fd0b
--- /dev/null
+++ b/Editor/tests/position/isValidCursorPosition-endnote06-expected.html
@@ -0,0 +1,11 @@
+<html>
+  <head>
+  </head>
+  <body>
+    <p>
+      .b.e.f.o.r.e.
+      <span class="endnote">.</span>
+      .a.f.t.e.r.
+    </p>
+  </body>
+</html>

http://git-wip-us.apache.org/repos/asf/incubator-corinthia/blob/8d49faa5/Editor/tests/position/isValidCursorPosition-endnote06-input.html
----------------------------------------------------------------------
diff --git a/Editor/tests/position/isValidCursorPosition-endnote06-input.html b/Editor/tests/position/isValidCursorPosition-endnote06-input.html
new file mode 100644
index 0000000..ed8e9fd
--- /dev/null
+++ b/Editor/tests/position/isValidCursorPosition-endnote06-input.html
@@ -0,0 +1,15 @@
+<!DOCTYPE html>
+<html>
+<head>
+<script src="validPositions.js"></script>
+<script>
+function performTest()
+{
+    showValidPositions();
+}
+</script>
+</head>
+<body>
+  <p>before<span class="endnote"></span>after</p>
+</body>
+</html>

http://git-wip-us.apache.org/repos/asf/incubator-corinthia/blob/8d49faa5/Editor/tests/position/isValidCursorPosition-endnote07-expected.html
----------------------------------------------------------------------
diff --git a/Editor/tests/position/isValidCursorPosition-endnote07-expected.html b/Editor/tests/position/isValidCursorPosition-endnote07-expected.html
new file mode 100644
index 0000000..abff27c
--- /dev/null
+++ b/Editor/tests/position/isValidCursorPosition-endnote07-expected.html
@@ -0,0 +1,11 @@
+<html>
+  <head>
+  </head>
+  <body>
+    <p>
+      .b.e.f.o.r.e.
+      <span class="endnote">.</span>
+      .
+    </p>
+  </body>
+</html>

http://git-wip-us.apache.org/repos/asf/incubator-corinthia/blob/8d49faa5/Editor/tests/position/isValidCursorPosition-endnote07-input.html
----------------------------------------------------------------------
diff --git a/Editor/tests/position/isValidCursorPosition-endnote07-input.html b/Editor/tests/position/isValidCursorPosition-endnote07-input.html
new file mode 100644
index 0000000..e10ba4b
--- /dev/null
+++ b/Editor/tests/position/isValidCursorPosition-endnote07-input.html
@@ -0,0 +1,15 @@
+<!DOCTYPE html>
+<html>
+<head>
+<script src="validPositions.js"></script>
+<script>
+function performTest()
+{
+    showValidPositions();
+}
+</script>
+</head>
+<body>
+  <p>before<span class="endnote"></span></p>
+</body>
+</html>

http://git-wip-us.apache.org/repos/asf/incubator-corinthia/blob/8d49faa5/Editor/tests/position/isValidCursorPosition-endnote08-expected.html
----------------------------------------------------------------------
diff --git a/Editor/tests/position/isValidCursorPosition-endnote08-expected.html b/Editor/tests/position/isValidCursorPosition-endnote08-expected.html
new file mode 100644
index 0000000..bbccfb6
--- /dev/null
+++ b/Editor/tests/position/isValidCursorPosition-endnote08-expected.html
@@ -0,0 +1,11 @@
+<html>
+  <head>
+  </head>
+  <body>
+    <p>
+      .
+      <span class="endnote">.</span>
+      .a.f.t.e.r.
+    </p>
+  </body>
+</html>

http://git-wip-us.apache.org/repos/asf/incubator-corinthia/blob/8d49faa5/Editor/tests/position/isValidCursorPosition-endnote08-input.html
----------------------------------------------------------------------
diff --git a/Editor/tests/position/isValidCursorPosition-endnote08-input.html b/Editor/tests/position/isValidCursorPosition-endnote08-input.html
new file mode 100644
index 0000000..0691bb8
--- /dev/null
+++ b/Editor/tests/position/isValidCursorPosition-endnote08-input.html
@@ -0,0 +1,15 @@
+<!DOCTYPE html>
+<html>
+<head>
+<script src="validPositions.js"></script>
+<script>
+function performTest()
+{
+    showValidPositions();
+}
+</script>
+</head>
+<body>
+  <p><span class="endnote"></span>after</p>
+</body>
+</html>

http://git-wip-us.apache.org/repos/asf/incubator-corinthia/blob/8d49faa5/Editor/tests/position/isValidCursorPosition-endnote09-expected.html
----------------------------------------------------------------------
diff --git a/Editor/tests/position/isValidCursorPosition-endnote09-expected.html b/Editor/tests/position/isValidCursorPosition-endnote09-expected.html
new file mode 100644
index 0000000..80c2f50
--- /dev/null
+++ b/Editor/tests/position/isValidCursorPosition-endnote09-expected.html
@@ -0,0 +1,11 @@
+<html>
+  <head>
+  </head>
+  <body>
+    <p>
+      .
+      <span class="endnote">.</span>
+      .
+    </p>
+  </body>
+</html>

http://git-wip-us.apache.org/repos/asf/incubator-corinthia/blob/8d49faa5/Editor/tests/position/isValidCursorPosition-endnote09-input.html
----------------------------------------------------------------------
diff --git a/Editor/tests/position/isValidCursorPosition-endnote09-input.html b/Editor/tests/position/isValidCursorPosition-endnote09-input.html
new file mode 100644
index 0000000..6d4d4e0
--- /dev/null
+++ b/Editor/tests/position/isValidCursorPosition-endnote09-input.html
@@ -0,0 +1,15 @@
+<!DOCTYPE html>
+<html>
+<head>
+<script src="validPositions.js"></script>
+<script>
+function performTest()
+{
+    showValidPositions();
+}
+</script>
+</head>
+<body>
+  <p><span class="endnote"></span></p>
+</body>
+</html>

http://git-wip-us.apache.org/repos/asf/incubator-corinthia/blob/8d49faa5/Editor/tests/position/isValidCursorPosition-endnote10-expected.html
----------------------------------------------------------------------
diff --git a/Editor/tests/position/isValidCursorPosition-endnote10-expected.html b/Editor/tests/position/isValidCursorPosition-endnote10-expected.html
new file mode 100644
index 0000000..70cab9a
--- /dev/null
+++ b/Editor/tests/position/isValidCursorPosition-endnote10-expected.html
@@ -0,0 +1,13 @@
+<html>
+  <head>
+  </head>
+  <body>
+    <p>
+      .b.e.f.o.r.e.
+      <span class="endnote">.</span>
+      .
+      <span class="endnote">.</span>
+      .a.f.t.e.r.
+    </p>
+  </body>
+</html>

http://git-wip-us.apache.org/repos/asf/incubator-corinthia/blob/8d49faa5/Editor/tests/position/isValidCursorPosition-endnote10-input.html
----------------------------------------------------------------------
diff --git a/Editor/tests/position/isValidCursorPosition-endnote10-input.html b/Editor/tests/position/isValidCursorPosition-endnote10-input.html
new file mode 100644
index 0000000..4f1a5c0
--- /dev/null
+++ b/Editor/tests/position/isValidCursorPosition-endnote10-input.html
@@ -0,0 +1,15 @@
+<!DOCTYPE html>
+<html>
+<head>
+<script src="validPositions.js"></script>
+<script>
+function performTest()
+{
+    showValidPositions();
+}
+</script>
+</head>
+<body>
+  <p>before<span class="endnote"></span><span class="endnote"></span>after</p>
+</body>
+</html>

http://git-wip-us.apache.org/repos/asf/incubator-corinthia/blob/8d49faa5/Editor/tests/position/isValidCursorPosition-footnote01-expected.html
----------------------------------------------------------------------
diff --git a/Editor/tests/position/isValidCursorPosition-footnote01-expected.html b/Editor/tests/position/isValidCursorPosition-footnote01-expected.html
new file mode 100644
index 0000000..30baef0
--- /dev/null
+++ b/Editor/tests/position/isValidCursorPosition-footnote01-expected.html
@@ -0,0 +1,11 @@
+<html>
+  <head>
+  </head>
+  <body>
+    <p>
+      .b.e.f.o.r.e.
+      <span class="footnote">.f.o.o.t.n.o.t.e.</span>
+      .a.f.t.e.r.
+    </p>
+  </body>
+</html>

http://git-wip-us.apache.org/repos/asf/incubator-corinthia/blob/8d49faa5/Editor/tests/position/isValidCursorPosition-footnote01-input.html
----------------------------------------------------------------------
diff --git a/Editor/tests/position/isValidCursorPosition-footnote01-input.html b/Editor/tests/position/isValidCursorPosition-footnote01-input.html
new file mode 100644
index 0000000..19f828f
--- /dev/null
+++ b/Editor/tests/position/isValidCursorPosition-footnote01-input.html
@@ -0,0 +1,15 @@
+<!DOCTYPE html>
+<html>
+<head>
+<script src="validPositions.js"></script>
+<script>
+function performTest()
+{
+    showValidPositions();
+}
+</script>
+</head>
+<body>
+  <p>before<span class="footnote">footnote</span>after</p>
+</body>
+</html>

http://git-wip-us.apache.org/repos/asf/incubator-corinthia/blob/8d49faa5/Editor/tests/position/isValidCursorPosition-footnote02-expected.html
----------------------------------------------------------------------
diff --git a/Editor/tests/position/isValidCursorPosition-footnote02-expected.html b/Editor/tests/position/isValidCursorPosition-footnote02-expected.html
new file mode 100644
index 0000000..6c640e4
--- /dev/null
+++ b/Editor/tests/position/isValidCursorPosition-footnote02-expected.html
@@ -0,0 +1,11 @@
+<html>
+  <head>
+  </head>
+  <body>
+    <p>
+      .b.e.f.o.r.e.
+      <span class="footnote">.f.o.o.t.n.o.t.e.</span>
+      .
+    </p>
+  </body>
+</html>

http://git-wip-us.apache.org/repos/asf/incubator-corinthia/blob/8d49faa5/Editor/tests/position/isValidCursorPosition-footnote02-input.html
----------------------------------------------------------------------
diff --git a/Editor/tests/position/isValidCursorPosition-footnote02-input.html b/Editor/tests/position/isValidCursorPosition-footnote02-input.html
new file mode 100644
index 0000000..33071e2
--- /dev/null
+++ b/Editor/tests/position/isValidCursorPosition-footnote02-input.html
@@ -0,0 +1,15 @@
+<!DOCTYPE html>
+<html>
+<head>
+<script src="validPositions.js"></script>
+<script>
+function performTest()
+{
+    showValidPositions();
+}
+</script>
+</head>
+<body>
+  <p>before<span class="footnote">footnote</span></p>
+</body>
+</html>

http://git-wip-us.apache.org/repos/asf/incubator-corinthia/blob/8d49faa5/Editor/tests/position/isValidCursorPosition-footnote03-expected.html
----------------------------------------------------------------------
diff --git a/Editor/tests/position/isValidCursorPosition-footnote03-expected.html b/Editor/tests/position/isValidCursorPosition-footnote03-expected.html
new file mode 100644
index 0000000..ffa20d6
--- /dev/null
+++ b/Editor/tests/position/isValidCursorPosition-footnote03-expected.html
@@ -0,0 +1,11 @@
+<html>
+  <head>
+  </head>
+  <body>
+    <p>
+      .
+      <span class="footnote">.f.o.o.t.n.o.t.e.</span>
+      .a.f.t.e.r.
+    </p>
+  </body>
+</html>

http://git-wip-us.apache.org/repos/asf/incubator-corinthia/blob/8d49faa5/Editor/tests/position/isValidCursorPosition-footnote03-input.html
----------------------------------------------------------------------
diff --git a/Editor/tests/position/isValidCursorPosition-footnote03-input.html b/Editor/tests/position/isValidCursorPosition-footnote03-input.html
new file mode 100644
index 0000000..8f7f354
--- /dev/null
+++ b/Editor/tests/position/isValidCursorPosition-footnote03-input.html
@@ -0,0 +1,15 @@
+<!DOCTYPE html>
+<html>
+<head>
+<script src="validPositions.js"></script>
+<script>
+function performTest()
+{
+    showValidPositions();
+}
+</script>
+</head>
+<body>
+  <p><span class="footnote">footnote</span>after</p>
+</body>
+</html>

http://git-wip-us.apache.org/repos/asf/incubator-corinthia/blob/8d49faa5/Editor/tests/position/isValidCursorPosition-footnote04-expected.html
----------------------------------------------------------------------
diff --git a/Editor/tests/position/isValidCursorPosition-footnote04-expected.html b/Editor/tests/position/isValidCursorPosition-footnote04-expected.html
new file mode 100644
index 0000000..df77fa9
--- /dev/null
+++ b/Editor/tests/position/isValidCursorPosition-footnote04-expected.html
@@ -0,0 +1,11 @@
+<html>
+  <head>
+  </head>
+  <body>
+    <p>
+      .
+      <span class="footnote">.f.o.o.t.n.o.t.e.</span>
+      .
+    </p>
+  </body>
+</html>

http://git-wip-us.apache.org/repos/asf/incubator-corinthia/blob/8d49faa5/Editor/tests/position/isValidCursorPosition-footnote04-input.html
----------------------------------------------------------------------
diff --git a/Editor/tests/position/isValidCursorPosition-footnote04-input.html b/Editor/tests/position/isValidCursorPosition-footnote04-input.html
new file mode 100644
index 0000000..4f84bb3
--- /dev/null
+++ b/Editor/tests/position/isValidCursorPosition-footnote04-input.html
@@ -0,0 +1,15 @@
+<!DOCTYPE html>
+<html>
+<head>
+<script src="validPositions.js"></script>
+<script>
+function performTest()
+{
+    showValidPositions();
+}
+</script>
+</head>
+<body>
+  <p><span class="footnote">footnote</span></p>
+</body>
+</html>

http://git-wip-us.apache.org/repos/asf/incubator-corinthia/blob/8d49faa5/Editor/tests/position/isValidCursorPosition-footnote05-expected.html
----------------------------------------------------------------------
diff --git a/Editor/tests/position/isValidCursorPosition-footnote05-expected.html b/Editor/tests/position/isValidCursorPosition-footnote05-expected.html
new file mode 100644
index 0000000..3c42ff3
--- /dev/null
+++ b/Editor/tests/position/isValidCursorPosition-footnote05-expected.html
@@ -0,0 +1,13 @@
+<html>
+  <head>
+  </head>
+  <body>
+    <p>
+      .b.e.f.o.r.e.
+      <span class="footnote">.f.i.r.s.t.</span>
+      .
+      <span class="footnote">.s.e.c.o.n.d.</span>
+      .a.f.t.e.r.
+    </p>
+  </body>
+</html>

http://git-wip-us.apache.org/repos/asf/incubator-corinthia/blob/8d49faa5/Editor/tests/position/isValidCursorPosition-footnote05-input.html
----------------------------------------------------------------------
diff --git a/Editor/tests/position/isValidCursorPosition-footnote05-input.html b/Editor/tests/position/isValidCursorPosition-footnote05-input.html
new file mode 100644
index 0000000..6a41ff8
--- /dev/null
+++ b/Editor/tests/position/isValidCursorPosition-footnote05-input.html
@@ -0,0 +1,15 @@
+<!DOCTYPE html>
+<html>
+<head>
+<script src="validPositions.js"></script>
+<script>
+function performTest()
+{
+    showValidPositions();
+}
+</script>
+</head>
+<body>
+  <p>before<span class="footnote">first</span><span class="footnote">second</span>after</p>
+</body>
+</html>

http://git-wip-us.apache.org/repos/asf/incubator-corinthia/blob/8d49faa5/Editor/tests/position/isValidCursorPosition-footnote06-expected.html
----------------------------------------------------------------------
diff --git a/Editor/tests/position/isValidCursorPosition-footnote06-expected.html b/Editor/tests/position/isValidCursorPosition-footnote06-expected.html
new file mode 100644
index 0000000..c7f7280
--- /dev/null
+++ b/Editor/tests/position/isValidCursorPosition-footnote06-expected.html
@@ -0,0 +1,11 @@
+<html>
+  <head>
+  </head>
+  <body>
+    <p>
+      .b.e.f.o.r.e.
+      <span class="footnote">.</span>
+      .a.f.t.e.r.
+    </p>
+  </body>
+</html>

http://git-wip-us.apache.org/repos/asf/incubator-corinthia/blob/8d49faa5/Editor/tests/position/isValidCursorPosition-footnote06-input.html
----------------------------------------------------------------------
diff --git a/Editor/tests/position/isValidCursorPosition-footnote06-input.html b/Editor/tests/position/isValidCursorPosition-footnote06-input.html
new file mode 100644
index 0000000..c73faa2
--- /dev/null
+++ b/Editor/tests/position/isValidCursorPosition-footnote06-input.html
@@ -0,0 +1,15 @@
+<!DOCTYPE html>
+<html>
+<head>
+<script src="validPositions.js"></script>
+<script>
+function performTest()
+{
+    showValidPositions();
+}
+</script>
+</head>
+<body>
+  <p>before<span class="footnote"></span>after</p>
+</body>
+</html>

http://git-wip-us.apache.org/repos/asf/incubator-corinthia/blob/8d49faa5/Editor/tests/position/isValidCursorPosition-footnote07-expected.html
----------------------------------------------------------------------
diff --git a/Editor/tests/position/isValidCursorPosition-footnote07-expected.html b/Editor/tests/position/isValidCursorPosition-footnote07-expected.html
new file mode 100644
index 0000000..610bd41
--- /dev/null
+++ b/Editor/tests/position/isValidCursorPosition-footnote07-expected.html
@@ -0,0 +1,11 @@
+<html>
+  <head>
+  </head>
+  <body>
+    <p>
+      .b.e.f.o.r.e.
+      <span class="footnote">.</span>
+      .
+    </p>
+  </body>
+</html>

http://git-wip-us.apache.org/repos/asf/incubator-corinthia/blob/8d49faa5/Editor/tests/position/isValidCursorPosition-footnote07-input.html
----------------------------------------------------------------------
diff --git a/Editor/tests/position/isValidCursorPosition-footnote07-input.html b/Editor/tests/position/isValidCursorPosition-footnote07-input.html
new file mode 100644
index 0000000..50f5b25
--- /dev/null
+++ b/Editor/tests/position/isValidCursorPosition-footnote07-input.html
@@ -0,0 +1,15 @@
+<!DOCTYPE html>
+<html>
+<head>
+<script src="validPositions.js"></script>
+<script>
+function performTest()
+{
+    showValidPositions();
+}
+</script>
+</head>
+<body>
+  <p>before<span class="footnote"></span></p>
+</body>
+</html>

http://git-wip-us.apache.org/repos/asf/incubator-corinthia/blob/8d49faa5/Editor/tests/position/isValidCursorPosition-footnote08-expected.html
----------------------------------------------------------------------
diff --git a/Editor/tests/position/isValidCursorPosition-footnote08-expected.html b/Editor/tests/position/isValidCursorPosition-footnote08-expected.html
new file mode 100644
index 0000000..a257091
--- /dev/null
+++ b/Editor/tests/position/isValidCursorPosition-footnote08-expected.html
@@ -0,0 +1,11 @@
+<html>
+  <head>
+  </head>
+  <body>
+    <p>
+      .
+      <span class="footnote">.</span>
+      .a.f.t.e.r.
+    </p>
+  </body>
+</html>

http://git-wip-us.apache.org/repos/asf/incubator-corinthia/blob/8d49faa5/Editor/tests/position/isValidCursorPosition-footnote08-input.html
----------------------------------------------------------------------
diff --git a/Editor/tests/position/isValidCursorPosition-footnote08-input.html b/Editor/tests/position/isValidCursorPosition-footnote08-input.html
new file mode 100644
index 0000000..4e808bc
--- /dev/null
+++ b/Editor/tests/position/isValidCursorPosition-footnote08-input.html
@@ -0,0 +1,15 @@
+<!DOCTYPE html>
+<html>
+<head>
+<script src="validPositions.js"></script>
+<script>
+function performTest()
+{
+    showValidPositions();
+}
+</script>
+</head>
+<body>
+  <p><span class="footnote"></span>after</p>
+</body>
+</html>

http://git-wip-us.apache.org/repos/asf/incubator-corinthia/blob/8d49faa5/Editor/tests/position/isValidCursorPosition-footnote09-expected.html
----------------------------------------------------------------------
diff --git a/Editor/tests/position/isValidCursorPosition-footnote09-expected.html b/Editor/tests/position/isValidCursorPosition-footnote09-expected.html
new file mode 100644
index 0000000..cc1183f
--- /dev/null
+++ b/Editor/tests/position/isValidCursorPosition-footnote09-expected.html
@@ -0,0 +1,11 @@
+<html>
+  <head>
+  </head>
+  <body>
+    <p>
+      .
+      <span class="footnote">.</span>
+      .
+    </p>
+  </body>
+</html>

http://git-wip-us.apache.org/repos/asf/incubator-corinthia/blob/8d49faa5/Editor/tests/position/isValidCursorPosition-footnote09-input.html
----------------------------------------------------------------------
diff --git a/Editor/tests/position/isValidCursorPosition-footnote09-input.html b/Editor/tests/position/isValidCursorPosition-footnote09-input.html
new file mode 100644
index 0000000..3790129
--- /dev/null
+++ b/Editor/tests/position/isValidCursorPosition-footnote09-input.html
@@ -0,0 +1,15 @@
+<!DOCTYPE html>
+<html>
+<head>
+<script src="validPositions.js"></script>
+<script>
+function performTest()
+{
+    showValidPositions();
+}
+</script>
+</head>
+<body>
+  <p><span class="footnote"></span></p>
+</body>
+</html>

http://git-wip-us.apache.org/repos/asf/incubator-corinthia/blob/8d49faa5/Editor/tests/position/isValidCursorPosition-footnote10-expected.html
----------------------------------------------------------------------
diff --git a/Editor/tests/position/isValidCursorPosition-footnote10-expected.html b/Editor/tests/position/isValidCursorPosition-footnote10-expected.html
new file mode 100644
index 0000000..b192062
--- /dev/null
+++ b/Editor/tests/position/isValidCursorPosition-footnote10-expected.html
@@ -0,0 +1,13 @@
+<html>
+  <head>
+  </head>
+  <body>
+    <p>
+      .b.e.f.o.r.e.
+      <span class="footnote">.</span>
+      .
+      <span class="footnote">.</span>
+      .a.f.t.e.r.
+    </p>
+  </body>
+</html>

http://git-wip-us.apache.org/repos/asf/incubator-corinthia/blob/8d49faa5/Editor/tests/position/isValidCursorPosition-footnote10-input.html
----------------------------------------------------------------------
diff --git a/Editor/tests/position/isValidCursorPosition-footnote10-input.html b/Editor/tests/position/isValidCursorPosition-footnote10-input.html
new file mode 100644
index 0000000..bcf3749
--- /dev/null
+++ b/Editor/tests/position/isValidCursorPosition-footnote10-input.html
@@ -0,0 +1,15 @@
+<!DOCTYPE html>
+<html>
+<head>
+<script src="validPositions.js"></script>
+<script>
+function performTest()
+{
+    showValidPositions();
+}
+</script>
+</head>
+<body>
+  <p>before<span class="footnote"></span><span class="footnote"></span>after</p>
+</body>
+</html>