[Proposal] EditContext API

EditContext API was inspired by discussions in Editing TF. It allows web applications a deeper integration with operating systems’ input services. The proposed design allows for clean separation of document object model and data model and a number of other benefits that are not available to a web developer today.

Some of the gaps that the proposal aims to fill in the web platform:

  • Very hard to build interoperable text editor on the web using browser primitives, i.e. contenteditable or textarea;
  • Contenteditable: document object and data models are coupled together;
  • Selection problems when hidden text area approach is used which may result in software keyboard or a IME candidate window to be wrongly positioned;
  • IME related issues, specifically, long running IME composition on collaboration scenarios;

It provides: Native like(how it is done in the browser today) set of Javascript APIs to control text entry through interaction with system’s text input services.

It is great for: Javascript editing frameworks.

You can find additional information in the explainer.

2 Likes

I think this is a great and potentially revolutionary idea, but I’m pretty heavily biased in this space. :wink: Having had to work with (and around) contenteditable, as well as the various proposal to try to stop or prevent the browser from taking actions based on user’s typing (e.g., the cancelable input event) over the years, I think this new idea has a lot of potential benefits. Hopeful to see others in this community take a look and leave feedback!

Chrome is also certainly interested in having similar functionalities and we have been collaborating with MS folks on this. +1 from our side.