Further adjustments to override handling
authorAryeh Gregor <AryehGregor+gitcommit@gmail.com>
Sun, 24 Jul 2011 13:10:41 -0600
changeset 451 80f3db3d3c43
parent 450 7b57df8ca2ed
child 452 cb1c39c37cb8
Further adjustments to override handling
editcommands.html
implementation.js
manualtest.js
source.html
tests.js
--- a/editcommands.html	Sun Jul 24 13:10:06 2011 -0600
+++ b/editcommands.html	Sun Jul 24 13:10:41 2011 -0600
@@ -1010,24 +1010,40 @@
   <li>Let <var title="">overrides</var> be a list of (string, string or boolean) ordered
   pairs, initially empty.
 
-  <li>Add ("createLink", <code title=queryCommandValue()><a href=#querycommandvalue()>queryCommandValue("createLink")</a></code>) to
+  <li>Let <var title="">node</var> be the first <a href=#editable>editable</a> <code class=external data-anolis-spec=domcore><a href=http://dvcs.w3.org/hg/domcore/raw-file/tip/Overview.html#text>Text</a></code> node
+  <a href=#effectively-contained>effectively contained</a> in the <a href=#active-range>active range</a>, or null
+  if there is none.
+
+  <li>If <var title="">node</var> is null, return <var title="">overrides</var>.
+
+  <li>Add ("createLink", <a href=#value>value</a> for "createLink") to
   <var title="">overrides</var>.
 
   <li>For each <var title="">command</var> in the list "bold", "italic",
-  "strikethrough", "subscript", "superscript", "underline", in order: add
-  (<var title="">command</var>, <code title=queryCommandState()><a href=#querycommandstate()>queryCommandState(<var title="">command</var>)</a></code>) to
-  <var title="">overrides</var>.
+  "strikethrough", "subscript", "superscript", "underline", in order: if
+  <var title="">node</var>'s <a href=#effective-command-value>effective command value</a> for <var title="">command</var>
+  is one of its <a href=#inline-command-activated-values>inline command activated values</a>, add
+  (<var title="">command</var>, true) to <var title="">overrides</var>, and otherwise add
+  (<var title="">command</var>, false) to <var title="">overrides</var>.
+  <!--
+  Thus we will set state overrides based on the first editable text node, to
+  match values.  This means that if you have <p>foo<b>[bar</b>baz]</p> and hit
+  backspace and hit A, you'll get <p>foo<b>a[]</b></p>, although bold was
+  previously indeterminate.  This is needed to match the behavior of hitting A
+  straight away, since innerText doesn't strip wrappers when it invokes "delete
+  the contents".
+  -->
 
   <li>For each <var title="">command</var> in the list "fontName", "fontSize",
-  "foreColor", "hiliteColor", in order: add (<var title="">command</var>, <code title=queryCommandValue()><a href=#querycommandvalue()>queryCommandValue(<var title="">command</var>)</a></code>) to
-  <var title="">overrides</var>.
+  "foreColor", "hiliteColor", in order: add (<var title="">command</var>,
+  <var title="">command</var>'s <a href=#value>value</a>) to <var title="">overrides</var>.
 
   <li>Return <var title="">overrides</var>.
 </ol>
 
 <p>To <dfn id=restore-states-and-values>restore states and values</dfn> specified by a list
-<var title="">overrides</var> returned by the <a href=#record-current-states-and-values>record current states and
-values</a> algorithm:
+<var title="">overrides</var> returned by the <a href=#record-current-overrides>record current overrides</a> or
+<a href=#record-current-states-and-values>record current states and values</a> algorithm:
 
 <ol>
   <li>If there is some <a href=#editable>editable</a> <code class=external data-anolis-spec=domcore><a href=http://dvcs.w3.org/hg/domcore/raw-file/tip/Overview.html#text>Text</a></code> node <a href=#effectively-contained>effectively
@@ -6928,8 +6944,19 @@
   defined behavior in this case at all, so I follow Chrome.
 
   IE9, Firefox 7.0a2, Chrome 14 dev, and Opera 11.50 all don't strip wrappers,
-  except that as usual, Gecko doesn't if you select the whole wrapper, like
-  {<b>foo</b>}.
+  except that as usual, Gecko does if you select the whole wrapper, like
+  {<b>foo</b>}.  Also, Chrome 14 dev seems to strip the wrapper and try
+  recreating the style in cases like <b>[foo</b>bar], where it starts in a
+  wrapper but ends after it; this doesn't always work so well, so I don't do
+  it.  Firefox 7.0a2 also has the deletion set overrides for indeterminate
+  state commands, so if you run insertText on [foo<b>bar</b>baz] it will make
+  the result bold.
+
+  These things don't make any sense to me, so I don't do them.  I set overrides
+  based on the first editable text node in the range when deleting; preserve
+  any wrappers at the start of the range; and restore the overrides in case
+  preserving the wrappers isn't enough (like if they weren't set by deletion at
+  all).  This behavior seems to closely match IE9.
   -->
 
   <li>If the <a href=#active-range>active range</a>'s <a class=external data-anolis-spec=domrange href=http://html5.org/specs/dom-range.html#concept-range-start title=concept-range-start>start</a> <a class=external data-anolis-spec=domrange href=http://html5.org/specs/dom-range.html#concept-boundary-point-node title=concept-boundary-point-node>node</a> is neither
--- a/implementation.js	Sun Jul 24 13:10:06 2011 -0600
+++ b/implementation.js	Sun Jul 24 13:10:41 2011 -0600
@@ -1277,22 +1277,38 @@
 	// initially empty."
 	var overrides = [];
 
-	// "Add ("createLink", queryCommandValue("createLink")) to overrides."
-	overrides.push(["createlink", myQueryCommandValue("createlink")]);
+	// "Let node be the first editable Text node effectively contained in the
+	// active range, or null if there is none."
+	var node = getAllEffectivelyContainedNodes(getActiveRange())
+		.filter(function(node) { return isEditable(node) && node.nodeType == Node.TEXT_NODE })[0];
+
+	// "If node is null, return overrides."
+	if (!node) {
+		return overrides;
+	}
+
+	// "Add ("createLink", value for "createLink") to overrides."
+	overrides.push(["createlink", commands.createlink.value()]);
 
 	// "For each command in the list "bold", "italic", "strikethrough",
-	// "subscript", "superscript", "underline", in order: add (command,
-	// queryCommandState(command)) to overrides."
+	// "subscript", "superscript", "underline", in order: if node's effective
+	// command value for command is one of its inline command activated values,
+	// add (command, true) to overrides, and otherwise add (command, false) to
+	// overrides."
 	["bold", "italic", "strikethrough", "subscript", "superscript",
 	"underline"].forEach(function(command) {
-		overrides.push([command, myQueryCommandState(command)]);
+		if (commands[command].inlineCommandActivatedValues
+		.indexOf(getEffectiveCommandValue(node, command)) != -1) {
+			overrides.push([command, true]);
+		} else {
+			overrides.push([command, false]);
+		}
 	});
 
 	// "For each command in the list "fontName", "fontSize", "foreColor",
-	// "hiliteColor", in order: add (command, queryCommandValue(command)) to
-	// overrides."
+	// "hiliteColor", in order: add (command, command's value) to overrides."
 	["fontname", "fontsize", "forecolor", "hilitecolor"].forEach(function(command) {
-		overrides.push([command, myQueryCommandValue(command)]);
+		overrides.push([command, commands[command].value()]);
 	});
 
 	// "Return overrides."
--- a/manualtest.js	Sun Jul 24 13:10:06 2011 -0600
+++ b/manualtest.js	Sun Jul 24 13:10:41 2011 -0600
@@ -25,6 +25,10 @@
 
 var numManualTests = 0;
 
+// Make sure styleWithCss is always reset to false at the start of a test run
+// (I'm looking at you, Firefox)
+try { document.execCommand("stylewithcss", false, "false") } catch(e) {}
+
 function runTests() {
 //@{
 	// We don't ask the user to hit a key on all tests, so make sure not to
--- a/source.html	Sun Jul 24 13:10:06 2011 -0600
+++ b/source.html	Sun Jul 24 13:10:41 2011 -0600
@@ -964,27 +964,40 @@
   <li>Let <var>overrides</var> be a list of (string, string or boolean) ordered
   pairs, initially empty.
 
-  <li>Add ("createLink", <code
-  title=queryCommandValue()>queryCommandValue("createLink")</code>) to
+  <li>Let <var>node</var> be the first <span>editable</span> [[text]] node
+  <span>effectively contained</span> in the <span>active range</span>, or null
+  if there is none.
+
+  <li>If <var>node</var> is null, return <var>overrides</var>.
+
+  <li>Add ("createLink", <span>value</span> for "createLink") to
   <var>overrides</var>.
 
   <li>For each <var>command</var> in the list "bold", "italic",
-  "strikethrough", "subscript", "superscript", "underline", in order: add
-  (<var>command</var>, <code
-  title=queryCommandState()>queryCommandState(<var>command</var>)</code>) to
-  <var>overrides</var>.
+  "strikethrough", "subscript", "superscript", "underline", in order: if
+  <var>node</var>'s <span>effective command value</span> for <var>command</var>
+  is one of its <span>inline command activated values</span>, add
+  (<var>command</var>, true) to <var>overrides</var>, and otherwise add
+  (<var>command</var>, false) to <var>overrides</var>.
+  <!--
+  Thus we will set state overrides based on the first editable text node, to
+  match values.  This means that if you have <p>foo<b>[bar</b>baz]</p> and hit
+  backspace and hit A, you'll get <p>foo<b>a[]</b></p>, although bold was
+  previously indeterminate.  This is needed to match the behavior of hitting A
+  straight away, since innerText doesn't strip wrappers when it invokes "delete
+  the contents".
+  -->
 
   <li>For each <var>command</var> in the list "fontName", "fontSize",
-  "foreColor", "hiliteColor", in order: add (<var>command</var>, <code
-  title=queryCommandValue()>queryCommandValue(<var>command</var>)</code>) to
-  <var>overrides</var>.
+  "foreColor", "hiliteColor", in order: add (<var>command</var>,
+  <var>command</var>'s <span>value</span>) to <var>overrides</var>.
 
   <li>Return <var>overrides</var>.
 </ol>
 
 <p>To <dfn>restore states and values</dfn> specified by a list
-<var>overrides</var> returned by the <span>record current states and
-values</span> algorithm:
+<var>overrides</var> returned by the <span>record current overrides</span> or
+<span>record current states and values</span> algorithm:
 
 <ol>
   <li>If there is some <span>editable</span> [[text]] node <span>effectively
@@ -6937,8 +6950,19 @@
   defined behavior in this case at all, so I follow Chrome.
 
   IE9, Firefox 7.0a2, Chrome 14 dev, and Opera 11.50 all don't strip wrappers,
-  except that as usual, Gecko doesn't if you select the whole wrapper, like
-  {<b>foo</b>}.
+  except that as usual, Gecko does if you select the whole wrapper, like
+  {<b>foo</b>}.  Also, Chrome 14 dev seems to strip the wrapper and try
+  recreating the style in cases like <b>[foo</b>bar], where it starts in a
+  wrapper but ends after it; this doesn't always work so well, so I don't do
+  it.  Firefox 7.0a2 also has the deletion set overrides for indeterminate
+  state commands, so if you run insertText on [foo<b>bar</b>baz] it will make
+  the result bold.
+
+  These things don't make any sense to me, so I don't do them.  I set overrides
+  based on the first editable text node in the range when deleting; preserve
+  any wrappers at the start of the range; and restore the overrides in case
+  preserving the wrappers isn't enough (like if they weren't set by deletion at
+  all).  This behavior seems to closely match IE9.
   -->
 
   <li>If the <span>active range</span>'s [[startnode]] is neither
--- a/tests.js	Sun Jul 24 13:10:06 2011 -0600
+++ b/tests.js	Sun Jul 24 13:10:41 2011 -0600
@@ -2160,7 +2160,80 @@
 		'<p>foo<span style=color:#aBcDeF>[bar</span>baz]',
 		'<p>foo<span style=color:#aBcDeF>{bar</span>baz}',
 		'<p>foo<span style=color:#aBcDeF>[bar</span><span style=color:#fEdCbA>baz]</span>quz',
-		'foo<a href=http://www.google.com/><font color=black>[bar]</font></a>baz',
+
+
+		// These are like the corresponding tests in the multitest section, but
+		// because the selection isn't collapsed, we don't need to do
+		// multitests to set overrides.
+		'foo<b>[bar]</b>baz',
+		'foo<i>[bar]</i>baz',
+		'foo<s>[bar]</s>baz',
+		'foo<sub>[bar]</sub>baz',
+		'foo<sup>[bar]</sup>baz',
+		'foo<u>[bar]</u>baz',
+		'foo<a href=http://www.google.com>[bar]</a>baz',
+		'foo<font face=sans-serif>[bar]</font>baz',
+		'foo<font size=4>[bar]</font>baz',
+		'foo<font color=#0000FF>[bar]</font>baz',
+		'foo<span style=background-color:#00FFFF>[bar]</span>baz',
+		'foo<a href=http://www.google.com><font color=blue>[bar]</font></a>baz',
+		'foo<font color=blue><a href=http://www.google.com>[bar]</a></font>baz',
+		'foo<a href=http://www.google.com><font color=brown>[bar]</font></a>baz',
+		'foo<font color=brown><a href=http://www.google.com>[bar]</a></font>baz',
+		'foo<a href=http://www.google.com><font color=black>[bar]</font></a>baz',
+		'foo<a href=http://www.google.com><u>[bar]</u></a>baz',
+		'foo<u><a href=http://www.google.com>[bar]</a></u>baz',
+		'foo<sub><font size=2>[bar]</font></sub>baz',
+		'foo<font size=2><sub>[bar]</sub></font>baz',
+		'foo<sub><font size=3>[bar]</font></sub>baz',
+		'foo<font size=3><sub>[bar]</sub></font>baz',
+
+		// Now repeat but with different selections.
+		'[foo<b>bar]</b>baz',
+		'[foo<i>bar]</i>baz',
+		'[foo<s>bar]</s>baz',
+		'[foo<sub>bar]</sub>baz',
+		'[foo<sup>bar]</sup>baz',
+		'[foo<u>bar]</u>baz',
+		'[foo<a href=http://www.google.com>bar]</a>baz',
+		'[foo<font face=sans-serif>bar]</font>baz',
+		'[foo<font size=4>bar]</font>baz',
+		'[foo<font color=#0000FF>bar]</font>baz',
+		'[foo<span style=background-color:#00FFFF>bar]</span>baz',
+		'[foo<a href=http://www.google.com><font color=blue>bar]</font></a>baz',
+		'[foo<font color=blue><a href=http://www.google.com>bar]</a></font>baz',
+		'[foo<a href=http://www.google.com><font color=brown>bar]</font></a>baz',
+		'[foo<font color=brown><a href=http://www.google.com>bar]</a></font>baz',
+		'[foo<a href=http://www.google.com><font color=black>bar]</font></a>baz',
+		'[foo<a href=http://www.google.com><u>bar]</u></a>baz',
+		'[foo<u><a href=http://www.google.com>bar]</a></u>baz',
+		'[foo<sub><font size=2>bar]</font></sub>baz',
+		'[foo<font size=2><sub>bar]</sub></font>baz',
+		'[foo<sub><font size=3>bar]</font></sub>baz',
+		'[foo<font size=3><sub>bar]</sub></font>baz',
+
+		'foo<b>[bar</b>baz]',
+		'foo<i>[bar</i>baz]',
+		'foo<s>[bar</s>baz]',
+		'foo<sub>[bar</sub>baz]',
+		'foo<sup>[bar</sup>baz]',
+		'foo<u>[bar</u>baz]',
+		'foo<a href=http://www.google.com>[bar</a>baz]',
+		'foo<font face=sans-serif>[bar</font>baz]',
+		'foo<font size=4>[bar</font>baz]',
+		'foo<font color=#0000FF>[bar</font>baz]',
+		'foo<span style=background-color:#00FFFF>[bar</span>baz]',
+		'foo<a href=http://www.google.com><font color=blue>[bar</font></a>baz]',
+		'foo<font color=blue><a href=http://www.google.com>[bar</a></font>baz]',
+		'foo<a href=http://www.google.com><font color=brown>[bar</font></a>baz]',
+		'foo<font color=brown><a href=http://www.google.com>[bar</a></font>baz]',
+		'foo<a href=http://www.google.com><font color=black>[bar</font></a>baz]',
+		'foo<a href=http://www.google.com><u>[bar</u></a>baz]',
+		'foo<u><a href=http://www.google.com>[bar</a></u>baz]',
+		'foo<sub><font size=2>[bar</font></sub>baz]',
+		'foo<font size=2><sub>[bar</sub></font>baz]',
+		'foo<sub><font size=3>[bar</font></sub>baz]',
+		'foo<font size=3><sub>[bar</sub></font>baz]',
 	],
 	//@}
 	insertunorderedlist: [
@@ -3385,40 +3458,79 @@
 		['foo[]bar', ['fontsize', '3'], 'subscript', ['inserttext', 'a']],
 
 
-		// Now the same tests, but with a nonempty selection
-		['foo[bar]baz', 'bold', ['inserttext', 'a']],
-		['foo[bar]baz', 'italic', ['inserttext', 'a']],
-		['foo[bar]baz', 'strikethrough', ['inserttext', 'a']],
-		['foo[bar]baz', 'subscript', ['inserttext', 'a']],
-		['foo[bar]baz', 'superscript', ['inserttext', 'a']],
-		['foo[bar]baz', 'underline', ['inserttext', 'a']],
-
-		['foo[bar]baz', 'createlink', ['inserttext', 'a']],
-		['foo[bar]baz', 'fontname', ['inserttext', 'a']],
-		['foo[bar]baz', 'fontsize', ['inserttext', 'a']],
-		['foo[bar]baz', 'forecolor', ['inserttext', 'a']],
-		['foo[bar]baz', 'hilitecolor', ['inserttext', 'a']],
-
-		['foo[bar]baz', 'superscript', 'subscript', ['inserttext', 'a']],
-		['foo[bar]baz', 'subscript', 'superscript', ['inserttext', 'a']],
-
-		['foo[bar]baz', 'createlink', ['forecolor', '#0000FF'], ['inserttext', 'a']],
-		['foo[bar]baz', ['forecolor', '#0000FF'], 'createlink', ['inserttext', 'a']],
-		['foo[bar]baz', 'createlink', ['forecolor', 'blue'], ['inserttext', 'a']],
-		['foo[bar]baz', ['forecolor', 'blue'], 'createlink', ['inserttext', 'a']],
-		['foo[bar]baz', 'createlink', ['forecolor', 'brown'], ['inserttext', 'a']],
-		['foo[bar]baz', ['forecolor', 'brown'], 'createlink', ['inserttext', 'a']],
-		['foo[bar]baz', 'createlink', ['forecolor', 'black'], ['inserttext', 'a']],
-		['foo[bar]baz', ['forecolor', 'black'], 'createlink', ['inserttext', 'a']],
-		['foo[bar]baz', 'createlink', 'underline', ['inserttext', 'a']],
-		['foo[bar]baz', 'underline', 'createlink', ['inserttext', 'a']],
-		['foo[bar]baz', 'createlink', 'underline', 'underline', ['inserttext', 'a']],
-		['foo[bar]baz', 'underline', 'underline', 'createlink', ['inserttext', 'a']],
-
-		['foo[bar]baz', 'subscript', ['fontsize', '2'], ['inserttext', 'a']],
-		['foo[bar]baz', ['fontsize', '2'], 'subscript', ['inserttext', 'a']],
-		['foo[bar]baz', 'subscript', ['fontsize', '3'], ['inserttext', 'a']],
-		['foo[bar]baz', ['fontsize', '3'], 'subscript', ['inserttext', 'a']],
+		// The following are all just inserttext tests that we took from there,
+		// but we first backspace the selected text instead of letting
+		// inserttext handle it.  This tests that deletion correctly sets
+		// overrides.
+		['foo<b>[bar]</b>baz', 'delete', 'inserttext'],
+		['foo<i>[bar]</i>baz', 'delete', 'inserttext'],
+		['foo<s>[bar]</s>baz', 'delete', 'inserttext'],
+		['foo<sub>[bar]</sub>baz', 'delete', 'inserttext'],
+		['foo<sup>[bar]</sup>baz', 'delete', 'inserttext'],
+		['foo<u>[bar]</u>baz', 'delete', 'inserttext'],
+		['foo<a href=http://www.google.com>[bar]</a>baz', 'delete', 'inserttext'],
+		['foo<font face=sans-serif>[bar]</font>baz', 'delete', 'inserttext'],
+		['foo<font size=4>[bar]</font>baz', 'delete', 'inserttext'],
+		['foo<font color=#0000FF>[bar]</font>baz', 'delete', 'inserttext'],
+		['foo<span style=background-color:#00FFFF>[bar]</span>baz', 'delete', 'inserttext'],
+		['foo<a href=http://www.google.com><font color=blue>[bar]</font></a>baz', 'delete', 'inserttext'],
+		['foo<font color=blue><a href=http://www.google.com>[bar]</a></font>baz', 'delete', 'inserttext'],
+		['foo<a href=http://www.google.com><font color=brown>[bar]</font></a>baz', 'delete', 'inserttext'],
+		['foo<font color=brown><a href=http://www.google.com>[bar]</a></font>baz', 'delete', 'inserttext'],
+		['foo<a href=http://www.google.com><font color=black>[bar]</font></a>baz', 'delete', 'inserttext'],
+		['foo<a href=http://www.google.com><u>[bar]</u></a>baz', 'delete', 'inserttext'],
+		['foo<u><a href=http://www.google.com>[bar]</a></u>baz', 'delete', 'inserttext'],
+		['foo<sub><font size=2>[bar]</font></sub>baz', 'delete', 'inserttext'],
+		['foo<font size=2><sub>[bar]</sub></font>baz', 'delete', 'inserttext'],
+		['foo<sub><font size=3>[bar]</font></sub>baz', 'delete', 'inserttext'],
+		['foo<font size=3><sub>[bar]</sub></font>baz', 'delete', 'inserttext'],
+
+		// Now repeat but with different selections.
+		['[foo<b>bar]</b>baz', 'delete', 'inserttext'],
+		['[foo<i>bar]</i>baz', 'delete', 'inserttext'],
+		['[foo<s>bar]</s>baz', 'delete', 'inserttext'],
+		['[foo<sub>bar]</sub>baz', 'delete', 'inserttext'],
+		['[foo<sup>bar]</sup>baz', 'delete', 'inserttext'],
+		['[foo<u>bar]</u>baz', 'delete', 'inserttext'],
+		['[foo<a href=http://www.google.com>bar]</a>baz', 'delete', 'inserttext'],
+		['[foo<font face=sans-serif>bar]</font>baz', 'delete', 'inserttext'],
+		['[foo<font size=4>bar]</font>baz', 'delete', 'inserttext'],
+		['[foo<font color=#0000FF>bar]</font>baz', 'delete', 'inserttext'],
+		['[foo<span style=background-color:#00FFFF>bar]</span>baz', 'delete', 'inserttext'],
+		['[foo<a href=http://www.google.com><font color=blue>bar]</font></a>baz', 'delete', 'inserttext'],
+		['[foo<font color=blue><a href=http://www.google.com>bar]</a></font>baz', 'delete', 'inserttext'],
+		['[foo<a href=http://www.google.com><font color=brown>bar]</font></a>baz', 'delete', 'inserttext'],
+		['[foo<font color=brown><a href=http://www.google.com>bar]</a></font>baz', 'delete', 'inserttext'],
+		['[foo<a href=http://www.google.com><font color=black>bar]</font></a>baz', 'delete', 'inserttext'],
+		['[foo<a href=http://www.google.com><u>bar]</u></a>baz', 'delete', 'inserttext'],
+		['[foo<u><a href=http://www.google.com>bar]</a></u>baz', 'delete', 'inserttext'],
+		['[foo<sub><font size=2>bar]</font></sub>baz', 'delete', 'inserttext'],
+		['[foo<font size=2><sub>bar]</sub></font>baz', 'delete', 'inserttext'],
+		['[foo<sub><font size=3>bar]</font></sub>baz', 'delete', 'inserttext'],
+		['[foo<font size=3><sub>bar]</sub></font>baz', 'delete', 'inserttext'],
+
+		['foo<b>[bar</b>baz]', 'delete', 'inserttext'],
+		['foo<i>[bar</i>baz]', 'delete', 'inserttext'],
+		['foo<s>[bar</s>baz]', 'delete', 'inserttext'],
+		['foo<sub>[bar</sub>baz]', 'delete', 'inserttext'],
+		['foo<sup>[bar</sup>baz]', 'delete', 'inserttext'],
+		['foo<u>[bar</u>baz]', 'delete', 'inserttext'],
+		['foo<a href=http://www.google.com>[bar</a>baz]', 'delete', 'inserttext'],
+		['foo<font face=sans-serif>[bar</font>baz]', 'delete', 'inserttext'],
+		['foo<font size=4>[bar</font>baz]', 'delete', 'inserttext'],
+		['foo<font color=#0000FF>[bar</font>baz]', 'delete', 'inserttext'],
+		['foo<span style=background-color:#00FFFF>[bar</span>baz]', 'delete', 'inserttext'],
+		['foo<a href=http://www.google.com><font color=blue>[bar</font></a>baz]', 'delete', 'inserttext'],
+		['foo<font color=blue><a href=http://www.google.com>[bar</a></font>baz]', 'delete', 'inserttext'],
+		['foo<a href=http://www.google.com><font color=brown>[bar</font></a>baz]', 'delete', 'inserttext'],
+		['foo<font color=brown><a href=http://www.google.com>[bar</a></font>baz]', 'delete', 'inserttext'],
+		['foo<a href=http://www.google.com><font color=black>[bar</font></a>baz]', 'delete', 'inserttext'],
+		['foo<a href=http://www.google.com><u>[bar</u></a>baz]', 'delete', 'inserttext'],
+		['foo<u><a href=http://www.google.com>[bar</a></u>baz]', 'delete', 'inserttext'],
+		['foo<sub><font size=2>[bar</font></sub>baz]', 'delete', 'inserttext'],
+		['foo<font size=2><sub>[bar</sub></font>baz]', 'delete', 'inserttext'],
+		['foo<sub><font size=3>[bar</font></sub>baz]', 'delete', 'inserttext'],
+		['foo<font size=3><sub>[bar</sub></font>baz]', 'delete', 'inserttext'],
 	],
 	//@}
 };