Remove indeterm/state/value for createLink/unlink
authorAryeh Gregor <AryehGregor+gitcommit@gmail.com>
Thu, 15 Sep 2011 15:08:20 -0600
changeset 582 d0760b6d50a5
parent 581 916f9a259380
child 583 2d9559086d05
Remove indeterm/state/value for createLink/unlink

This matches browsers better, and avoids trying to return null from
queryCommandValue().

Fixes: http://www.w3.org/Bugs/Public/show_bug.cgi?id=14067
conformancetest/runtest.html
editing.html
implementation.js
source.html
--- a/conformancetest/runtest.html	Thu Sep 15 15:07:32 2011 -0600
+++ b/conformancetest/runtest.html	Thu Sep 15 15:08:20 2011 -0600
@@ -143,10 +143,6 @@
 			"Unexpected innerHTML (after normalizing inline style)");
 	}, testName + " compare innerHTML");
 
-	// Temporary hack for http://www.w3.org/Bugs/Public/show_bug.cgi?id=14067
-	delete expectedQueryResults.createlink;
-	delete expectedQueryResults.unlink;
-
 	for (var command in expectedQueryResults) {
 		var descriptions = [
 			'queryCommandIndeterm("' + command + '") before',
--- a/editing.html	Thu Sep 15 15:07:32 2011 -0600
+++ b/editing.html	Thu Sep 15 15:08:20 2011 -0600
@@ -3071,10 +3071,20 @@
 
 <h3 id=the-createlink-command><dfn>The <code title="">createLink</code> command</dfn></h3>
 
-<p class=comments> If the selection doesn't contain anything (meaning, e.g.,
-deleteContents() doesn't change anything), then Chrome 12 dev inserts a link at
-the selection start, with the text equal to the link URL.  Other browsers don't
-do it, so I don't either.
+<div class=comments>
+<p>If the selection doesn't contain anything (meaning, e.g., deleteContents()
+doesn't change anything), then Chrome 12 dev inserts a link at the selection
+start, with the text equal to the link URL.  Other browsers don't do it, so I
+don't either.
+
+<p>IE10PP2, Firefox 7.0a2, Chrome 14 dev, and Opera 11.50 all do not support
+indeterminate, state, or value for createLink or unlink.  I previously defined
+indeterminate and value anyway because they make sense, but then <a href="http://www.w3.org/Bugs/Public/show_bug.cgi?id=14067">undefined them</a>.
+The nontrivial thing is what value to return if there's no link, since any
+string can occur as a link href, in principle.
+
+<p>What are the use-cases for indeterm, state, or value for createLink/unlink?
+</div>
 
 <p><a href=#action>Action</a>:
 
@@ -3123,12 +3133,6 @@
   <li><a href="#set-the-selection's-value">Set the selection's value</a> to <var title="">value</var>.
 </ol>
 
-<p class=comments>IE10PP2, Firefox 7.0a2, Chrome 14 dev, and Opera 11.50 all do
-not support indeterminate, state, or value for createLink or unlink.  I define
-indeterminate and value anyway because they make sense.
-
-<p><a href=#standard-inline-value-command>Standard inline value command</a>
-
 
 <h3 id=the-fontname-command><dfn>The <code title="">fontName</code> command</dfn></h3>
 
@@ -3865,12 +3869,17 @@
 
 <h3 id=the-unlink-command><dfn>The <code title="">unlink</code> command</dfn></h3>
 
-<p class=comments>IE 9 RC unlinks the whole link you're pointing at, while
-others only unlink the current text.  The latter behavior seems less expected,
-as with createLink, although I can't articulate precisely why.  Word 2007 and
-OpenOffice.org 3.2.1 (Ubuntu) seem to give an option to remove the whole link
-or none of it, which backs the spec's requirement.  See also #whatwg logs
-starting at 2011-05-13 at 16:53 EDT (UTC-0400).
+<div class=comments>
+<p>IE 9 RC unlinks the whole link you're pointing at, while others only unlink
+the current text.  The latter behavior seems less expected, as with createLink,
+although I can't articulate precisely why.  Word 2007 and OpenOffice.org 3.2.1
+(Ubuntu) seem to give an option to remove the whole link or none of it, which
+backs the spec's requirement.  See also #whatwg logs starting at 2011-05-13 at
+16:53 EDT (UTC-0400).
+
+<p>See comment for <a href=#the-createlink-command>the <code title="">createLink</code> command</a> about
+indeterm/state/value.
+</div>
 
 <p><a href=#action>Action</a>:
 
@@ -3882,12 +3891,6 @@
   <li><a href=#clear-the-value>Clear the value</a> of each member of <var title="">hyperlinks</var>.
 </ol>
 
-<p class=comments>IE10PP2, Firefox 7.0a2, Chrome 14 dev, and Opera 11.50 all do
-not support indeterminate, state, or value for createLink or unlink.  I define
-indeterminate and value anyway because they make sense.
-
-<p><a href=#standard-inline-value-command>Standard inline value command</a>
-
 
 
 <h2 id=block-formatting-commands>Block formatting commands</h2>
--- a/implementation.js	Thu Sep 15 15:07:32 2011 -0600
+++ b/implementation.js	Thu Sep 15 15:08:20 2011 -0600
@@ -3114,7 +3114,7 @@
 
 		// "Set the selection's value to value."
 		setSelectionValue("createlink", value);
-	}, standardInlineValueCommand: true
+	}
 };
 
 //@}
