Fix bugs that totally broke indeterm in some cases
authorAryeh Gregor <AryehGregor+gitcommit@gmail.com>
Fri, 29 Jul 2011 14:57:54 -0600
changeset 473 00d77b4fbb8e
parent 472 7af1813df5d3
child 474 f1f490ebd50f
Fix bugs that totally broke indeterm in some cases
implementation.js
tests.js
--- a/implementation.js	Fri Jul 29 14:43:56 2011 -0600
+++ b/implementation.js	Fri Jul 29 14:57:54 2011 -0600
@@ -587,7 +587,7 @@
 	}})(command));
 }
 
-function myQueryCommandIndeterm(command) {
+function myQueryCommandIndeterm(command, range) {
 	// "All of these methods must treat their command argument ASCII
 	// case-insensitively."
 	command = command.toLowerCase();
@@ -7501,8 +7501,8 @@
 	// the given values and at least one whose effective command value is
 	// not one of the given values."
 	if ("inlineCommandActivatedValues" in commands[command]
-	&& !("indeterminate" in commands[command])) {
-		commands[command].indeterminate = function() {
+	&& !("indeterm" in commands[command])) {
+		commands[command].indeterm = function() {
 			var values = getAllEffectivelyContainedNodes(getActiveRange(), function(node) {
 				return isEditable(node)
 					&& node.nodeType == Node.TEXT_NODE;
@@ -7551,7 +7551,7 @@
 	// active range, or if there is no such node, the effective command
 	// value of the active range's start node."
 	if ("standardInlineValueCommand" in commands[command]) {
-		commands[command].indeterminate = function() {
+		commands[command].indeterm = function() {
 			return getAllEffectivelyContainedNodes(getActiveRange())
 				.filter(function(node) { return isEditable(node) && node.nodeType == Node.TEXT_NODE })
 				.map(function(node) { return getEffectiveCommandValue(node, command) })
--- a/tests.js	Fri Jul 29 14:43:56 2011 -0600
+++ b/tests.js	Fri Jul 29 14:57:54 2011 -0600
@@ -3951,6 +3951,9 @@
 				beforeIndeterm, beforeState, beforeValue,
 				afterIndeterm, afterState, afterValue,
 				command, test[test.length - 1][1]));
+			if (specCell.querySelector(".bad-result")) {
+				specCell.parentNode.className = "alert";
+			}
 		}
 	} catch (e) {
 		specCell.firstChild.contentEditable = "inherit";