W3C home > Mailing lists > Public > whatwg@whatwg.org > June 2010

[whatwg] Proposal: Undeletable elements within contentEditable

From: Nikita Vasilyev <me@elv1s.ru>
Date: Thu, 24 Jun 2010 20:08:50 +0400
Message-ID: <490014A7-1BFC-4FD1-8737-9FDDF02EC741@elv1s.ru>
The current version of spec http://www.whatwg.org/specs/web-apps/current-work/multipage/editing.html#contenteditable
does not define any way to make an element within contentEditable  
undeletable. I propose "undeletable" attribute:

element.undeletable = "true" | "false"

How should it work:

<div contenteditable>
   <span undeletable>foo</span>

When I focus on the div, select all the text, and delete it, the span  
element MUST be empty, but MUST NOT be deleted.

This behavior would be very useful while building code editors. I'm  
building CSS editor with syntax highlighting and auto-completion based  
on contentEditable. "undeletable" attribute would help me a lot.
Received on Thursday, 24 June 2010 09:08:50 UTC

This archive was generated by hypermail 2.4.0 : Wednesday, 22 January 2020 16:59:24 UTC