@@ -3649,7 +3649,7 @@
 		for (var i = 0; i < hyperlinks.length; i++) {
 			clearValue(hyperlinks[i], "unlink");
 		}
-	}, standardInlineValueCommand: true
+	}
 };
 
 //@}
--- a/source.html	Thu Sep 15 15:07:32 2011 -0600
+++ b/source.html	Thu Sep 15 15:08:20 2011 -0600
@@ -3078,10 +3078,21 @@
 <!-- @} -->
 <h3><dfn>The <code title>createLink</code> command</dfn></h3>
 <!-- @{ -->
-<p class=comments> If the selection doesn't contain anything (meaning, e.g.,
-deleteContents() doesn't change anything), then Chrome 12 dev inserts a link at
-the selection start, with the text equal to the link URL.  Other browsers don't
-do it, so I don't either.
+<div class=comments>
+<p>If the selection doesn't contain anything (meaning, e.g., deleteContents()
+doesn't change anything), then Chrome 12 dev inserts a link at the selection
+start, with the text equal to the link URL.  Other browsers don't do it, so I
+don't either.
+
+<p>IE10PP2, Firefox 7.0a2, Chrome 14 dev, and Opera 11.50 all do not support
+indeterminate, state, or value for createLink or unlink.  I previously defined
+indeterminate and value anyway because they make sense, but then <a
+href=http://www.w3.org/Bugs/Public/show_bug.cgi?id=14067>undefined them</a>.
+The nontrivial thing is what value to return if there's no link, since any
+string can occur as a link href, in principle.
+
+<p>What are the use-cases for indeterm, state, or value for createLink/unlink?
+</div>
 
 <p><span>Action</span>:
 
@@ -3130,12 +3141,6 @@
   <li><span>Set the selection's value</span> to <var>value</var>.
 </ol>
 
-<p class=comments>IE10PP2, Firefox 7.0a2, Chrome 14 dev, and Opera 11.50 all do
-not support indeterminate, state, or value for createLink or unlink.  I define
-indeterminate and value anyway because they make sense.
-
-<p><span>Standard inline value command</span>
-
 <!-- @} -->
 <h3><dfn>The <code title>fontName</code> command</dfn></h3>
 <!-- @{ -->
@@ -3880,12 +3885,17 @@
 <!-- @} -->
 <h3><dfn>The <code title>unlink</code> command</dfn></h3>
 <!-- @{ -->
-<p class=comments>IE 9 RC unlinks the whole link you're pointing at, while
-others only unlink the current text.  The latter behavior seems less expected,
-as with createLink, although I can't articulate precisely why.  Word 2007 and
-OpenOffice.org 3.2.1 (Ubuntu) seem to give an option to remove the whole link
-or none of it, which backs the spec's requirement.  See also #whatwg logs
-starting at 2011-05-13 at 16:53 EDT (UTC-0400).
+<div class=comments>
+<p>IE 9 RC unlinks the whole link you're pointing at, while others only unlink
+the current text.  The latter behavior seems less expected, as with createLink,
+although I can't articulate precisely why.  Word 2007 and OpenOffice.org 3.2.1
+(Ubuntu) seem to give an option to remove the whole link or none of it, which
+backs the spec's requirement.  See also #whatwg logs starting at 2011-05-13 at
+16:53 EDT (UTC-0400).
+
+<p>See comment for <span>the <code title>createLink</code> command</span> about
+indeterm/state/value.
+</div>
 
 <p><span>Action</span>:
 
@@ -3897,12 +3907,6 @@
   <li><span>Clear the value</span> of each member of <var>hyperlinks</var>.
 </ol>
 
-<p class=comments>IE10PP2, Firefox 7.0a2, Chrome 14 dev, and Opera 11.50 all do
-not support indeterminate, state, or value for createLink or unlink.  I define
-indeterminate and value anyway because they make sense.
-
-<p><span>Standard inline value command</span>
-
 <!-- @} -->
 
 <h2>Block formatting commands</h2>