--- 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'],
],
//@}
};