It would be nice to know more details on how you are thinking to use this and why this is very useful for code editors. If I select all my code and hit Delete, don't I want to remove all the code, together with highlighting?<div>
<br><div class="gmail_quote">On Thu, Jun 24, 2010 at 9:08 AM, Nikita Vasilyev <span dir="ltr"><<a href="mailto:me@elv1s.ru">me@elv1s.ru</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
The current version of spec <a href="http://www.whatwg.org/specs/web-apps/current-work/multipage/editing.html#contenteditable" target="_blank">http://www.whatwg.org/specs/web-apps/current-work/multipage/editing.html#contenteditable</a><br>
does not define any way to make an element within contentEditable undeletable. I propose "undeletable" attribute:<br>
<br>
element.undeletable = "true" | "false"<br>
<br>
How should it work:<br>
<br>
<div contenteditable><br>
<span undeletable>foo</span><br>
</div><br>
<br>
When I focus on the div, select all the text, and delete it, the span element MUST be empty, but MUST NOT be deleted.<br>
<br>
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.<br>
</blockquote></div><br></div>