[whatwg] contentEditable and the user editing break action

Jorgen Horstink mail at jorgenhorstink.nl
Tue May 9 00:06:02 PDT 2006


“The contenteditable attribute is a common attribute. User agents must 
support this attribute on all HTML elements.”

How about del? It sounds odd to me to allow content of a del element to 
be editable.

Second, I am interested why User Editing actions are mostly 
UA-dependent. To my mind there should be one standard for editing. It is 
very frustrating if applications behave differently in different browsers.

I'd suggest at least to rephrase the 'break block' and 'insert a line 
seperator' sections. Whenever a user requests a break (block break or 
inline break) the behaviour should depend on the state the editing is 
in. It is stupid to insert two inline breaks (is it really? I guess so). 
I.E.

<p>
foo
<br>
<br>
foo
</p>

Above example does not make sense. Because of this fact, inserting 
'block breaks' and 'inline breaks' can be invoked with one and the same 
action (pressing the enter key, talking to the browser whatever).

If the last action was not a break request, an 'inline break' will be 
inserted. If the last action was a break request, a block break will be 
inserted.

The pipe represents the carret in the examples below:

<p>
foo|
</p>

After requesting a break, an inline break will be inserted:

<p>
foo<br>|
</p>

After requesting another break, an block break will be inserted. Note 
the last BR will be removed.

<p>
foo
</p>
<p>
|
</p>

I hope the idea of this algorithm is clear. I was wondering whether it 
has potential to be added to the spec (there are quite a lot edge cases 
though).

-jorgen

<http://jorgenhorstink.nl>




More information about the whatwg mailing list