[whatwg] Editing

James Graham jg307 at cam.ac.uk
Wed Apr 20 10:35:29 PDT 2005

Brad Fults wrote:

>On 4/20/05, Anne van Kesteren <fora at annevankesteren.nl> wrote:
>>Besides your other points I think it would also be important to specify
>>the content model the element can have and the possibility to restrict
>>this content model.
>>  <em contentEditable="true" exclude="a em strong span">
>Although such a selection method would be convenient, I think it makes
>more sense to specify such exceptions on the elements themselves,
>removing the need to add a new attribute. For instance,
><div contenteditable="true">
>  <a href="#header" contenteditable="false">Header</a>
>  <a href="#footer">Footer</a>
>In this case the first link would be manipulated as an unbreakable
>unit inside the div.
But this alone doesn't prevent the authot _inserting_ another <a> 
element into the contenteditable <div>. Anne's solution does allow for 
such restrictions but doesn't seem to generalise well e.g. it's not 
clear how to prevent an attribute from being inserted on an editable 
element or allow for realistic restrictions like "href attributes in <a> 
elements must point to http:// resources". Given that, I'm not sure what 
of the restrictions should be managed declaratively and what should be 
managed via scripting, since, at some level, scripting will almost 
certainly be needed to ensure acceptable input.

"But if science you say still sounds too deep,
Just do what Beaker does, just shrug and 'Meep!'"

-- Dr. Bunsen Honeydew & Beaker of Muppet Labs

More information about the whatwg mailing list