"false\">abcd",
[true],
{"inserttext":[false,false,"",false,false,""]}],
["
{}
",
[["inserttext","a"]],
"false\">\">a
",
[true],
{"inserttext":[false,false,"",false,false,""]}],
["abc
{}
",
[["inserttext","d"]],
"false\">\">abcd
",
[true],
{"inserttext":[false,false,"",false,false,""]}],
["foo[]bar
",
[["inserttext"," "]],
"white-space:pre\">foo bar
",
[true],
{"inserttext":[false,false,"",false,false,""]}],
["foo[]
",
[["inserttext"," "]],
"white-space:pre\">foo
",
[true],
{"inserttext":[false,false,"",false,false,""]}],
["foo[]bar
",
[["inserttext"," "]],
"white-space:pre-wrap\">foo bar
",
[true],
{"inserttext":[false,false,"",false,false,""]}],
["foo[]
",
[["inserttext"," "]],
"white-space:pre-wrap\">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"," "]],
[
"white-space:pre-line\">foo bar
",
"white-space:pre-line\">foo bar
",
"white-space:pre-line\">foo bar
",
],
[true],
{"inserttext":[false,false,"",false,false,""]}],
["foo[]
",
[["inserttext"," "]],
[
"white-space:pre-line\">foo
",
"white-space:pre-line\">foo
",
"white-space:pre-line\">foo \n
",
"white-space:pre-line\">foo \n
",
"white-space:pre-line\">foo
",
"white-space:pre-line\">foo
",
],
[true],
{"inserttext":[false,false,"",false,false,""]}],
["foo[]bar
",
[["inserttext"," "]],
[
"white-space:nowrap\">foo bar
",
"white-space:nowrap\">foo bar
",
"white-space:nowrap\">foo bar
",
],
[true],
{"inserttext":[false,false,"",false,false,""]}],
["foo[]
",
[["inserttext"," "]],
[
"white-space:nowrap\">foo
",
"white-space:nowrap\">foo
",
"white-space:nowrap\">foo \n
",
"white-space:nowrap\">foo \n
",
"white-space:nowrap\">foo
",
"white-space:nowrap\">foo
",
],
[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.
["a
{}
",
[["inserttext","b"]],
"ab
",
[true],
{"inserttext":[false,false,"",false,false,""]}],
// In these cases, the <span> element after <br> element is visible and is put in
// the second line and caret is in the second line. Therefore, new text should
// be inserted into the second line.
["white-space:pre-wrap\">a
{}padding:1px\">
",
[["inserttext","b"]],
"white-space:pre-wrap\">a
bpadding:1px\">
",
[true],
{"inserttext":[false,false,"",false,false,""]}],
["white-space:pre-wrap\
">a
{}padding:1px\">c
",
[["inserttext","b"]],
"white-space:pre-wrap\
">a
bpadding:1px\">c
",
[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.
["",
[["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 <img> and it's replaced.
["abc[
/img/lion.svg\">de]fghi
",
[["inserttext","d"],["inserttext","e"]],
"abcdefghi
",
[true,true],
{}],
["abc[
/img/lion.svg\">def]ghi
",
[["inserttext","d"],["inserttext","e"],["inserttext","f"]],
"abcdefghi
",
[true,true,true],
{}],
["abc[
/img/lion.svg\">def]ghi
",
[["inserttext","d"],["inserttext","e"],["inserttext","f"]],
"abcdefghi
",
[true,true,true],
{}],
["abc{
/img/lion.svg\">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],
{}],
// Don't remove parent blocks of selection start to insert new text into the
// selection start container.
["{abc
def
}",
[["inserttext","g"],["inserttext","h"]],
"gh
",
[true,true],
{}],
["abc
{def
}",
[["inserttext","g"],["inserttext","h"]],
"abc
gh
",
[true,true],
{}],
["{abcdef}
",
[["inserttext","g"],["inserttext","h"]],
"display:flex\">gh
",
[true,true],
{}],
["abc{def}
",
[["inserttext","g"],["inserttext","h"]],
"display:flex\">abcgh
",
[true,true],
{}],
["{abcdef}
",
[["inserttext","g"],["inserttext","h"]],
"display:grid\">gh
",
[true,true],
{}],
["abc{def}
",
[["inserttext","g"],["inserttext","h"]],
"display:grid\">abcgh
",
[true,true],
{}],
// The inline style at selection start should be preserved for typed text.
["{abc
def
}",
[["inserttext","g"],["inserttext","h"]],
"gh
",
[true,true],
{}],
["abc
{def
}",
[["inserttext","g"],["inserttext","h"]],
"abc
gh
",
[true,true],
{}],
["{abcdef}
",
[["inserttext","g"],["inserttext","h"]],
"display:flex\">gh
",
[true,true],
{}],
["abc{def}
",
[["inserttext","g"],["inserttext","h"]],
"display:flex\">abcgh
",
[true,true],
{}],
["{abcdef}
",
[["inserttext","g"],["inserttext","h"]],
"display:grid\">gh
",
[true,true],
{}],
["abc{def}
",
[["inserttext","g"],["inserttext","h"]],
"display:grid\">abcgh
",
[true,true],
{}],
["",
[["inserttext","B"]],
"",
[true],
{}],
["",
[["inserttext","B"]],
"",
[true],
{}],
]