Loading
Bug 1898408 - Make our editor disconnect `<br>` element temporarily when its...
Bug 1898408 - Make our editor disconnect `<br>` element temporarily when its type is changed from or to padding one r=m_kato Currently, the `<br>` element type -- whether normal `<br>` element or padding `<br>` element for empty editor or last line -- is managed by the flags of `nsINode`. Therefore, changing the flag does not cause mutation, so `IMEContentObserver` cannot observe the type changes. However, `ContentEventHandler` treats the padding `<br>` elements as invisible. Therefore, when a `<br>` element becomes a padding one, `IMEContentObserver` needs to notify IME of atext removed notification, and also when a `<br>` element becomes a normal one (i.e., visible), `IMEContentObserver` needs to notify IME of a text added notification. Therefore, this patch makes `EditorBase` disconnect the `<br>` element temporarily to make `IMEContentObserver` observable the type change. Depends on D211698 Differential Revision: https://phabricator.services.mozilla.com/D211699