github web-platform-tests/wpt merge_pr_48517

latest releases: merge_pr_49470, epochs/three_hourly/2024-12-03_06H, epochs/six_hourly/2024-12-03_06H...
4 months ago

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

Don't miss a new wpt release

NewReleases is sending notifications on new releases.