// 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"]],
"
foo
{}bar
",
[true,true],
{"defaultparagraphseparator":[false,false,"div",false,false,"div"],"inserttext":[false,false,"",false,false,""]}],
["foo[]bar",
[["defaultparagraphseparator","p"],["inserttext","\n"]],
"foo
{}bar
",
[true,true],
{"defaultparagraphseparator":[false,false,"div",false,false,"p"],"inserttext":[false,false,"",false,false,""]}],
["foo[]bar",
[["defaultparagraphseparator","div"],["inserttext","abc\ndef"]],
"fooabc
def[]bar
",
[true,true],
{"defaultparagraphseparator":[false,false,"p",false,false,"div"],"inserttext":[false,false,"",false,false,""]}],
["foo[]bar",
[["defaultparagraphseparator","p"],["inserttext","abc\ndef"]],
"fooabc
def[]bar
",
[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","hi"]],
"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&[]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,""]}],
["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,""]}],
["{}
",
[["inserttext"," "]],
" []",
[true],
{"inserttext":[false,false,"",false,false,""]}],
["{}
",
[["inserttext"," "]],
"
[]
",
[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[]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[]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[]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[]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,""]}],
["http://a[]",
[["inserttext"," "]],
"http://a []",
[true],
{"inserttext":[false,false,"",false,false,""]}],
["ftp://a[]",
[["inserttext"," "]],
"ftp://a []",
[true],
{"inserttext":[false,false,"",false,false,""]}],
["quasit://a[]",
[["inserttext"," "]],
"quasit://a []",
[true],
{"inserttext":[false,false,"",false,false,""]}],
[".x-++-.://a[]",
[["inserttext"," "]],
".x-++-.://a []",
[true],
{"inserttext":[false,false,"",false,false,""]}],
["(http://a)[]",
[["inserttext"," "]],
"(http://a) []",
[true],
{"inserttext":[false,false,"",false,false,""]}],
["<http://a>[]",
[["inserttext"," "]],
"<http://a> []",
[true],
{"inserttext":[false,false,"",false,false,""]}],
["http://a![]",
[["inserttext"," "]],
"http://a! []",
[true],
{"inserttext":[false,false,"",false,false,""]}],
["!\"#$%&'()*+,-./:;<=>?^_`|~http://a!\"#$%&'()*+,-./:;<=>?^_`|~[]",
[["inserttext"," "]],
"!\"#$%&'()*+,-./:;<=>?^_`|~http://a!\"#$%&'()*+,-./:;<=>?^_`|~ []",
[true],
{"inserttext":[false,false,"",false,false,""]}],
["http://a!\"'(),-.:;<>`[]",
[["inserttext"," "]],
"http://a!\"'(),-.:;<>` []",
[true],
{"inserttext":[false,false,"",false,false,""]}],
["http://a#$%&*+/=?^_|~[]",
[["inserttext"," "]],
"http://a#$%&*+/=?^_|~ []",
[true],
{"inserttext":[false,false,"",false,false,""]}],
["mailto:a[]",
[["inserttext"," "]],
"mailto:a []",
[true],
{"inserttext":[false,false,"",false,false,""]}],
["a@b[]",
[["inserttext"," "]],
"a@b []",
[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"," "]],
"#@x []",
[true],
{"inserttext":[false,false,"",false,false,""]}],
["a@.[]",
[["inserttext"," "]],
"a@. []",
[true],
{"inserttext":[false,false,"",false,false,""]}],
["!\"#$%&'()*+,-./:;<=>?^_`|~a@b!\"#$%&'()*+,-./:;<=>?^_`|~[]",
[["inserttext"," "]],
"!\"#$%&'()*+,-./:;<=>?^_`|~a@b!\"#$%&'()*+,-./:;<=>?^_`|~ []",
[true],
{"inserttext":[false,false,"",false,false,""]}],
["a@b{}",
[["inserttext"," "]],
"a@b []",
[true],
{"inserttext":[false,false,"",false,false,""]}],
["a@b{}",
[["inserttext"," "]],
"a@b []",
[true],
{"inserttext":[false,false,"",false,false,""]}],
["a@b[]c",
[["inserttext"," "]],
"a@b []c",
[true],
{"inserttext":[false,false,"",false,false,""]}],
["a@b
[]c
",
[["inserttext"," "]],
"a@b
[]c
",
[true],
{"inserttext":[false,false,"",false,false,""]}],
["http://a[]",
[["inserttext","a"]],
"http://aa[]",
[true],
{"inserttext":[false,false,"",false,false,""]}],
["http://a[]",
[["inserttext","\t"]],
"http://a\t[]",
[true],
{"inserttext":[false,false,"",false,false,""]}],
["http://a[]",
[["inserttext","\f"]],
"http://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,""]}],
["foo[]",
[["inserttext","a"]],
"
fooa[]
",
[true],
{"inserttext":[false,false,"",false,false,""]}],
["foo
{}",
[["inserttext","a"]],
"foo
a[]",
[true],
{"inserttext":[false,false,"",false,false,""]}],
["[]foo",
[["inserttext","a"]],
"
a[]foo
",
[true],
{"inserttext":[false,false,"",false,false,""]}],
["{}foo",
[["inserttext","a"]],
"
a[]foo
",
[true],
{"inserttext":[false,false,"",false,false,""]}],
["{}foo",
[["inserttext","a"]],
"a[]
foo
",
[true],
{"inserttext":[false,false,"",false,false,""]}],
["foo
{}bar
",
[["inserttext","a"]],
"foo
a[]bar
",
[true],
{"inserttext":[false,false,"",false,false,""]}],
["foo[]bar",
[["inserttext","a"]],
"fooa[]bar",
[true],
{"inserttext":[false,false,"",false,false,""]}],
["foo[]bar",
[["inserttext","a"]],
"fooa[]bar",
[true],
{"inserttext":[false,false,"",false,false,""]}],
["foo{}bar",
[["inserttext","a"]],
"fooa[]bar",
[true],
{"inserttext":[false,false,"",false,false,""]}],
["foo[]bar",
[["inserttext","a"]],
"fooa[]bar",
[true],
{"inserttext":[false,false,"",false,false,""]}],
["foo[]bar",
[["inserttext","a"]],
"fooa[]bar",
[true],
{"inserttext":[false,false,"",false,false,""]}],
["foo[]bar",
[["inserttext","a"]],
"fooa[]bar",
[true],
{"inserttext":[false,false,"",false,false,""]}],
["foo[]bar",
[["inserttext","a"]],
"fooa[]bar",
[true],
{"inserttext":[false,false,"",false,false,""]}],
["fo[o
b]ar",
[["defaultparagraphseparator","div"],["inserttext","a"]],
"
foa[]ar
",
[true,true],
{"defaultparagraphseparator":[false,false,"p",false,false,"div"],"inserttext":[false,false,"",false,false,""]}],
["fo[o
b]ar",
[["defaultparagraphseparator","p"],["inserttext","a"]],
"
foa[]ar
",
[true,true],
{"defaultparagraphseparator":[false,false,"div",false,false,"p"],"inserttext":[false,false,"",false,false,""]}],
["fo[o
bar
b]az",
[["defaultparagraphseparator","div"],["inserttext","a"]],
"
foa[]az
",
[true,true],
{"defaultparagraphseparator":[false,false,"p",false,false,"div"],"inserttext":[false,false,"",false,false,""]}],
["fo[o
bar
b]az",
[["defaultparagraphseparator","p"],["inserttext","a"]],
"
foa[]az
",
[true,true],
{"defaultparagraphseparator":[false,false,"div",false,false,"p"],"inserttext":[false,false,"",false,false,""]}],
["{}
",
[["inserttext","a"]],
"a[]",
[true],
{"inserttext":[false,false,"",false,false,""]}],
["{}
",
[["inserttext","a"]],
"
a[]
",
[true],
{"inserttext":[false,false,"",false,false,""]}],
["{}
",
[["inserttext","a"]],
"
a[]
",
[true],
{"inserttext":[false,false,"",false,false,""]}],
["foo[bar]baz",
[["inserttext","a"]],
"
fooa[]baz
",
[true],
{"inserttext":[false,false,"",false,false,""]}],
["foo{bar}baz",
[["inserttext","a"]],
"
fooa[]baz
",
[true],
{"inserttext":[false,false,"",false,false,""]}],
["foo{bar}baz",
[["inserttext","a"]],
"
fooa[]baz
",
[true],
{"inserttext":[false,false,"",false,false,""]}],
["[foobar]baz",
[["stylewithcss","true"],["inserttext","a"]],
"
a[]baz
",
[true,true],
{"stylewithcss":[false,false,"",false,true,""],"inserttext":[false,false,"",false,false,""]}],
["[foobar]baz",
[["stylewithcss","false"],["inserttext","a"]],
"
a[]baz
",
[true,true],
{"stylewithcss":[false,true,"",false,false,""],"inserttext":[false,false,"",false,false,""]}],
["{foobar}baz",
[["stylewithcss","true"],["inserttext","a"]],
"
a[]baz
",
[true,true],
{"stylewithcss":[false,false,"",false,true,""],"inserttext":[false,false,"",false,false,""]}],
["{foobar}baz",
[["stylewithcss","false"],["inserttext","a"]],
"
a[]baz
",
[true,true],
{"stylewithcss":[false,true,"",false,false,""],"inserttext":[false,false,"",false,false,""]}],
["foo[barbaz]",
[["inserttext","a"]],
"
fooa[]
",
[true],
{"inserttext":[false,false,"",false,false,""]}],
["foo{barbaz}",
[["inserttext","a"]],
"
fooa[]
",
[true],
{"inserttext":[false,false,"",false,false,""]}],
["foo[barbaz]quz",
[["stylewithcss","true"],["inserttext","a"]],
"
fooa[]quz
",
[true,true],
{"stylewithcss":[false,false,"",false,true,""],"inserttext":[false,false,"",false,false,""]}],
["foo[barbaz]quz",
[["stylewithcss","false"],["inserttext","a"]],
"
fooa[]quz
",
[true,true],
{"stylewithcss":[false,true,"",false,false,""],"inserttext":[false,false,"",false,false,""]}],
["foo[bar]baz",
[["inserttext","a"]],
"fooa[]baz",
[true],
{"inserttext":[false,false,"",false,false,""]}],
["foo[bar]baz",
[["inserttext","a"]],
"fooa[]baz",
[true],
{"inserttext":[false,false,"",false,false,""]}],
["foo[bar]baz",
[["inserttext","a"]],
"fooa[]baz",
[true],
{"inserttext":[false,false,"",false,false,""]}],
["foo[bar]baz",
[["inserttext","a"]],
"fooa[]baz",
[true],
{"inserttext":[false,false,"",false,false,""]}],
["foo[bar]baz",
[["inserttext","a"]],
"fooa[]baz",
[true],
{"inserttext":[false,false,"",false,false,""]}],
["foo[bar]baz",
[["inserttext","a"]],
"fooa[]baz",
[true],
{"inserttext":[false,false,"",false,false,""]}],
["foo[bar]baz",
[["inserttext","a"]],
"fooa[]baz",
[true],
{"inserttext":[false,false,"",false,false,""]}],
["foo[bar]baz",
[["inserttext","a"]],
"fooa[]baz",
[true],
{"inserttext":[false,false,"",false,false,""]}],
["foo[bar]baz",
[["inserttext","a"]],
"fooa[]baz",
[true],
{"inserttext":[false,false,"",false,false,""]}],
["foo[bar]baz",
[["inserttext","a"]],
"fooa[]baz",
[true],
{"inserttext":[false,false,"",false,false,""]}],
["foo[bar]baz",
[["inserttext","a"]],
"fooa[]baz",
[true],
{"inserttext":[false,false,"",false,false,""]}],
["foo[bar]baz",
[["inserttext","a"]],
"fooa[]baz",
[true],
{"inserttext":[false,false,"",false,false,""]}],
["foo[bar]baz",
[["inserttext","a"]],
"fooa[]baz",
[true],
{"inserttext":[false,false,"",false,false,""]}],
["foo[bar]baz",
[["inserttext","a"]],
"fooa[]baz",
[true],
{"inserttext":[false,false,"",false,false,""]}],
["foo[bar]baz",
[["inserttext","a"]],
"fooa[]baz",
[true],
{"inserttext":[false,false,"",false,false,""]}],
["foo[bar]baz",
[["inserttext","a"]],
"fooa[]baz",
[true],
{"inserttext":[false,false,"",false,false,""]}],
["foo[bar]baz",
[["inserttext","a"]],
"fooa[]baz",
[true],
{"inserttext":[false,false,"",false,false,""]}],
["foo[bar]baz",
[["inserttext","a"]],
"fooa[]baz",
[true],
{"inserttext":[false,false,"",false,false,""]}],
["foo[bar]baz",
[["inserttext","a"]],
"fooa[]baz",
[true],
{"inserttext":[false,false,"",false,false,""]}],
["foo[bar]baz",
[["inserttext","a"]],
"fooa[]baz",
[true],
{"inserttext":[false,false,"",false,false,""]}],
["foo[bar]baz",
[["inserttext","a"]],
"fooa[]baz",
[true],
{"inserttext":[false,false,"",false,false,""]}],
["foo[bar]baz",
[["inserttext","a"]],
"fooa[]baz",
[true],
{"inserttext":[false,false,"",false,false,""]}],
["[foobar]baz",
[["stylewithcss","true"],["inserttext","a"]],
"a[]baz",
[true,true],
{"stylewithcss":[false,false,"",false,true,""],"inserttext":[false,false,"",false,false,""]}],
["[foobar]baz",
[["stylewithcss","false"],["inserttext","a"]],
"a[]baz",
[true,true],
{"stylewithcss":[false,true,"",false,false,""],"inserttext":[false,false,"",false,false,""]}],
["[foobar]baz",
[["stylewithcss","true"],["inserttext","a"]],
"a[]baz",
[true,true],
{"stylewithcss":[false,false,"",false,true,""],"inserttext":[false,false,"",false,false,""]}],
["[foobar]baz",
[["stylewithcss","false"],["inserttext","a"]],
"a[]baz",
[true,true],
{"stylewithcss":[false,true,"",false,false,""],"inserttext":[false,false,"",false,false,""]}],
["[foobar]baz",
[["stylewithcss","true"],["inserttext","a"]],
"a[]baz",
[true,true],
{"stylewithcss":[false,false,"",false,true,""],"inserttext":[false,false,"",false,false,""]}],
["[foobar]baz",
[["stylewithcss","false"],["inserttext","a"]],
"a[]baz",
[true,true],
{"stylewithcss":[false,true,"",false,false,""],"inserttext":[false,false,"",false,false,""]}],
["[foobar]baz",
[["stylewithcss","true"],["inserttext","a"]],
"a[]baz",
[true,true],
{"stylewithcss":[false,false,"",false,true,""],"inserttext":[false,false,"",false,false,""]}],
["[foobar]baz",
[["stylewithcss","false"],["inserttext","a"]],
"a[]baz",
[true,true],
{"stylewithcss":[false,true,"",false,false,""],"inserttext":[false,false,"",false,false,""]}],
["[foobar]baz",
[["stylewithcss","true"],["inserttext","a"]],
"a[]baz",
[true,true],
{"stylewithcss":[false,false,"",false,true,""],"inserttext":[false,false,"",false,false,""]}],
["[foobar]baz",
[["stylewithcss","false"],["inserttext","a"]],
"a[]baz",
[true,true],
{"stylewithcss":[false,true,"",false,false,""],"inserttext":[false,false,"",false,false,""]}],
["[foobar]baz",
[["stylewithcss","true"],["inserttext","a"]],
"a[]baz",
[true,true],
{"stylewithcss":[false,false,"",false,true,""],"inserttext":[false,false,"",false,false,""]}],
["[foobar]baz",
[["stylewithcss","false"],["inserttext","a"]],
"a[]baz",
[true,true],
{"stylewithcss":[false,true,"",false,false,""],"inserttext":[false,false,"",false,false,""]}],
["[foobar]baz",
[["inserttext","a"]],
"a[]baz",
[true],
{"inserttext":[false,false,"",false,false,""]}],
["[foobar]baz",
[["stylewithcss","true"],["inserttext","a"]],
"a[]baz",
[true,true],
{"stylewithcss":[false,false,"",false,true,""],"inserttext":[false,false,"",false,false,""]}],
["[foobar]baz",
[["stylewithcss","false"],["inserttext","a"]],
"a[]baz",
[true,true],
{"stylewithcss":[false,true,"",false,false,""],"inserttext":[false,false,"",false,false,""]}],
["[foobar]baz",
[["stylewithcss","true"],["inserttext","a"]],
"a[]baz",
[true,true],
{"stylewithcss":[false,false,"",false,true,""],"inserttext":[false,false,"",false,false,""]}],
["[foobar]baz",
[["stylewithcss","false"],["inserttext","a"]],
"a[]baz",
[true,true],
{"stylewithcss":[false,true,"",false,false,""],"inserttext":[false,false,"",false,false,""]}],
["[foobar]baz",
[["stylewithcss","true"],["inserttext","a"]],
"a[]baz",
[true,true],
{"stylewithcss":[false,false,"",false,true,""],"inserttext":[false,false,"",false,false,""]}],
["[foobar]baz",
[["stylewithcss","false"],["inserttext","a"]],
"a[]baz",
[true,true],
{"stylewithcss":[false,true,"",false,false,""],"inserttext":[false,false,"",false,false,""]}],
["[foobar]baz",
[["stylewithcss","true"],["inserttext","a"]],
"a[]baz",
[true,true],
{"stylewithcss":[false,false,"",false,true,""],"inserttext":[false,false,"",false,false,""]}],
["[foobar]baz",
[["stylewithcss","false"],["inserttext","a"]],
"a[]baz",
[true,true],
{"stylewithcss":[false,true,"",false,false,""],"inserttext":[false,false,"",false,false,""]}],
["[foobar]baz",
[["stylewithcss","true"],["inserttext","a"]],
"a[]baz",
[true,true],
{"stylewithcss":[false,false,"",false,true,""],"inserttext":[false,false,"",false,false,""]}],
["[foobar]baz",
[["stylewithcss","false"],["inserttext","a"]],
"a[]baz",
[true,true],
{"stylewithcss":[false,true,"",false,false,""],"inserttext":[false,false,"",false,false,""]}],
["[foobar]baz",
[["stylewithcss","true"],["inserttext","a"]],
"a[]baz",
[true,true],
{"stylewithcss":[false,false,"",false,true,""],"inserttext":[false,false,"",false,false,""]}],
["[foobar]baz",
[["stylewithcss","false"],["inserttext","a"]],
"a[]baz",
[true,true],
{"stylewithcss":[false,true,"",false,false,""],"inserttext":[false,false,"",false,false,""]}],
["[foobar]baz",
[["stylewithcss","true"],["inserttext","a"]],
"a[]baz",
[true,true],
{"stylewithcss":[false,false,"",false,true,""],"inserttext":[false,false,"",false,false,""]}],
["[foobar]baz",
[["stylewithcss","false"],["inserttext","a"]],
"a[]baz",
[true,true],
{"stylewithcss":[false,true,"",false,false,""],"inserttext":[false,false,"",false,false,""]}],
["[foobar]baz",
[["stylewithcss","true"],["inserttext","a"]],
"a[]baz",
[true,true],
{"stylewithcss":[false,false,"",false,true,""],"inserttext":[false,false,"",false,false,""]}],
["[foobar]baz",
[["stylewithcss","false"],["inserttext","a"]],
"a[]baz",
[true,true],
{"stylewithcss":[false,true,"",false,false,""],"inserttext":[false,false,"",false,false,""]}],
["[foobar]baz",
[["stylewithcss","true"],["inserttext","a"]],
"a[]baz",
[true,true],
{"stylewithcss":[false,false,"",false,true,""],"inserttext":[false,false,"",false,false,""]}],
["[foobar]baz",
[["stylewithcss","false"],["inserttext","a"]],
"a[]baz",
[true,true],
{"stylewithcss":[false,true,"",false,false,""],"inserttext":[false,false,"",false,false,""]}],
["[foobar]baz",
[["stylewithcss","true"],["inserttext","a"]],
"a[]baz",
[true,true],
{"stylewithcss":[false,false,"",false,true,""],"inserttext":[false,false,"",false,false,""]}],
["[foobar]baz",
[["stylewithcss","false"],["inserttext","a"]],
"a[]baz",
[true,true],
{"stylewithcss":[false,true,"",false,false,""],"inserttext":[false,false,"",false,false,""]}],
["[foobar]baz",
[["stylewithcss","true"],["inserttext","a"]],
"a[]baz",
[true,true],
{"stylewithcss":[false,false,"",false,true,""],"inserttext":[false,false,"",false,false,""]}],
["[foobar]baz",
[["stylewithcss","false"],["inserttext","a"]],
"a[]baz",
[true,true],
{"stylewithcss":[false,true,"",false,false,""],"inserttext":[false,false,"",false,false,""]}],
["[foobar]baz",
[["stylewithcss","true"],["inserttext","a"]],
"a[]baz",
[true,true],
{"stylewithcss":[false,false,"",false,true,""],"inserttext":[false,false,"",false,false,""]}],
["[foobar]baz",
[["stylewithcss","false"],["inserttext","a"]],
"a[]baz",
[true,true],
{"stylewithcss":[false,true,"",false,false,""],"inserttext":[false,false,"",false,false,""]}],
["[foobar]baz",
[["stylewithcss","true"],["inserttext","a"]],
"a[]baz",
[true,true],
{"stylewithcss":[false,false,"",false,true,""],"inserttext":[false,false,"",false,false,""]}],
["[foobar]baz",
[["stylewithcss","false"],["inserttext","a"]],
"a[]baz",
[true,true],
{"stylewithcss":[false,true,"",false,false,""],"inserttext":[false,false,"",false,false,""]}],
["[foobar]baz",
[["stylewithcss","true"],["inserttext","a"]],
"a[]baz",
[true,true],
{"stylewithcss":[false,false,"",false,true,""],"inserttext":[false,false,"",false,false,""]}],
["[foobar]baz",
[["stylewithcss","false"],["inserttext","a"]],
"a[]baz",
[true,true],
{"stylewithcss":[false,true,"",false,false,""],"inserttext":[false,false,"",false,false,""]}],
["[foobar]baz",
[["stylewithcss","true"],["inserttext","a"]],
"a[]baz",
[true,true],
{"stylewithcss":[false,false,"",false,true,""],"inserttext":[false,false,"",false,false,""]}],
["[foobar]baz",
[["stylewithcss","false"],["inserttext","a"]],
"a[]baz",
[true,true],
{"stylewithcss":[false,true,"",false,false,""],"inserttext":[false,false,"",false,false,""]}],
["foo[barbaz]",
[["inserttext","a"]],
"fooa[]",
[true],
{"inserttext":[false,false,"",false,false,""]}],
["foo[barbaz]",
[["inserttext","a"]],
"fooa[]",
[true],
{"inserttext":[false,false,"",false,false,""]}],
["foo[barbaz]",
[["inserttext","a"]],
"fooa[]",
[true],
{"inserttext":[false,false,"",false,false,""]}],
["foo[barbaz]",
[["inserttext","a"]],
"fooa[]",
[true],
{"inserttext":[false,false,"",false,false,""]}],
["foo[barbaz]",
[["inserttext","a"]],
"fooa[]",
[true],
{"inserttext":[false,false,"",false,false,""]}],
["foo[barbaz]",
[["inserttext","a"]],
"fooa[]",
[true],
{"inserttext":[false,false,"",false,false,""]}],
["foo[barbaz]",
[["inserttext","a"]],
"fooa[]",
[true],
{"inserttext":[false,false,"",false,false,""]}],
["foo[barbaz]",
[["inserttext","a"]],
"fooa[]",
[true],
{"inserttext":[false,false,"",false,false,""]}],
["foo[barbaz]",
[["inserttext","a"]],
"fooa[]",
[true],
{"inserttext":[false,false,"",false,false,""]}],
["foo[barbaz]",
[["inserttext","a"]],
"fooa[]",
[true],
{"inserttext":[false,false,"",false,false,""]}],
["foo[barbaz]",
[["inserttext","a"]],
"fooa[]",
[true],
{"inserttext":[false,false,"",false,false,""]}],
// should always be removed if entirely replaced.
["foo[barbaz]",
[["inserttext","a"]],
"fooa[]",
[true],
{"inserttext":[false,false,"",false,false,""]}],
["foo[barbaz]",
[["inserttext","a"]],
"fooa[]",
[true],
{"inserttext":[false,false,"",false,false,""]}],
["foo[barbaz]",
[["inserttext","a"]],
"fooa[]",
[true],
{"inserttext":[false,false,"",false,false,""]}],
["foo[barbaz]",
[["inserttext","a"]],
"fooa[]",
[true],
{"inserttext":[false,false,"",false,false,""]}],
["foo[barbaz]",
[["inserttext","a"]],
"fooa[]",
[true],
{"inserttext":[false,false,"",false,false,""]}],
["foo[barbaz]",
[["inserttext","a"]],
"fooa[]",
[true],
{"inserttext":[false,false,"",false,false,""]}],
["foo[barbaz]",
[["inserttext","a"]],
"fooa[]",
[true],
{"inserttext":[false,false,"",false,false,""]}],
["foo[barbaz]",
[["inserttext","a"]],
"fooa[]",
[true],
{"inserttext":[false,false,"",false,false,""]}],
["foo[barbaz]",
[["inserttext","a"]],
"fooa[]",
[true],
{"inserttext":[false,false,"",false,false,""]}],
["foo[barbaz]",
[["inserttext","a"]],
"fooa[]",
[true],
{"inserttext":[false,false,"",false,false,""]}],
["foo[barbaz]",
[["inserttext","a"]],
"fooa[]",
[true],
{"inserttext":[false,false,"",false,false,""]}],
["[foo]
",
[["inserttext","a"]],
"a[]
",
[true],
{"inserttext":[false,false,"",false,false,""]}],
["[] abc
",
[["inserttext"," "]],
" abc
",
[true],
{"inserttext":[false,false,"",false,false,""]}],
[" []abc
",
[["inserttext"," "]],
" abc
",
[true],
{"inserttext":[false,false,"",false,false,""]}],
["[] abc
",
[["inserttext"," "]],
" abc
",
[true],
{"inserttext":[false,false,"",false,false,""]}],
[" [] abc
",
[["inserttext"," "]],
" abc
",
[true],
{"inserttext":[false,false,"",false,false,""]}],
[" []abc
",
[["inserttext"," "]],
" abc
",
[true],
{"inserttext":[false,false,"",false,false,""]}],
["abc[]
",
[["inserttext"," "]],
["abc
",
"abc
"],
[true],
{"inserttext":[false,false,"",false,false,""]}],
["abc []
",
[["inserttext"," "]],
["abc
",
"abc
"],
[true],
{"inserttext":[false,false,"",false,false,""]}],
["abc[]
",
[["inserttext"," "]],
["abc
",
"abc
"],
[true],
{"inserttext":[false,false,"",false,false,""]}],
["abc []
",
[["inserttext"," "]],
["abc
",
"abc
"],
[true],
{"inserttext":[false,false,"",false,false,""]}],
["abc []
",
[["inserttext"," "]],
["abc
",
"abc
"],
[true],
{"inserttext":[false,false,"",false,false,""]}],
["
{}",
[["inserttext","a"]],
["a", "a
"],
[true],
{"inserttext":[false,false,"",false,false,""]}],
["abc
{}",
[["inserttext","d"]],
["abcd", "abcd
"],
[true],
{"inserttext":[false,false,"",false,false,""]}],
["abc
{}
",
[["inserttext","d"]],
["abc
d",
"abc
d
"],
[true],
{"inserttext":[false,false,"",false,false,""]}],
["abc
{}",
[["inserttext","d"]],
["abcd",
"abcd
"],
[true],
{"inserttext":[false,false,"",false,false,""]}],
["
{}
",
[["inserttext","a"]],
["a
",
"a
"],
[true],
{"inserttext":[false,false,"",false,false,""]}],
["abc
{}
",
[["inserttext","d"]],
["abcd
",
"abcd
"],
[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[]bar
",
[["inserttext"," "]],
"foo bar
",
[true],
{"inserttext":[false,false,"",false,false,""]}],
["foo[]
",
[["inserttext"," "]],
"foo
",
[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.
["foo[]bar
",
[["inserttext"," "]],
[
"foo bar
",
"foo bar
",
"foo bar
",
],
[true],
{"inserttext":[false,false,"",false,false,""]}],
["foo[]
",
[["inserttext"," "]],
[
"foo
",
"foo
",
"foo \n
",
"foo \n
",
"foo
",
"foo
",
],
[true],
{"inserttext":[false,false,"",false,false,""]}],
["foo[]bar
",
[["inserttext"," "]],
[
"foo bar
",
"foo bar
",
"foo bar
",
],
[true],
{"inserttext":[false,false,"",false,false,""]}],
["foo[]
",
[["inserttext"," "]],
[
"foo
",
"foo
",
"foo \n
",
"foo \n
",
"foo
",
"foo
",
],
[true],
{"inserttext":[false,false,"",false,false,""]}],
// If selection is after a
element in a block and the
element follows
// last visible thing in the block, content should be inserted before the
// element.
["a
{}
",
[["inserttext","b"]],
"ab
",
[true],
{"inserttext":[false,false,"",false,false,""]}],
// In this case, the element after
element is visible and is put in
// the second line, but for backward compatibility, typing text should be
// inserted before the
element.
["a
{}
",
[["inserttext","b"]],
"ab
",
[true],
{"inserttext":[false,false,"",false,false,""]}],
// Similar case if
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.
["",
[["inserttext","b"]],
"",
[true],
{"inserttext":[false,false,"",false,false,""]}],
// And even if the
element is followed by visible but empty inline element,
// should be same as previous test.
["",
[["inserttext","b"]],
"",
[true],
{"inserttext":[false,false,"",false,false,""]}],
// https://bugzilla.mozilla.org/show_bug.cgi?id=1785801
["abc{
}efg
",
[["inserttext", "d"]],
"abcdefg
",
[true],
{"inserttext":[false,false,"",false,false,""]}],
// Tests preserving inline style of the last visible thing in the selection
// for replacing text.
["abc{def}ghi
",
[["inserttext","d"],["inserttext","e"],["inserttext","f"]],
"abcdefghi
",
[true,true,true],
{}],
["abc[def]ghi
",
[["inserttext","d"],["inserttext","e"],["inserttext","f"]],
"abcdefghi
",
[true,true,true],
{}],
["abc[def]ghi
",
[["inserttext","d"],["inserttext","e"],["inserttext","f"]],
"abcdefghi
",
[true,true,true],
{}],
["abc[def]ghi
",
[["inserttext","d"],["inserttext","e"],["inserttext","f"]],
"abcdefghi
",
[true,true,true],
{}],
["abc[defg]hi
",
[["inserttext","d"],["inserttext","e"],["inserttext","f"],["inserttext","g"]],
"abcdefghi
",
[true,true,true,true],
{}],
["abc[defg]hi
",
[["inserttext","d"],["inserttext","e"],["inserttext","f"],["inserttext","g"]],
"abcdefghi
",
[true,true,true,true],
{}],
["abc{defg]hi
",
[["inserttext","d"],["inserttext","e"],["inserttext","f"],["inserttext","g"]],
"abcdefghi
",
[true,true,true,true],
{}],
// Don't preserve inline styles if first content is and it's replaced.
["abc[
de]fghi
",
[["inserttext","d"],["inserttext","e"]],
"abcdefghi
",
[true,true],
{}],
["abc[
def]ghi
",
[["inserttext","d"],["inserttext","e"],["inserttext","f"]],
"abcdefghi
",
[true,true,true],
{}],
["abc[
def]ghi
",
[["inserttext","d"],["inserttext","e"],["inserttext","f"]],
"abcdefghi
",
[true,true,true],
{}],
["abc{
def]ghi
",
[["inserttext","d"],["inserttext","e"],["inserttext","f"]],
"abcdefghi
",
[true,true,true],
{}],
// Don't preserve inline styles even if end boundary is styled.
["ab[cde]fghi
",
[["inserttext","c"],["inserttext","d"],["inserttext","e"]],
"abcdefghi
",
[true,true,true],
{}],
// But preserve inline styles if first content is styled.
["abc[de]fghi
",
[["inserttext","d"],["inserttext","e"]],
"abcdefghi
",
[true,true],
{}],
["abc{de]fghi
",
[["inserttext","d"],["inserttext","e"]],
"abcdefghi
",
[true,true],
{}],
// Don't preserve empty inline style, but preserve the following text style if first content is text
["abc[de]fghi
",
[["inserttext","d"],["inserttext","e"]],
["abcdefghi
",
"abcdefghi
"],
[true,true],
{}],
["abc{de]fghi
",
[["inserttext","d"],["inserttext","e"]],
["abcdefghi
",
"abcdefghi
"],
[true,true],
{}],
]