Rename nodeLength() to getNodeLength()
authorAryeh Gregor <AryehGregor+gitcommit@gmail.com>
Mon, 24 Oct 2011 13:30:37 -0600
changeset 646 ff44f1e1f4b9
parent 645 78d3e43c01a3
child 647 9b344f5db52c
Rename nodeLength() to getNodeLength()

nodeLength doesn't sound like a function name.
selecttest/collapse.html
selecttest/common.js
selecttest/extend.html
--- a/selecttest/collapse.html	Mon Oct 24 13:19:13 2011 -0600
+++ b/selecttest/collapse.html	Mon Oct 24 13:30:37 2011 -0600
@@ -22,7 +22,7 @@
 		return;
 	}
 
-	if (point[1] < 0 || point[1] > nodeLength(point[0])) {
+	if (point[1] < 0 || point[1] > getNodeLength(point[0])) {
 		assert_throws("INDEX_SIZE_ERR", function() {
 			selection.collapse(point[0], point[1]);
 		}, "Must throw INDEX_SIZE_ERR when collapse()ing if the offset is negative or greater than the node's length");
--- a/selecttest/common.js	Mon Oct 24 13:19:13 2011 -0600
+++ b/selecttest/common.js	Mon Oct 24 13:30:37 2011 -0600
@@ -311,7 +311,7 @@
 /**
  * Return the length of a node as specified in DOM Range.
  */
-function nodeLength(node) {
+function getNodeLength(node) {
 	if (node.nodeType == Node.DOCUMENT_TYPE_NODE) {
 		return 0;
 	}
@@ -473,7 +473,7 @@
  */
 function isContained(node, range) {
 	var pos1 = getPosition(node, 0, range.startContainer, range.startOffset);
-	var pos2 = getPosition(node, nodeLength(node), range.endContainer, range.endOffset);
+	var pos2 = getPosition(node, getNodeLength(node), range.endContainer, range.endOffset);
 
 	return furthestAncestor(node) == furthestAncestor(range.startContainer)
 		&& pos1 == "after"
@@ -672,7 +672,7 @@
 		// argument and (length of original start node − original start offset)
 		// as the second."
 		clone.data = originalStartNode.substringData(originalStartOffset,
-			nodeLength(originalStartNode) - originalStartOffset);
+			getNodeLength(originalStartNode) - originalStartOffset);
 
 		// "Append clone as the last child of frag."
 		frag.appendChild(clone);
@@ -681,7 +681,7 @@
 		// offset as the first argument and (length of original start node −
 		// original start offset) as the second."
 		originalStartNode.deleteData(originalStartOffset,
-			nodeLength(originalStartNode) - originalStartOffset);
+			getNodeLength(originalStartNode) - originalStartOffset);
 	// "Otherwise, if first partially contained child is not null:"
 	} else if (firstPartiallyContainedChild) {
 		// "Let clone be the result of calling cloneNode(false) on first
@@ -697,7 +697,7 @@
 		var subrange = ownerDoc.createRange();
 		subrange.setStart(originalStartNode, originalStartOffset);
 		subrange.setEnd(firstPartiallyContainedChild,
-			nodeLength(firstPartiallyContainedChild));
+			getNodeLength(firstPartiallyContainedChild));
 
 		// "Let subfrag be the result of calling extractContents() on
 		// subrange."
--- a/selecttest/extend.html	Mon Oct 24 13:19:13 2011 -0600
+++ b/selecttest/extend.html	Mon Oct 24 13:30:37 2011 -0600
@@ -116,10 +116,10 @@
 		return;
 	}
 
-	if (offset < 0 || offset > nodeLength(node)) {
+	if (offset < 0 || offset > getNodeLength(node)) {
 		assert_throws("INDEX_SIZE_ERR", function() {
 			selection.extend(node, offset);
-		}, "extend() to an offset that's negative or greater than node length (" + nodeLength(node) + ") must throw INDEX_SIZE_ERR");
+		}, "extend() to an offset that's negative or greater than node length (" + getNodeLength(node) + ") must throw INDEX_SIZE_ERR");
 		return;
 	}