These are almost the same. SelectionState is only updated asynchronously, while TextInputState is updated synchronously, and is only valid while a key event is being processed.
That's confusing. We can always keep the latest known state in the one place.
Created attachment 90239 [details]
Comment on attachment 90239 [details]
View in context: https://bugs.webkit.org/attachment.cgi?id=90239&action=review
The patch looks good to me. I like the way the code gets simplified. I don't understand why EditorState.h appears twice looking at the review, but it is probably a bug in the review tool. The only comment I have is the copyright year.
Also, it appears there are problems in applying the patch for the qt build.
> + *