I have been discussing a new concept with some people for enabling a subset of 
contentEditable behavior without all of the built-in formatting and some other 
functionality. It was discussed a bit at the Extensible Web Summit [1]. Below 
is a draft I wrote about this, which is also on GitHub [2]. We would like 
feedback on this concept from the broader community.

Problem
HTML uses the contentEditable='true' attribute to allow text input. The 
behavior of contentEditable varies widely from browser to browser and is very 
complex, resulting in many bugs and behavior differences between browsers. 
Editing frameworks like TinyMCE, goog.editor, and CKEditor are used in 
thousands of sites to overcome these issues. However, built-in browser editing 
varies so much that these frameworks and sites like Google Docs and Microsoft 
Office Online that have built custom solutions end up disable a large portion 
of the functionality of contentEditable. Ultimately this means that browsers 
support functionality that is largely disabled, and frameworks and sites have 
to work around the default behavior.

Proposal
To make this simpler for sites, frameworks, and browsers, it makes sense to 
enable a new, simpler version of contentEditable that provides basic 
functionality only. For the sake of discussion, call it 
contentEditable='minimal'. The functionality provided by the browser under 
contentEditable='minimal' would be as follows:
* Caret drawing
* Events such as Keyboard , Clipboard, Drag and Drop
* Some keyboard input handling- caret movement, typing of characters including 
Input Method Editor input
* Selection drawing and manipulation according to the new Selection API spec

Frameworks and sites would then enable any formatting they desire using script.

- Ben

[1] http://oksoclap.com/p/extensible_content_editing
[2] https://github.com/w3c/editing-explainer/wiki/contentEditable=minimal 

Reply via email to