[whatwg] What exactly is contentEditable for?

Olav Junker Kjær olav at olav.dk
Mon Aug 15 05:49:29 PDT 2005


Lachlan Hunt wrote:
> How is that any different from a text area form control with a specified 
> accept type of text/html, which would allow a UA to load any external 
> editor (eg. XStandard) or degrade to a regular text area?

The point of contentEditable is that some areas of a page can be made 
editable (and editing toggled on and off), while still maintaining the 
styling and structure of the document. This is really useful for CMS'es 
and other kind of editors - template editing and so on.

contentEditable is quite clean since you just toggle an attribute. With 
your proposal, the editable element should toggle between the original 
content, and a textarea element containing content, now HTML escaped, 
but still rendered as if it were ordinary content, including inheriting 
styles and so on from the containing document. That does not seem very 
clean.

> User can edit with plain text editor or 
> UA can load WYSIWYG editor for text/html (or whatever ever MIME type is 
> specified)

But this considers the editable content as just an arbitrary content 
type which should be edited in some external editor. The point of 
contentEditable is that the editable content is HTML and an integrated 
part of the containing page, which enables much cleaner "in place" 
editing. If you just consider the editable content an arbitrary blob of 
editable content, you wouldn't e.g. expect styles from the containing 
document to inherit into the editable HTML, which is a major point of 
contentEditable.
Also consider that editable areas may contain non-editable islands which 
aganin may contain editable areas. How would that be expresses using 
TEXTAREA ?


> That would be a far better option than using contentEditable, which is 
> not only conceptually broken, but *all* implementations of it are so 
> incredibly broken, that trying to standardise it is like dragging a dead 
> horse through mud.

Certainly the IE implementation (which is the only non-beta 
implementation i know of) has its issues, but I dont see how its 
"conceptually broken". Its very useful, despite its shortcomings.

regards
Olav Junker Kjær



More information about the whatwg mailing list