mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-25 03:49:42 +00:00

`aHTMLEditor` may be `nullptr` and there may have been an `HTMLEditor` before it's called. Therefore, it may need to adjust IME state even if `aHTMLEditor` is `nullptr`. So, it should adjust IME state from `aDocument` which should be same as `aHTMLEditor->GetDocument()` if `aHTMLEditor` is not `nullptr`. Note that if `IMEStateManager` thinks another `nsPresContext` has focus, it does not touch IME state. Therefore, it's safe to skip checking the focus state of the `Document`. Differential Revision: https://phabricator.services.mozilla.com/D220772