github web-platform-tests/wpt merge_pr_47103

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

Make HTMLEditor store whether it has/had focus and is/was in the designMode by itself

HTMLEditor currently checks whether it's in the designMode or not with
checking the Document node is in the designMode. I.e., it checks the
real-time state of the Document node. However, if an instance was in the
designMode, it needs to finalize Selection even after the Document node
becomes not in the designMode. Additionally, elements in a shadow DOM in the
designMode can have contenteditable to make it editable. Then, the editable
elements should works as in the contenteditable mode rather than in the
designMode. Therefore, current HTMLEditor::IsInDesignMode() returns
wrong state when the finalization is called asynchronously or when an editing
host in a shadow DOM whose composed document is in the designMode.

This patch fixes known cases of these issues with improving the finalization
(and re-initialization with the new editing mode) and the caller side in
Document.

Differential Revision: https://phabricator.services.mozilla.com/D216022

bugzilla-url: https://bugzilla.mozilla.org/show_bug.cgi?id=1798379
gecko-commit: f0b82b83f2639b8fd0fd14d6eb299400e637f872
gecko-reviewers: m_kato

Don't miss a new wpt release

NewReleases is sending notifications on new releases.