Add automated tests for insertText
in contenteditable=plaintext-only
and make its handlers compute editing host without limiting in the `<body
This patch makes HTMLEditor::HandleInsertText
compute the editing host without
limiting in the <body>
for consistency with the other edit action handlers
which we've changed at implementing contenteditable=plaintext-only
.
Unfortunately, there are a lot of changes to pass the editing host to
EnsureCaretNotAfterInvisibleBRElement()
, though.
Note that the tests trying to preserve the style in
contenteditable=plaintext-only
fails on Chrome too due to <br>
is put
outside the <b>
or forgot the <b>
after caret move. However, as you know,
contenteditable=plaintext-only
does not allow to change text style even
for web app developers. Therefore, loosing the style only in some conditions
must be wrong. Therefore, I made the expectations.
Differential Revision: https://phabricator.services.mozilla.com/D224188
bugzilla-url: https://bugzilla.mozilla.org/show_bug.cgi?id=1921723
gecko-commit: f0d7650bda3cac49a7177de29bcaeb06d249237a
gecko-reviewers: m_kato