Revert "Remove indeterm/state/value for createLink/unlink"
authorAryeh Gregor <AryehGregor+gitcommit@gmail.com>
Thu, 15 Sep 2011 15:18:48 -0600
changeset 583 2d9559086d05
parent 582 d0760b6d50a5
child 584 3cc579b879ac
Revert "Remove indeterm/state/value for createLink/unlink"

Commit was broken, since the record current states and values algorithm
calls queryCommandValue("createlink").
conformancetest/runtest.html
editing.html
implementation.js
source.html
--- a/conformancetest/runtest.html	Thu Sep 15 15:08:20 2011 -0600
+++ b/conformancetest/runtest.html	Thu Sep 15 15:18:48 2011 -0600
@@ -143,6 +143,10 @@
 			"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:08:20 2011 -0600
+++ b/editing.html	Thu Sep 15 15:18:48 2011 -0600
@@ -3071,20 +3071,10 @@
 
 <h3 id=the-createlink-command><dfn>The <code title="">createLink</code> command</dfn></h3>
 
-<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 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.
 
 <p><a href=#action>Action</a>:
 
@@ -3133,6 +3123,12 @@
   <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>
 
@@ -3869,17 +3865,12 @@
 
 <h3 id=the-unlink-command><dfn>The <code title="">unlink</code> command</dfn></h3>
 
-<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 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).
 
 <p><a href=#action>Action</a>:
 
@@ -3891,6 +3882,12 @@
   <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:08:20 2011 -0600
+++ b/implementation.js	Thu Sep 15 15:18:48 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:08:20 2011 -0600
+++ b/source.html	Thu Sep 15 15:18:48 2011 -0600
@@ -3078,21 +3078,10 @@
 <!-- @} -->
 <h3><dfn>The <code title>createLink</code> command</dfn></h3>
 <!-- @{ -->
-<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 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.
 
 <p><span>Action</span>:
 
@@ -3141,6 +3130,12 @@
   <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>
 <!-- @{ -->
@@ -3885,17 +3880,12 @@
 <!-- @} -->
 <h3><dfn>The <code title>unlink</code> command</dfn></h3>
 <!-- @{ -->
-<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 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).
 
 <p><span>Action</span>:
 
@@ -3907,6 +3897,12 @@
   <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>