[whatwg] What exactly is contentEditable for?

Ian Hickson ian at hixie.ch
Fri Aug 26 02:34:26 PDT 2005


On Fri, 26 Aug 2005, Matthew Raymond wrote:
> 
> So, effectively, what you're saying about <textarea accept="text/html"> 
> is the following:
> 
> 1) The HTML in a <textarea> is unstyled (at least unstyled by the parent 
> document) unless styles or stylesheets are specified within the 
> <textarea> contents.

There is no defined rendering for <textarea>. The UA would be perfectly 
within its rights to interpret the contents of such an element and style 
it using the styles of the containing document.


> 2) There is no way to use the DOM to manipulate the contents of the 
> <textarea> without using a proprietary UA interface.

Sure, you could do something like:

   my DOM = document.createElement('div');
   DOM.innerHTML = textarea.value;
   // ...manipulate DOM...
   textarea.value = DOM.innerHTML;

...or some such.


> The simple fact of the matter is that, with the version of HTML5 you 
> currently propose, there is no way to submit HTML in the DOM without 
> scripting.

That is certainly true, yes. I'm not sure why this is a problem, though. 
The scripting is simple, and would only be an insignificannt part of the 
actual scripting involved in writing an editing UI using contentEditable.

-- 
Ian Hickson               U+1047E                )\._.,--....,'``.    fL
http://ln.hixie.ch/       U+263A                /,   _.. \   _\  ;`._ ,.
Things that are impossible just take longer.   `._.-(,_..'--(,_..'`-.;.'



More information about the whatwg mailing list