Files
tubestation/widget/tests/browser
Masayuki Nakano 0cd53796f1 Bug 1798379 - Make HTMLEditor store whether it has/had focus and is/was in the designMode by itself r=m_kato
`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
2024-07-12 04:45:01 +00:00
..