Validates the input method attributes received from input method.
A buggy input method may send invalid values to the widget. E.g. out of range cursor position. Make sure we don't use such value directly.
A buggy input method may send invalid values to the widget. E.g. out of range cursor position. Make sure we don't use such value directly.