diff options
Diffstat (limited to 'testing/web-platform/tests/editing/data/inserttext.js')
-rw-r--r-- | testing/web-platform/tests/editing/data/inserttext.js | 1474 |
1 files changed, 1474 insertions, 0 deletions
diff --git a/testing/web-platform/tests/editing/data/inserttext.js b/testing/web-platform/tests/editing/data/inserttext.js new file mode 100644 index 0000000000..ab73a2ac49 --- /dev/null +++ b/testing/web-platform/tests/editing/data/inserttext.js @@ -0,0 +1,1474 @@ +// For documentation of the format, see README in this directory. +var browserTests = [ +["foo[bar]baz", + [["inserttext","a"]], + "fooa[]baz", + [true], + {"inserttext":[false,false,"",false,false,""]}], +["foo[bar]baz", + [["inserttext",""]], + "foo[]baz", + [true], + {"inserttext":[false,false,"",false,false,""]}], +["foo[]bar", + [["inserttext","\t"]], + "foo\t[]bar", + [true], + {"inserttext":[false,false,"",false,false,""]}], +["foo[]bar", + [["inserttext","&"]], + "foo&[]bar", + [true], + {"inserttext":[false,false,"",false,false,""]}], +["foo[]bar", + [["defaultparagraphseparator","div"],["inserttext","\n"]], + "<div>foo</div><div>{}bar</div>", + [true,true], + {"defaultparagraphseparator":[false,false,"div",false,false,"div"],"inserttext":[false,false,"",false,false,""]}], +["foo[]bar", + [["defaultparagraphseparator","p"],["inserttext","\n"]], + "<p>foo</p><p>{}bar</p>", + [true,true], + {"defaultparagraphseparator":[false,false,"div",false,false,"p"],"inserttext":[false,false,"",false,false,""]}], +["foo[]bar", + [["defaultparagraphseparator","div"],["inserttext","abc\ndef"]], + "<div>fooabc</div><div>def[]bar</div>", + [true,true], + {"defaultparagraphseparator":[false,false,"p",false,false,"div"],"inserttext":[false,false,"",false,false,""]}], +["foo[]bar", + [["defaultparagraphseparator","p"],["inserttext","abc\ndef"]], + "<p>fooabc</p><p>def[]bar</p>", + [true,true], + {"defaultparagraphseparator":[false,false,"div",false,false,"p"],"inserttext":[false,false,"",false,false,""]}], +["foo[]bar", + [["inserttext","\u0007"]], + "foo\u0007[]bar", + [true], + {"inserttext":[false,false,"",false,false,""]}], +["foo[]bar", + [["inserttext","<b>hi</b>"]], + "foo<b>hi</b>[]bar", + [true], + {"inserttext":[false,false,"",false,false,""]}], +["foo[]bar", + [["inserttext","<"]], + "foo<[]bar", + [true], + {"inserttext":[false,false,"",false,false,""]}], +["foo[]bar", + [["inserttext","&"]], + "foo&amp;[]bar", + [true], + {"inserttext":[false,false,"",false,false,""]}], +["foo[]bar", + [["inserttext"," "]], + "foo []bar", + [true], + {"inserttext":[false,false,"",false,false,""]}], +["foo []bar", + [["inserttext"," "]], + "foo []bar", + [true], + {"inserttext":[false,false,"",false,false,""]}], +["foo[] bar", + [["inserttext"," "]], + "foo [] bar", + [true], + {"inserttext":[false,false,"",false,false,""]}], +["foo []bar", + [["inserttext"," "]], + "foo []bar", + [true], + {"inserttext":[false,false,"",false,false,""]}], +["foo [] bar", + [["inserttext"," "]], + "foo [] bar", + [true], + {"inserttext":[false,false,"",false,false,""]}], +["foo[] bar", + [["inserttext"," "]], + "foo [] bar", + [true], + {"inserttext":[false,false,"",false,false,""]}], +["foo []bar", + [["inserttext"," "]], + "foo []bar", + [true], + {"inserttext":[false,false,"",false,false,""]}], +["foo [] bar", + [["inserttext"," "]], + "foo [] bar", + [true], + {"inserttext":[false,false,"",false,false,""]}], +["foo[] bar", + [["inserttext"," "]], + "foo [] bar", + [true], + {"inserttext":[false,false,"",false,false,""]}], +["foo []bar", + [["inserttext"," "]], + "foo []bar", + [true], + {"inserttext":[false,false,"",false,false,""]}], +["foo [] bar", + [["inserttext"," "]], + "foo [] bar", + [true], + {"inserttext":[false,false,"",false,false,""]}], +["foo[] bar", + [["inserttext"," "]], + "foo [] bar", + [true], + {"inserttext":[false,false,"",false,false,""]}], +["foo [] bar", + [["inserttext"," "]], + "foo [] bar", + [true], + {"inserttext":[false,false,"",false,false,""]}], +["foo []bar", + [["inserttext"," "]], + "foo []bar", + [true], + {"inserttext":[false,false,"",false,false,""]}], +["foo [] bar", + [["inserttext"," "]], + "foo [] bar", + [true], + {"inserttext":[false,false,"",false,false,""]}], +["[]foo", + [["inserttext"," "]], + " []foo", + [true], + {"inserttext":[false,false,"",false,false,""]}], +["{}foo", + [["inserttext"," "]], + " []foo", + [true], + {"inserttext":[false,false,"",false,false,""]}], +["foo[]", + [["inserttext"," "]], + "foo []", + [true], + {"inserttext":[false,false,"",false,false,""]}], +["foo{}", + [["inserttext"," "]], + "foo []", + [true], + {"inserttext":[false,false,"",false,false,""]}], +["foo []", + [["inserttext"," "]], + "foo []", + [true], + {"inserttext":[false,false,"",false,false,""]}], +["foo {}", + [["inserttext"," "]], + "foo []", + [true], + {"inserttext":[false,false,"",false,false,""]}], +["foo []", + [["inserttext"," "]], + "foo []", + [true], + {"inserttext":[false,false,"",false,false,""]}], +["foo {}", + [["inserttext"," "]], + "foo []", + [true], + {"inserttext":[false,false,"",false,false,""]}], +["<b>foo[]</b>bar", + [["inserttext"," "]], + "<b>foo []</b>bar", + [true], + {"inserttext":[false,false,"",false,false,""]}], +["foo[]<b>bar</b>", + [["inserttext"," "]], + "foo []<b>bar</b>", + [true], + {"inserttext":[false,false,"",false,false,""]}], +["foo[] ", + [["inserttext"," "]], + "foo []", + [true], + {"inserttext":[false,false,"",false,false,""]}], +[" foo [] ", + [["inserttext"," "]], + " foo []", + [true], + {"inserttext":[false,false,"",false,false,""]}], +["foo[]<span> </span>", + [["inserttext"," "]], + "foo []<span> </span>", + [true], + {"inserttext":[false,false,"",false,false,""]}], +["foo[]<span> </span> ", + [["inserttext"," "]], + "foo []<span> </span> ", + [true], + {"inserttext":[false,false,"",false,false,""]}], +[" []foo", + [["inserttext"," "]], + " []foo", + [true], + {"inserttext":[false,false,"",false,false,""]}], +[" [] foo ", + [["inserttext"," "]], + " []foo ", + [true], + {"inserttext":[false,false,"",false,false,""]}], +["<span> </span>[]foo", + [["inserttext"," "]], + "<span> </span> []foo", + [true], + {"inserttext":[false,false,"",false,false,""]}], +[" <span> </span>[]foo", + [["inserttext"," "]], + " <span> </span> []foo", + [true], + {"inserttext":[false,false,"",false,false,""]}], +["{}<br>", + [["inserttext"," "]], + " []", + [true], + {"inserttext":[false,false,"",false,false,""]}], +["<p>{}<br>", + [["inserttext"," "]], + "<p> []</p>", + [true], + {"inserttext":[false,false,"",false,false,""]}], +["<p>foo[]<p>bar", + [["inserttext"," "]], + "<p>foo []</p><p>bar</p>", + [true], + {"inserttext":[false,false,"",false,false,""]}], +["<p>foo []<p>bar", + [["inserttext"," "]], + "<p>foo []</p><p>bar</p>", + [true], + {"inserttext":[false,false,"",false,false,""]}], +["<p>foo[]<p> bar", + [["inserttext"," "]], + "<p>foo []</p><p> bar</p>", + [true], + {"inserttext":[false,false,"",false,false,""]}], +["<pre>foo[]bar</pre>", + [["inserttext"," "]], + "<pre>foo []bar</pre>", + [true], + {"inserttext":[false,false,"",false,false,""]}], +["<pre>foo []bar</pre>", + [["inserttext"," "]], + "<pre>foo []bar</pre>", + [true], + {"inserttext":[false,false,"",false,false,""]}], +["<pre>foo[] bar</pre>", + [["inserttext"," "]], + "<pre>foo [] bar</pre>", + [true], + {"inserttext":[false,false,"",false,false,""]}], +["<pre>foo []bar</pre>", + [["inserttext"," "]], + "<pre>foo []bar</pre>", + [true], + {"inserttext":[false,false,"",false,false,""]}], +["<pre>[]foo</pre>", + [["inserttext"," "]], + "<pre> []foo</pre>", + [true], + {"inserttext":[false,false,"",false,false,""]}], +["<pre>foo[]</pre>", + [["inserttext"," "]], + "<pre>foo []</pre>", + [true], + {"inserttext":[false,false,"",false,false,""]}], +["<pre>foo []</pre>", + [["inserttext"," "]], + "<pre>foo []</pre>", + [true], + {"inserttext":[false,false,"",false,false,""]}], +["<pre> foo [] </pre>", + [["inserttext"," "]], + "<pre> foo [] </pre>", + [true], + {"inserttext":[false,false,"",false,false,""]}], +["<div style=white-space:pre>foo[]bar</div>", + [["inserttext"," "]], + "<div style=\"white-space:pre\">foo []bar</div>", + [true], + {"inserttext":[false,false,"",false,false,""]}], +["<div style=white-space:pre>foo []bar</div>", + [["inserttext"," "]], + "<div style=\"white-space:pre\">foo []bar</div>", + [true], + {"inserttext":[false,false,"",false,false,""]}], +["<div style=white-space:pre>foo[] bar</div>", + [["inserttext"," "]], + "<div style=\"white-space:pre\">foo [] bar</div>", + [true], + {"inserttext":[false,false,"",false,false,""]}], +["<div style=white-space:pre>foo []bar</div>", + [["inserttext"," "]], + "<div style=\"white-space:pre\">foo []bar</div>", + [true], + {"inserttext":[false,false,"",false,false,""]}], +["<div style=white-space:pre>[]foo</div>", + [["inserttext"," "]], + "<div style=\"white-space:pre\"> []foo</div>", + [true], + {"inserttext":[false,false,"",false,false,""]}], +["<div style=white-space:pre>foo[]</div>", + [["inserttext"," "]], + "<div style=\"white-space:pre\">foo []</div>", + [true], + {"inserttext":[false,false,"",false,false,""]}], +["<div style=white-space:pre>foo []</div>", + [["inserttext"," "]], + "<div style=\"white-space:pre\">foo []</div>", + [true], + {"inserttext":[false,false,"",false,false,""]}], +["<div style=white-space:pre> foo [] </div>", + [["inserttext"," "]], + "<div style=\"white-space:pre\"> foo [] </div>", + [true], + {"inserttext":[false,false,"",false,false,""]}], +["<div style=white-space:pre-wrap>foo[]bar</div>", + [["inserttext"," "]], + "<div style=\"white-space:pre-wrap\">foo []bar</div>", + [true], + {"inserttext":[false,false,"",false,false,""]}], +["<div style=white-space:pre-wrap>foo []bar</div>", + [["inserttext"," "]], + "<div style=\"white-space:pre-wrap\">foo []bar</div>", + [true], + {"inserttext":[false,false,"",false,false,""]}], +["<div style=white-space:pre-wrap>foo[] bar</div>", + [["inserttext"," "]], + "<div style=\"white-space:pre-wrap\">foo [] bar</div>", + [true], + {"inserttext":[false,false,"",false,false,""]}], +["<div style=white-space:pre-wrap>foo []bar</div>", + [["inserttext"," "]], + "<div style=\"white-space:pre-wrap\">foo []bar</div>", + [true], + {"inserttext":[false,false,"",false,false,""]}], +["<div style=white-space:pre-wrap>[]foo</div>", + [["inserttext"," "]], + "<div style=\"white-space:pre-wrap\"> []foo</div>", + [true], + {"inserttext":[false,false,"",false,false,""]}], +["<div style=white-space:pre-wrap>foo[]</div>", + [["inserttext"," "]], + "<div style=\"white-space:pre-wrap\">foo []</div>", + [true], + {"inserttext":[false,false,"",false,false,""]}], +["<div style=white-space:pre-wrap>foo []</div>", + [["inserttext"," "]], + "<div style=\"white-space:pre-wrap\">foo []</div>", + [true], + {"inserttext":[false,false,"",false,false,""]}], +["<div style=white-space:pre-wrap> foo [] </div>", + [["inserttext"," "]], + "<div style=\"white-space:pre-wrap\"> foo [] </div>", + [true], + {"inserttext":[false,false,"",false,false,""]}], +["<div style=white-space:pre-line>foo[]bar</div>", + [["inserttext"," "]], + "<div style=\"white-space:pre-line\">foo []bar</div>", + [true], + {"inserttext":[false,false,"",false,false,""]}], +["<div style=white-space:pre-line>foo []bar</div>", + [["inserttext"," "]], + "<div style=\"white-space:pre-line\">foo []bar</div>", + [true], + {"inserttext":[false,false,"",false,false,""]}], +["<div style=white-space:pre-line>foo[] bar</div>", + [["inserttext"," "]], + "<div style=\"white-space:pre-line\">foo [] bar</div>", + [true], + {"inserttext":[false,false,"",false,false,""]}], +["<div style=white-space:pre-line>foo []bar</div>", + [["inserttext"," "]], + "<div style=\"white-space:pre-line\">foo []bar</div>", + [true], + {"inserttext":[false,false,"",false,false,""]}], +["<div style=white-space:pre-line>[]foo</div>", + [["inserttext"," "]], + "<div style=\"white-space:pre-line\"> []foo</div>", + [true], + {"inserttext":[false,false,"",false,false,""]}], +["<div style=white-space:pre-line>foo[]</div>", + [["inserttext"," "]], + "<div style=\"white-space:pre-line\">foo []</div>", + [true], + {"inserttext":[false,false,"",false,false,""]}], +["<div style=white-space:pre-line>foo []</div>", + [["inserttext"," "]], + "<div style=\"white-space:pre-line\">foo []</div>", + [true], + {"inserttext":[false,false,"",false,false,""]}], +["<div style=white-space:pre-line> foo [] </div>", + [["inserttext"," "]], + "<div style=\"white-space:pre-line\"> foo []</div>", + [true], + {"inserttext":[false,false,"",false,false,""]}], +["<div style=white-space:nowrap>foo[]bar</div>", + [["inserttext"," "]], + "<div style=\"white-space:nowrap\">foo []bar</div>", + [true], + {"inserttext":[false,false,"",false,false,""]}], +["<div style=white-space:nowrap>foo []bar</div>", + [["inserttext"," "]], + "<div style=\"white-space:nowrap\">foo []bar</div>", + [true], + {"inserttext":[false,false,"",false,false,""]}], +["<div style=white-space:nowrap>foo[] bar</div>", + [["inserttext"," "]], + "<div style=\"white-space:nowrap\">foo [] bar</div>", + [true], + {"inserttext":[false,false,"",false,false,""]}], +["<div style=white-space:nowrap>foo []bar</div>", + [["inserttext"," "]], + "<div style=\"white-space:nowrap\">foo []bar</div>", + [true], + {"inserttext":[false,false,"",false,false,""]}], +["<div style=white-space:nowrap>[]foo</div>", + [["inserttext"," "]], + "<div style=\"white-space:nowrap\"> []foo</div>", + [true], + {"inserttext":[false,false,"",false,false,""]}], +["<div style=white-space:nowrap>foo[]</div>", + [["inserttext"," "]], + "<div style=\"white-space:nowrap\">foo []</div>", + [true], + {"inserttext":[false,false,"",false,false,""]}], +["<div style=white-space:nowrap>foo []</div>", + [["inserttext"," "]], + "<div style=\"white-space:nowrap\">foo []</div>", + [true], + {"inserttext":[false,false,"",false,false,""]}], +["<div style=white-space:nowrap> foo [] </div>", + [["inserttext"," "]], + "<div style=\"white-space:nowrap\"> foo []</div>", + [true], + {"inserttext":[false,false,"",false,false,""]}], +["http://a[]", + [["inserttext"," "]], + "<a href=\"http://a\">http://a</a> []", + [true], + {"inserttext":[false,false,"",false,false,""]}], +["ftp://a[]", + [["inserttext"," "]], + "<a href=\"ftp://a\">ftp://a</a> []", + [true], + {"inserttext":[false,false,"",false,false,""]}], +["quasit://a[]", + [["inserttext"," "]], + "<a href=\"quasit://a\">quasit://a</a> []", + [true], + {"inserttext":[false,false,"",false,false,""]}], +[".x-++-.://a[]", + [["inserttext"," "]], + ".<a href=\"x-++-.://a\">x-++-.://a</a> []", + [true], + {"inserttext":[false,false,"",false,false,""]}], +["(http://a)[]", + [["inserttext"," "]], + "(<a href=\"http://a\">http://a</a>) []", + [true], + {"inserttext":[false,false,"",false,false,""]}], +["<http://a>[]", + [["inserttext"," "]], + "<<a href=\"http://a\">http://a</a>> []", + [true], + {"inserttext":[false,false,"",false,false,""]}], +["http://a![]", + [["inserttext"," "]], + "<a href=\"http://a\">http://a</a>! []", + [true], + {"inserttext":[false,false,"",false,false,""]}], +["!\"#$%&'()*+,-./:;<=>?^_`|~http://a!\"#$%&'()*+,-./:;<=>?^_`|~[]", + [["inserttext"," "]], + "!\"#$%&'()*+,-./:;<=>?^_`|~<a href=\"http://a!"#$%&'()*+,-./:;<=>?^_`|~\">http://a!\"#$%&'()*+,-./:;<=>?^_`|~</a> []", + [true], + {"inserttext":[false,false,"",false,false,""]}], +["http://a!\"'(),-.:;<>`[]", + [["inserttext"," "]], + "<a href=\"http://a\">http://a</a>!\"'(),-.:;<>` []", + [true], + {"inserttext":[false,false,"",false,false,""]}], +["http://a#$%&*+/=?^_|~[]", + [["inserttext"," "]], + "<a href=\"http://a#$%&*+/=?^_|~\">http://a#$%&*+/=?^_|~</a> []", + [true], + {"inserttext":[false,false,"",false,false,""]}], +["mailto:a[]", + [["inserttext"," "]], + "<a href=\"mailto:a\">mailto:a</a> []", + [true], + {"inserttext":[false,false,"",false,false,""]}], +["a@b[]", + [["inserttext"," "]], + "<a href=\"mailto:a@b\">a@b</a> []", + [true], + {"inserttext":[false,false,"",false,false,""]}], +["a@[]", + [["inserttext"," "]], + "a@ []", + [true], + {"inserttext":[false,false,"",false,false,""]}], +["@b[]", + [["inserttext"," "]], + "@b []", + [true], + {"inserttext":[false,false,"",false,false,""]}], +["#@x[]", + [["inserttext"," "]], + "<a href=\"mailto:#@x\">#@x</a> []", + [true], + {"inserttext":[false,false,"",false,false,""]}], +["a@.[]", + [["inserttext"," "]], + "a@. []", + [true], + {"inserttext":[false,false,"",false,false,""]}], +["!\"#$%&'()*+,-./:;<=>?^_`|~a@b!\"#$%&'()*+,-./:;<=>?^_`|~[]", + [["inserttext"," "]], + "!\"#$%&'()*+,-./:;<=><a href=\"mailto:?^_`|~a@b\">?^_`|~a@b</a>!\"#$%&'()*+,-./:;<=>?^_`|~ []", + [true], + {"inserttext":[false,false,"",false,false,""]}], +["<b>a@b</b>{}", + [["inserttext"," "]], + "<a href=\"mailto:a@b\"><b>a@b</b></a> []", + [true], + {"inserttext":[false,false,"",false,false,""]}], +["<b>a</b><i>@</i><u>b</u>{}", + [["inserttext"," "]], + "<b>a</b><i>@</i><u>b</u> []", + [true], + {"inserttext":[false,false,"",false,false,""]}], +["a@b<b>[]c</b>", + [["inserttext"," "]], + "<a href=\"mailto:a@b\">a@b</a><b> []c</b>", + [true], + {"inserttext":[false,false,"",false,false,""]}], +["<p>a@b</p><p>[]c</p>", + [["inserttext"," "]], + "<p>a@b</p><p> []c</p>", + [true], + {"inserttext":[false,false,"",false,false,""]}], +["http://a[]", + [["inserttext","a"]], + "http://aa[]", + [true], + {"inserttext":[false,false,"",false,false,""]}], +["http://a[]", + [["inserttext","\t"]], + "<a href=\"http://a\">http://a</a>\t[]", + [true], + {"inserttext":[false,false,"",false,false,""]}], +["http://a[]", + [["inserttext","\f"]], + "<a href=\"http://a\">http://a</a>\f[]", + [true], + {"inserttext":[false,false,"",false,false,""]}], +["http://a[]", + [["inserttext"," "]], + "http://a []", + [true], + {"inserttext":[false,false,"",false,false,""]}], +["foo[]", + [["inserttext"," "]], + "foo []", + [true], + {"inserttext":[false,false,"",false,false,""]}], +["foo[]bar", + [["inserttext","a"]], + "fooa[]bar", + [true], + {"inserttext":[false,false,"",false,false,""]}], +["foo []", + [["inserttext","a"]], + "foo a[]", + [true], + {"inserttext":[false,false,"",false,false,""]}], +["foo []", + [["inserttext","a"]], + "foo a[]", + [true], + {"inserttext":[false,false,"",false,false,""]}], +["<p>foo[]", + [["inserttext","a"]], + "<p>fooa[]</p>", + [true], + {"inserttext":[false,false,"",false,false,""]}], +["<p>foo</p>{}", + [["inserttext","a"]], + "<p>foo</p>a[]", + [true], + {"inserttext":[false,false,"",false,false,""]}], +["<p>[]foo", + [["inserttext","a"]], + "<p>a[]foo</p>", + [true], + {"inserttext":[false,false,"",false,false,""]}], +["<p>{}foo", + [["inserttext","a"]], + "<p>a[]foo</p>", + [true], + {"inserttext":[false,false,"",false,false,""]}], +["{}<p>foo", + [["inserttext","a"]], + "a[]<p>foo</p>", + [true], + {"inserttext":[false,false,"",false,false,""]}], +["<p>foo</p>{}<p>bar</p>", + [["inserttext","a"]], + "<p>foo</p>a[]<p>bar</p>", + [true], + {"inserttext":[false,false,"",false,false,""]}], +["<b>foo[]</b>bar", + [["inserttext","a"]], + "<b>fooa[]</b>bar", + [true], + {"inserttext":[false,false,"",false,false,""]}], +["<b>foo</b>[]bar", + [["inserttext","a"]], + "<b>foo</b>a[]bar", + [true], + {"inserttext":[false,false,"",false,false,""]}], +["foo<b>{}</b>bar", + [["inserttext","a"]], + "foo<b>a[]</b>bar", + [true], + {"inserttext":[false,false,"",false,false,""]}], +["<a>foo[]</a>bar", + [["inserttext","a"]], + "<a>fooa[]</a>bar", + [true], + {"inserttext":[false,false,"",false,false,""]}], +["<a>foo</a>[]bar", + [["inserttext","a"]], + "<a>foo</a>a[]bar", + [true], + {"inserttext":[false,false,"",false,false,""]}], +["<a href=/>foo[]</a>bar", + [["inserttext","a"]], + "<a href=\"/\">fooa[]</a>bar", + [true], + {"inserttext":[false,false,"",false,false,""]}], +["<a href=/>foo</a>[]bar", + [["inserttext","a"]], + "<a href=\"/\">foo</a>a[]bar", + [true], + {"inserttext":[false,false,"",false,false,""]}], +["<p>fo[o<p>b]ar", + [["defaultparagraphseparator","div"],["inserttext","a"]], + "<p>foa[]ar</p>", + [true,true], + {"defaultparagraphseparator":[false,false,"p",false,false,"div"],"inserttext":[false,false,"",false,false,""]}], +["<p>fo[o<p>b]ar", + [["defaultparagraphseparator","p"],["inserttext","a"]], + "<p>foa[]ar</p>", + [true,true], + {"defaultparagraphseparator":[false,false,"div",false,false,"p"],"inserttext":[false,false,"",false,false,""]}], +["<p>fo[o<p>bar<p>b]az", + [["defaultparagraphseparator","div"],["inserttext","a"]], + "<p>foa[]az</p>", + [true,true], + {"defaultparagraphseparator":[false,false,"p",false,false,"div"],"inserttext":[false,false,"",false,false,""]}], +["<p>fo[o<p>bar<p>b]az", + [["defaultparagraphseparator","p"],["inserttext","a"]], + "<p>foa[]az</p>", + [true,true], + {"defaultparagraphseparator":[false,false,"div",false,false,"p"],"inserttext":[false,false,"",false,false,""]}], +["{}<br>", + [["inserttext","a"]], + "a[]", + [true], + {"inserttext":[false,false,"",false,false,""]}], +["<p>{}<br>", + [["inserttext","a"]], + "<p>a[]</p>", + [true], + {"inserttext":[false,false,"",false,false,""]}], +["<p><span>{}<br></span>", + [["inserttext","a"]], + "<p><span>a[]</span></p>", + [true], + {"inserttext":[false,false,"",false,false,""]}], +["<p>foo<span style=color:#aBcDeF>[bar]</span>baz", + [["inserttext","a"]], + "<p>foo<span style=\"color:rgb(171, 205, 239)\">a[]</span>baz</p>", + [true], + {"inserttext":[false,false,"",false,false,""]}], +["<p>foo<span style=color:#aBcDeF>{bar}</span>baz", + [["inserttext","a"]], + "<p>foo<span style=\"color:rgb(171, 205, 239)\">a[]</span>baz</p>", + [true], + {"inserttext":[false,false,"",false,false,""]}], +["<p>foo{<span style=color:#aBcDeF>bar</span>}baz", + [["inserttext","a"]], + "<p>foo<span style=\"color:rgb(171, 205, 239)\">a[]</span>baz</p>", + [true], + {"inserttext":[false,false,"",false,false,""]}], +["<p>[foo<span style=color:#aBcDeF>bar]</span>baz", + [["stylewithcss","true"],["inserttext","a"]], + "<p>a[]baz</p>", + [true,true], + {"stylewithcss":[false,false,"",false,true,""],"inserttext":[false,false,"",false,false,""]}], +["<p>[foo<span style=color:#aBcDeF>bar]</span>baz", + [["stylewithcss","false"],["inserttext","a"]], + "<p>a[]baz</p>", + [true,true], + {"stylewithcss":[false,true,"",false,false,""],"inserttext":[false,false,"",false,false,""]}], +["<p>{foo<span style=color:#aBcDeF>bar}</span>baz", + [["stylewithcss","true"],["inserttext","a"]], + "<p>a[]baz</p>", + [true,true], + {"stylewithcss":[false,false,"",false,true,""],"inserttext":[false,false,"",false,false,""]}], +["<p>{foo<span style=color:#aBcDeF>bar}</span>baz", + [["stylewithcss","false"],["inserttext","a"]], + "<p>a[]baz</p>", + [true,true], + {"stylewithcss":[false,true,"",false,false,""],"inserttext":[false,false,"",false,false,""]}], +["<p>foo<span style=color:#aBcDeF>[bar</span>baz]", + [["inserttext","a"]], + "<p>foo<span style=\"color:rgb(171, 205, 239)\">a[]</span></p>", + [true], + {"inserttext":[false,false,"",false,false,""]}], +["<p>foo<span style=color:#aBcDeF>{bar</span>baz}", + [["inserttext","a"]], + "<p>foo<span style=\"color:rgb(171, 205, 239)\">a[]</span></p>", + [true], + {"inserttext":[false,false,"",false,false,""]}], +["<p>foo<span style=color:#aBcDeF>[bar</span><span style=color:#fEdCbA>baz]</span>quz", + [["stylewithcss","true"],["inserttext","a"]], + "<p>foo<span style=\"color:rgb(171, 205, 239)\">a[]</span>quz</p>", + [true,true], + {"stylewithcss":[false,false,"",false,true,""],"inserttext":[false,false,"",false,false,""]}], +["<p>foo<span style=color:#aBcDeF>[bar</span><span style=color:#fEdCbA>baz]</span>quz", + [["stylewithcss","false"],["inserttext","a"]], + "<p>foo<span style=\"color:rgb(171, 205, 239)\">a[]</span>quz</p>", + [true,true], + {"stylewithcss":[false,true,"",false,false,""],"inserttext":[false,false,"",false,false,""]}], +["foo<b>[bar]</b>baz", + [["inserttext","a"]], + "foo<b>a[]</b>baz", + [true], + {"inserttext":[false,false,"",false,false,""]}], +["foo<i>[bar]</i>baz", + [["inserttext","a"]], + "foo<i>a[]</i>baz", + [true], + {"inserttext":[false,false,"",false,false,""]}], +["foo<s>[bar]</s>baz", + [["inserttext","a"]], + "foo<s>a[]</s>baz", + [true], + {"inserttext":[false,false,"",false,false,""]}], +["foo<sub>[bar]</sub>baz", + [["inserttext","a"]], + "foo<sub>a[]</sub>baz", + [true], + {"inserttext":[false,false,"",false,false,""]}], +["foo<sup>[bar]</sup>baz", + [["inserttext","a"]], + "foo<sup>a[]</sup>baz", + [true], + {"inserttext":[false,false,"",false,false,""]}], +["foo<u>[bar]</u>baz", + [["inserttext","a"]], + "foo<u>a[]</u>baz", + [true], + {"inserttext":[false,false,"",false,false,""]}], +["foo<a href=http://www.google.com>[bar]</a>baz", + [["inserttext","a"]], + "foo<a href=\"http://www.google.com\">a[]</a>baz", + [true], + {"inserttext":[false,false,"",false,false,""]}], +["foo<font face=sans-serif>[bar]</font>baz", + [["inserttext","a"]], + "foo<font face=\"sans-serif\">a[]</font>baz", + [true], + {"inserttext":[false,false,"",false,false,""]}], +["foo<font size=4>[bar]</font>baz", + [["inserttext","a"]], + "foo<font size=\"4\">a[]</font>baz", + [true], + {"inserttext":[false,false,"",false,false,""]}], +["foo<font color=#0000FF>[bar]</font>baz", + [["inserttext","a"]], + "foo<font color=\"#0000FF\">a[]</font>baz", + [true], + {"inserttext":[false,false,"",false,false,""]}], +["foo<span style=background-color:#00FFFF>[bar]</span>baz", + [["inserttext","a"]], + "foo<span style=\"background-color:rgb(0, 255, 255)\">a[]</span>baz", + [true], + {"inserttext":[false,false,"",false,false,""]}], +["foo<a href=http://www.google.com><font color=blue>[bar]</font></a>baz", + [["inserttext","a"]], + "foo<a href=\"http://www.google.com\"><font color=\"blue\">a[]</font></a>baz", + [true], + {"inserttext":[false,false,"",false,false,""]}], +["foo<font color=blue><a href=http://www.google.com>[bar]</a></font>baz", + [["inserttext","a"]], + "foo<font color=\"blue\"><a href=\"http://www.google.com\">a[]</a></font>baz", + [true], + {"inserttext":[false,false,"",false,false,""]}], +["foo<a href=http://www.google.com><font color=brown>[bar]</font></a>baz", + [["inserttext","a"]], + "foo<a href=\"http://www.google.com\"><font color=\"brown\">a[]</font></a>baz", + [true], + {"inserttext":[false,false,"",false,false,""]}], +["foo<font color=brown><a href=http://www.google.com>[bar]</a></font>baz", + [["inserttext","a"]], + "foo<font color=\"brown\"><a href=\"http://www.google.com\">a[]</a></font>baz", + [true], + {"inserttext":[false,false,"",false,false,""]}], +["foo<a href=http://www.google.com><font color=black>[bar]</font></a>baz", + [["inserttext","a"]], + "foo<a href=\"http://www.google.com\"><font color=\"black\">a[]</font></a>baz", + [true], + {"inserttext":[false,false,"",false,false,""]}], +["foo<a href=http://www.google.com><u>[bar]</u></a>baz", + [["inserttext","a"]], + "foo<a href=\"http://www.google.com\"><u>a[]</u></a>baz", + [true], + {"inserttext":[false,false,"",false,false,""]}], +["foo<u><a href=http://www.google.com>[bar]</a></u>baz", + [["inserttext","a"]], + "foo<u><a href=\"http://www.google.com\">a[]</a></u>baz", + [true], + {"inserttext":[false,false,"",false,false,""]}], +["foo<sub><font size=2>[bar]</font></sub>baz", + [["inserttext","a"]], + "foo<sub><font size=\"2\">a[]</font></sub>baz", + [true], + {"inserttext":[false,false,"",false,false,""]}], +["foo<font size=2><sub>[bar]</sub></font>baz", + [["inserttext","a"]], + "foo<font size=\"2\"><sub>a[]</sub></font>baz", + [true], + {"inserttext":[false,false,"",false,false,""]}], +["foo<sub><font size=3>[bar]</font></sub>baz", + [["inserttext","a"]], + "foo<sub><font size=\"3\">a[]</font></sub>baz", + [true], + {"inserttext":[false,false,"",false,false,""]}], +["foo<font size=3><sub>[bar]</sub></font>baz", + [["inserttext","a"]], + "foo<font size=\"3\"><sub>a[]</sub></font>baz", + [true], + {"inserttext":[false,false,"",false,false,""]}], +["[foo<b>bar]</b>baz", + [["stylewithcss","true"],["inserttext","a"]], + "a[]baz", + [true,true], + {"stylewithcss":[false,false,"",false,true,""],"inserttext":[false,false,"",false,false,""]}], +["[foo<b>bar]</b>baz", + [["stylewithcss","false"],["inserttext","a"]], + "a[]baz", + [true,true], + {"stylewithcss":[false,true,"",false,false,""],"inserttext":[false,false,"",false,false,""]}], +["[foo<i>bar]</i>baz", + [["stylewithcss","true"],["inserttext","a"]], + "a[]baz", + [true,true], + {"stylewithcss":[false,false,"",false,true,""],"inserttext":[false,false,"",false,false,""]}], +["[foo<i>bar]</i>baz", + [["stylewithcss","false"],["inserttext","a"]], + "a[]baz", + [true,true], + {"stylewithcss":[false,true,"",false,false,""],"inserttext":[false,false,"",false,false,""]}], +["[foo<s>bar]</s>baz", + [["stylewithcss","true"],["inserttext","a"]], + "a[]baz", + [true,true], + {"stylewithcss":[false,false,"",false,true,""],"inserttext":[false,false,"",false,false,""]}], +["[foo<s>bar]</s>baz", + [["stylewithcss","false"],["inserttext","a"]], + "a[]baz", + [true,true], + {"stylewithcss":[false,true,"",false,false,""],"inserttext":[false,false,"",false,false,""]}], +["[foo<sub>bar]</sub>baz", + [["stylewithcss","true"],["inserttext","a"]], + "a[]baz", + [true,true], + {"stylewithcss":[false,false,"",false,true,""],"inserttext":[false,false,"",false,false,""]}], +["[foo<sub>bar]</sub>baz", + [["stylewithcss","false"],["inserttext","a"]], + "a[]baz", + [true,true], + {"stylewithcss":[false,true,"",false,false,""],"inserttext":[false,false,"",false,false,""]}], +["[foo<sup>bar]</sup>baz", + [["stylewithcss","true"],["inserttext","a"]], + "a[]baz", + [true,true], + {"stylewithcss":[false,false,"",false,true,""],"inserttext":[false,false,"",false,false,""]}], +["[foo<sup>bar]</sup>baz", + [["stylewithcss","false"],["inserttext","a"]], + "a[]baz", + [true,true], + {"stylewithcss":[false,true,"",false,false,""],"inserttext":[false,false,"",false,false,""]}], +["[foo<u>bar]</u>baz", + [["stylewithcss","true"],["inserttext","a"]], + "a[]baz", + [true,true], + {"stylewithcss":[false,false,"",false,true,""],"inserttext":[false,false,"",false,false,""]}], +["[foo<u>bar]</u>baz", + [["stylewithcss","false"],["inserttext","a"]], + "a[]baz", + [true,true], + {"stylewithcss":[false,true,"",false,false,""],"inserttext":[false,false,"",false,false,""]}], +["[foo<a href=http://www.google.com>bar]</a>baz", + [["inserttext","a"]], + "a[]baz", + [true], + {"inserttext":[false,false,"",false,false,""]}], +["[foo<font face=sans-serif>bar]</font>baz", + [["stylewithcss","true"],["inserttext","a"]], + "a[]baz", + [true,true], + {"stylewithcss":[false,false,"",false,true,""],"inserttext":[false,false,"",false,false,""]}], +["[foo<font face=sans-serif>bar]</font>baz", + [["stylewithcss","false"],["inserttext","a"]], + "a[]baz", + [true,true], + {"stylewithcss":[false,true,"",false,false,""],"inserttext":[false,false,"",false,false,""]}], +["[foo<font size=4>bar]</font>baz", + [["stylewithcss","true"],["inserttext","a"]], + "a[]baz", + [true,true], + {"stylewithcss":[false,false,"",false,true,""],"inserttext":[false,false,"",false,false,""]}], +["[foo<font size=4>bar]</font>baz", + [["stylewithcss","false"],["inserttext","a"]], + "a[]baz", + [true,true], + {"stylewithcss":[false,true,"",false,false,""],"inserttext":[false,false,"",false,false,""]}], +["[foo<font color=#0000FF>bar]</font>baz", + [["stylewithcss","true"],["inserttext","a"]], + "a[]baz", + [true,true], + {"stylewithcss":[false,false,"",false,true,""],"inserttext":[false,false,"",false,false,""]}], +["[foo<font color=#0000FF>bar]</font>baz", + [["stylewithcss","false"],["inserttext","a"]], + "a[]baz", + [true,true], + {"stylewithcss":[false,true,"",false,false,""],"inserttext":[false,false,"",false,false,""]}], +["[foo<span style=background-color:#00FFFF>bar]</span>baz", + [["stylewithcss","true"],["inserttext","a"]], + "a[]baz", + [true,true], + {"stylewithcss":[false,false,"",false,true,""],"inserttext":[false,false,"",false,false,""]}], +["[foo<span style=background-color:#00FFFF>bar]</span>baz", + [["stylewithcss","false"],["inserttext","a"]], + "a[]baz", + [true,true], + {"stylewithcss":[false,true,"",false,false,""],"inserttext":[false,false,"",false,false,""]}], +["[foo<a href=http://www.google.com><font color=blue>bar]</font></a>baz", + [["stylewithcss","true"],["inserttext","a"]], + "a[]baz", + [true,true], + {"stylewithcss":[false,false,"",false,true,""],"inserttext":[false,false,"",false,false,""]}], +["[foo<a href=http://www.google.com><font color=blue>bar]</font></a>baz", + [["stylewithcss","false"],["inserttext","a"]], + "a[]baz", + [true,true], + {"stylewithcss":[false,true,"",false,false,""],"inserttext":[false,false,"",false,false,""]}], +["[foo<font color=blue><a href=http://www.google.com>bar]</a></font>baz", + [["stylewithcss","true"],["inserttext","a"]], + "a[]baz", + [true,true], + {"stylewithcss":[false,false,"",false,true,""],"inserttext":[false,false,"",false,false,""]}], +["[foo<font color=blue><a href=http://www.google.com>bar]</a></font>baz", + [["stylewithcss","false"],["inserttext","a"]], + "a[]baz", + [true,true], + {"stylewithcss":[false,true,"",false,false,""],"inserttext":[false,false,"",false,false,""]}], +["[foo<a href=http://www.google.com><font color=brown>bar]</font></a>baz", + [["stylewithcss","true"],["inserttext","a"]], + "a[]baz", + [true,true], + {"stylewithcss":[false,false,"",false,true,""],"inserttext":[false,false,"",false,false,""]}], +["[foo<a href=http://www.google.com><font color=brown>bar]</font></a>baz", + [["stylewithcss","false"],["inserttext","a"]], + "a[]baz", + [true,true], + {"stylewithcss":[false,true,"",false,false,""],"inserttext":[false,false,"",false,false,""]}], +["[foo<font color=brown><a href=http://www.google.com>bar]</a></font>baz", + [["stylewithcss","true"],["inserttext","a"]], + "a[]baz", + [true,true], + {"stylewithcss":[false,false,"",false,true,""],"inserttext":[false,false,"",false,false,""]}], +["[foo<font color=brown><a href=http://www.google.com>bar]</a></font>baz", + [["stylewithcss","false"],["inserttext","a"]], + "a[]baz", + [true,true], + {"stylewithcss":[false,true,"",false,false,""],"inserttext":[false,false,"",false,false,""]}], +["[foo<a href=http://www.google.com><font color=black>bar]</font></a>baz", + [["stylewithcss","true"],["inserttext","a"]], + "a[]baz", + [true,true], + {"stylewithcss":[false,false,"",false,true,""],"inserttext":[false,false,"",false,false,""]}], +["[foo<a href=http://www.google.com><font color=black>bar]</font></a>baz", + [["stylewithcss","false"],["inserttext","a"]], + "a[]baz", + [true,true], + {"stylewithcss":[false,true,"",false,false,""],"inserttext":[false,false,"",false,false,""]}], +["[foo<a href=http://www.google.com><u>bar]</u></a>baz", + [["stylewithcss","true"],["inserttext","a"]], + "a[]baz", + [true,true], + {"stylewithcss":[false,false,"",false,true,""],"inserttext":[false,false,"",false,false,""]}], +["[foo<a href=http://www.google.com><u>bar]</u></a>baz", + [["stylewithcss","false"],["inserttext","a"]], + "a[]baz", + [true,true], + {"stylewithcss":[false,true,"",false,false,""],"inserttext":[false,false,"",false,false,""]}], +["[foo<u><a href=http://www.google.com>bar]</a></u>baz", + [["stylewithcss","true"],["inserttext","a"]], + "a[]baz", + [true,true], + {"stylewithcss":[false,false,"",false,true,""],"inserttext":[false,false,"",false,false,""]}], +["[foo<u><a href=http://www.google.com>bar]</a></u>baz", + [["stylewithcss","false"],["inserttext","a"]], + "a[]baz", + [true,true], + {"stylewithcss":[false,true,"",false,false,""],"inserttext":[false,false,"",false,false,""]}], +["[foo<sub><font size=2>bar]</font></sub>baz", + [["stylewithcss","true"],["inserttext","a"]], + "a[]baz", + [true,true], + {"stylewithcss":[false,false,"",false,true,""],"inserttext":[false,false,"",false,false,""]}], +["[foo<sub><font size=2>bar]</font></sub>baz", + [["stylewithcss","false"],["inserttext","a"]], + "a[]baz", + [true,true], + {"stylewithcss":[false,true,"",false,false,""],"inserttext":[false,false,"",false,false,""]}], +["[foo<font size=2><sub>bar]</sub></font>baz", + [["stylewithcss","true"],["inserttext","a"]], + "a[]baz", + [true,true], + {"stylewithcss":[false,false,"",false,true,""],"inserttext":[false,false,"",false,false,""]}], +["[foo<font size=2><sub>bar]</sub></font>baz", + [["stylewithcss","false"],["inserttext","a"]], + "a[]baz", + [true,true], + {"stylewithcss":[false,true,"",false,false,""],"inserttext":[false,false,"",false,false,""]}], +["[foo<sub><font size=3>bar]</font></sub>baz", + [["stylewithcss","true"],["inserttext","a"]], + "a[]baz", + [true,true], + {"stylewithcss":[false,false,"",false,true,""],"inserttext":[false,false,"",false,false,""]}], +["[foo<sub><font size=3>bar]</font></sub>baz", + [["stylewithcss","false"],["inserttext","a"]], + "a[]baz", + [true,true], + {"stylewithcss":[false,true,"",false,false,""],"inserttext":[false,false,"",false,false,""]}], +["[foo<font size=3><sub>bar]</sub></font>baz", + [["stylewithcss","true"],["inserttext","a"]], + "a[]baz", + [true,true], + {"stylewithcss":[false,false,"",false,true,""],"inserttext":[false,false,"",false,false,""]}], +["[foo<font size=3><sub>bar]</sub></font>baz", + [["stylewithcss","false"],["inserttext","a"]], + "a[]baz", + [true,true], + {"stylewithcss":[false,true,"",false,false,""],"inserttext":[false,false,"",false,false,""]}], +["foo<b>[bar</b>baz]", + [["inserttext","a"]], + "foo<b>a[]</b>", + [true], + {"inserttext":[false,false,"",false,false,""]}], +["foo<i>[bar</i>baz]", + [["inserttext","a"]], + "foo<i>a[]</i>", + [true], + {"inserttext":[false,false,"",false,false,""]}], +["foo<s>[bar</s>baz]", + [["inserttext","a"]], + "foo<s>a[]</s>", + [true], + {"inserttext":[false,false,"",false,false,""]}], +["foo<sub>[bar</sub>baz]", + [["inserttext","a"]], + "foo<sub>a[]</sub>", + [true], + {"inserttext":[false,false,"",false,false,""]}], +["foo<sup>[bar</sup>baz]", + [["inserttext","a"]], + "foo<sup>a[]</sup>", + [true], + {"inserttext":[false,false,"",false,false,""]}], +["foo<u>[bar</u>baz]", + [["inserttext","a"]], + "foo<u>a[]</u>", + [true], + {"inserttext":[false,false,"",false,false,""]}], +["foo<a href=http://www.google.com>[bar</a>baz]", + [["inserttext","a"]], + "fooa[]", + [true], + {"inserttext":[false,false,"",false,false,""]}], +["foo<font face=sans-serif>[bar</font>baz]", + [["inserttext","a"]], + "foo<font face=\"sans-serif\">a[]</font>", + [true], + {"inserttext":[false,false,"",false,false,""]}], +["foo<font size=4>[bar</font>baz]", + [["inserttext","a"]], + "foo<font size=\"4\">a[]</font>", + [true], + {"inserttext":[false,false,"",false,false,""]}], +["foo<font color=#0000FF>[bar</font>baz]", + [["inserttext","a"]], + "foo<font color=\"#0000FF\">a[]</font>", + [true], + {"inserttext":[false,false,"",false,false,""]}], +["foo<span style=background-color:#00FFFF>[bar</span>baz]", + [["inserttext","a"]], + "foo<span style=\"background-color:rgb(0, 255, 255)\">a[]</span>", + [true], + {"inserttext":[false,false,"",false,false,""]}], +// <a href> should always be removed if entirely replaced. +["foo<a href=http://www.google.com><font color=blue>[bar</font></a>baz]", + [["inserttext","a"]], + "foo<font color=\"blue\">a[]</font>", + [true], + {"inserttext":[false,false,"",false,false,""]}], +["foo<font color=blue><a href=http://www.google.com>[bar</a></font>baz]", + [["inserttext","a"]], + "foo<font color=\"blue\">a[]</font>", + [true], + {"inserttext":[false,false,"",false,false,""]}], +["foo<a href=http://www.google.com><font color=brown>[bar</font></a>baz]", + [["inserttext","a"]], + "foo<font color=\"brown\">a[]</font>", + [true], + {"inserttext":[false,false,"",false,false,""]}], +["foo<font color=brown><a href=http://www.google.com>[bar</a></font>baz]", + [["inserttext","a"]], + "foo<font color=\"brown\">a[]</font>", + [true], + {"inserttext":[false,false,"",false,false,""]}], +["foo<a href=http://www.google.com><font color=black>[bar</font></a>baz]", + [["inserttext","a"]], + "foo<font color=\"black\">a[]</font>", + [true], + {"inserttext":[false,false,"",false,false,""]}], +["foo<a href=http://www.google.com><u>[bar</u></a>baz]", + [["inserttext","a"]], + "foo<u>a[]</u>", + [true], + {"inserttext":[false,false,"",false,false,""]}], +["foo<u><a href=http://www.google.com>[bar</a></u>baz]", + [["inserttext","a"]], + "foo<u>a[]</u>", + [true], + {"inserttext":[false,false,"",false,false,""]}], +["foo<sub><font size=2>[bar</font></sub>baz]", + [["inserttext","a"]], + "foo<sub><font size=\"2\">a[]</font></sub>", + [true], + {"inserttext":[false,false,"",false,false,""]}], +["foo<font size=2><sub>[bar</sub></font>baz]", + [["inserttext","a"]], + "foo<font size=\"2\"><sub>a[]</sub></font>", + [true], + {"inserttext":[false,false,"",false,false,""]}], +["foo<sub><font size=3>[bar</font></sub>baz]", + [["inserttext","a"]], + "foo<sub><font size=\"3\">a[]</font></sub>", + [true], + {"inserttext":[false,false,"",false,false,""]}], +["foo<font size=3><sub>[bar</sub></font>baz]", + [["inserttext","a"]], + "foo<font size=\"3\"><sub>a[]</sub></font>", + [true], + {"inserttext":[false,false,"",false,false,""]}], +["<blockquote><font color=blue>[foo]</font></blockquote>", + [["inserttext","a"]], + "<blockquote><font color=\"blue\">a[]</font></blockquote>", + [true], + {"inserttext":[false,false,"",false,false,""]}], +["<div>[] abc</div>", + [["inserttext"," "]], + "<div> abc</div>", + [true], + {"inserttext":[false,false,"",false,false,""]}], +["<div> []abc</div>", + [["inserttext"," "]], + "<div> abc</div>", + [true], + {"inserttext":[false,false,"",false,false,""]}], +["<div>[] abc</div>", + [["inserttext"," "]], + "<div> abc</div>", + [true], + {"inserttext":[false,false,"",false,false,""]}], +["<div> [] abc</div>", + [["inserttext"," "]], + "<div> abc</div>", + [true], + {"inserttext":[false,false,"",false,false,""]}], +["<div> []abc</div>", + [["inserttext"," "]], + "<div> abc</div>", + [true], + {"inserttext":[false,false,"",false,false,""]}], +["<div>abc[] </div>", + [["inserttext"," "]], + ["<div>abc </div>", + "<div>abc <br></div>"], + [true], + {"inserttext":[false,false,"",false,false,""]}], +["<div>abc []</div>", + [["inserttext"," "]], + ["<div>abc </div>", + "<div>abc <br></div>"], + [true], + {"inserttext":[false,false,"",false,false,""]}], +["<div>abc[] </div>", + [["inserttext"," "]], + ["<div>abc </div>", + "<div>abc <br></div>"], + [true], + {"inserttext":[false,false,"",false,false,""]}], +["<div>abc [] </div>", + [["inserttext"," "]], + ["<div>abc </div>", + "<div>abc <br></div>"], + [true], + {"inserttext":[false,false,"",false,false,""]}], +["<div>abc []</div>", + [["inserttext"," "]], + ["<div>abc </div>", + "<div>abc <br></div>"], + [true], + {"inserttext":[false,false,"",false,false,""]}], +["<br>{}", + [["inserttext","a"]], + ["a", "a<br>"], + [true], + {"inserttext":[false,false,"",false,false,""]}], +["abc<br>{}", + [["inserttext","d"]], + ["abcd", "abcd<br>"], + [true], + {"inserttext":[false,false,"",false,false,""]}], +["abc<br>{}<br>", + [["inserttext","d"]], + ["abc<br>d", + "abc<br>d<br>"], + [true], + {"inserttext":[false,false,"",false,false,""]}], +["<span contenteditable=false>abc</span><br>{}", + [["inserttext","d"]], + ["<span contenteditable=\"false\">abc</span>d", + "<span contenteditable=\"false\">abc</span>d<br>"], + [true], + {"inserttext":[false,false,"",false,false,""]}], +["<div contenteditable=false><span contenteditable><br>{}</span></div>", + [["inserttext","a"]], + ["<div contenteditable=\"false\"><span contenteditable=\"\">a</span></div>", + "<div contenteditable=\"false\"><span contenteditable=\"\">a<br></span></div>"], + [true], + {"inserttext":[false,false,"",false,false,""]}], +["<div contenteditable=false><span contenteditable>abc<br>{}</span></div>", + [["inserttext","d"]], + ["<div contenteditable=\"false\"><span contenteditable=\"\">abcd</span></div>", + "<div contenteditable=\"false\"><span contenteditable=\"\">abcd<br></span></div>"], + [true], + {"inserttext":[false,false,"",false,false,""]}], +["<div style=white-space:pre>foo[]bar</div>", + [["inserttext"," "]], + "<div style=\"white-space:pre\">foo bar</div>", + [true], + {"inserttext":[false,false,"",false,false,""]}], +["<div style=white-space:pre>foo[]</div>", + [["inserttext"," "]], + "<div style=\"white-space:pre\">foo </div>", + [true], + {"inserttext":[false,false,"",false,false,""]}], +["<div style=white-space:pre-wrap>foo[]bar</div>", + [["inserttext"," "]], + "<div style=\"white-space:pre-wrap\">foo bar</div>", + [true], + {"inserttext":[false,false,"",false,false,""]}], +["<div style=white-space:pre-wrap>foo[]</div>", + [["inserttext"," "]], + "<div style=\"white-space:pre-wrap\">foo </div>", + [true], + {"inserttext":[false,false,"",false,false,""]}], +// FYI: The white-space sequence different does not matter here. It's tested +// in white-spaces-after-execCommand-inserttext.tentative.html. +["<div style=white-space:pre-line>foo[]bar</div>", + [["inserttext"," "]], + [ + "<div style=\"white-space:pre-line\">foo bar</div>", + "<div style=\"white-space:pre-line\">foo bar</div>", + "<div style=\"white-space:pre-line\">foo bar</div>", + ], + [true], + {"inserttext":[false,false,"",false,false,""]}], +["<div style=white-space:pre-line>foo[]</div>", + [["inserttext"," "]], + [ + "<div style=\"white-space:pre-line\">foo </div>", + "<div style=\"white-space:pre-line\">foo </div>", + "<div style=\"white-space:pre-line\">foo \n</div>", + "<div style=\"white-space:pre-line\">foo \n</div>", + "<div style=\"white-space:pre-line\">foo <br></div>", + "<div style=\"white-space:pre-line\">foo <br></div>", + ], + [true], + {"inserttext":[false,false,"",false,false,""]}], +["<div style=white-space:nowrap>foo[]bar</div>", + [["inserttext"," "]], + [ + "<div style=\"white-space:nowrap\">foo bar</div>", + "<div style=\"white-space:nowrap\">foo bar</div>", + "<div style=\"white-space:nowrap\">foo bar</div>", + ], + [true], + {"inserttext":[false,false,"",false,false,""]}], +["<div style=white-space:nowrap>foo[]</div>", + [["inserttext"," "]], + [ + "<div style=\"white-space:nowrap\">foo </div>", + "<div style=\"white-space:nowrap\">foo </div>", + "<div style=\"white-space:nowrap\">foo \n</div>", + "<div style=\"white-space:nowrap\">foo \n</div>", + "<div style=\"white-space:nowrap\">foo <br></div>", + "<div style=\"white-space:nowrap\">foo <br></div>", + ], + [true], + {"inserttext":[false,false,"",false,false,""]}], +// If selection is after a <br> element in a block and the <br> element follows +// last visible thing in the block, content should be inserted before the <br> +// element. +["<p>a<br>{}<span></span></p>", + [["inserttext","b"]], + "<p>ab<br><span></span></p>", + [true], + {"inserttext":[false,false,"",false,false,""]}], +// In this case, the <span> element after <br> element is visible and is put in +// the second line, but for backward compatibility, typing text should be +// inserted before the <br> element. +["<p style=\"white-space:pre-wrap\">a<br>{}<span style=\"padding:1px\"></span></p>", + [["inserttext","b"]], + "<p style=\"white-space:pre-wrap\">ab<br><span style=\"padding:1px\"></span></p>", + [true], + {"inserttext":[false,false,"",false,false,""]}], +// Similar case if <br> follows last visible thing and is followed by invisible +// inline element and a block. In this case, Chrome inserts text into the +// following block so that the expectation follows it. +["<div>a<br>{}<span></span><p>c</p></div>", + [["inserttext","b"]], + "<div>a<br><span></span><p>bc</p></div>", + [true], + {"inserttext":[false,false,"",false,false,""]}], +// And even if the <br> element is followed by visible but empty inline element, +// should be same as previous test. +["<div style=\"white-space:pre-wrap\">a<br>{}<span style=\"padding:1px\"></span><p>c</p></div>", + [["inserttext","b"]], + "<div style=\"white-space:pre-wrap\">a<br><span style=\"padding:1px\"></span><p>bc</p></div>", + [true], + {"inserttext":[false,false,"",false,false,""]}], +// https://bugzilla.mozilla.org/show_bug.cgi?id=1785801 +["<div>abc{</div><div>}efg</div>", + [["inserttext", "d"]], + "<div>abcdefg</div>", + [true], + {"inserttext":[false,false,"",false,false,""]}], + +// Tests preserving inline style of the last visible thing in the selection +// for replacing text. +["<div>abc{<b><i>def</i></b>}ghi</div>", + [["inserttext","d"],["inserttext","e"],["inserttext","f"]], + "<div>abc<b><i>def</i></b>ghi</div>", + [true,true,true], + {}], +["<div>abc<b><i>[def]</i></b>ghi</div>", + [["inserttext","d"],["inserttext","e"],["inserttext","f"]], + "<div>abc<b><i>def</i></b>ghi</div>", + [true,true,true], + {}], +["<div>abc[<b><i>def]</i></b>ghi</div>", + [["inserttext","d"],["inserttext","e"],["inserttext","f"]], + "<div>abc<b><i>def</i></b>ghi</div>", + [true,true,true], + {}], +["<div>abc<b><i>[def</i></b>]ghi</div>", + [["inserttext","d"],["inserttext","e"],["inserttext","f"]], + "<div>abc<b><i>def</i></b>ghi</div>", + [true,true,true], + {}], +["<div>abc<b><i>[def</i></b>g]hi</div>", + [["inserttext","d"],["inserttext","e"],["inserttext","f"],["inserttext","g"]], + "<div>abc<b><i>defg</i></b>hi</div>", + [true,true,true,true], + {}], +["<div>abc[<b><i>def</i></b>g]hi</div>", + [["inserttext","d"],["inserttext","e"],["inserttext","f"],["inserttext","g"]], + "<div>abc<b><i>defg</i></b>hi</div>", + [true,true,true,true], + {}], +["<div>abc{<b><i>def</i></b>g]hi</div>", + [["inserttext","d"],["inserttext","e"],["inserttext","f"],["inserttext","g"]], + "<div>abc<b><i>defg</i></b>hi</div>", + [true,true,true,true], + {}], +// Don't preserve inline styles if first content is <img> and it's replaced. +["<div>abc[<b><i><img src=\"/img/lion.svg\">de]f</i></b>ghi</div>", + [["inserttext","d"],["inserttext","e"]], + "<div>abcde<b><i>f</i></b>ghi</div>", + [true,true], + {}], +["<div>abc[<b><i><img src=\"/img/lion.svg\">def]</i></b>ghi</div>", + [["inserttext","d"],["inserttext","e"],["inserttext","f"]], + "<div>abcdefghi</div>", + [true,true,true], + {}], +["<div>abc[<b><i><img src=\"/img/lion.svg\">def</i></b>]ghi</div>", + [["inserttext","d"],["inserttext","e"],["inserttext","f"]], + "<div>abcdefghi</div>", + [true,true,true], + {}], +["<div>abc{<b><i><img src=\"/img/lion.svg\">def</i></b>]ghi</div>", + [["inserttext","d"],["inserttext","e"],["inserttext","f"]], + "<div>abcdefghi</div>", + [true,true,true], + {}], +// Don't preserve inline styles even if end boundary is styled. +["<div>ab[c<b><i>de]f</i></b>ghi</div>", + [["inserttext","c"],["inserttext","d"],["inserttext","e"]], + "<div>abcde<b><i>f</i></b>ghi</div>", + [true,true,true], + {}], +// But preserve inline styles if first content is styled. +["<div>abc[<b><i>de]f</i></b>ghi</div>", + [["inserttext","d"],["inserttext","e"]], + "<div>abc<b><i>def</i></b>ghi</div>", + [true,true], + {}], +["<div>abc{<b><i>de]f</i></b>ghi</div>", + [["inserttext","d"],["inserttext","e"]], + "<div>abc<b><i>def</i></b>ghi</div>", + [true,true], + {}], +// Don't preserve empty inline style, but preserve the following text style if first content is text +["<div>abc[<s></s><b><i>de]f</i></b>ghi</div>", + [["inserttext","d"],["inserttext","e"]], + ["<div>abc<b><i>def</i></b>ghi</div>", + "<div>abc<s></s><b><i>def</i></b>ghi</div>"], + [true,true], + {}], +["<div>abc{<s></s><b><i>de]f</i></b>ghi</div>", + [["inserttext","d"],["inserttext","e"]], + ["<div>abc<b><i>def</i></b>ghi</div>", + "<div>abc<s></s><b><i>def</i></b>ghi</div>"], + [true,true], + {}], + +] |