So all this dirty checking is already done by the InputMethod API. `inputcontextchange` is only fired when the actual input context changed. `selectionchange` only when state got dirty there. So what this does is the same as the events already do.