[whatwg] Undo Manager specs is confusing in the contenteditable section

Caio Marcelo de Oliveira Filho caio.oliveira at openbossa.org
Wed Jun 20 12:21:19 PDT 2012


Hi,

> *2.2.1 Undo scope and contenteditable*
> *
> *
> *When the contenteditable content attribute is added to an element, the
> user agent must remove all entries in the undo transaction histories
> of the editable
> undo scope hosts that are descendent of the element and have become
> editable without unapplying or reapplying the entries and disconnect the
> corresponding UndoManagers as if the undoscope content attribute was
> removed from all descendent nodes excluding undo scope hosts and their
> descendents.*
>
> What does "editable undo hosts" imply here?

>From my understanding they are the elements that were undo hosts but
now, because the addition of contenteditable content attribute, became
editable elements, so not undo hosts anymore.


> Also when contenteditable is added to an element all
> the descendant elements become editable, so none of the descendants should
> be a undo scope host as "undoscope content attribute on an editable element
> is ignored". So is "*excluding undo scope hosts and their descendents*"
> valid?

We can have non-editable elements that are descendents of an element
with contenteditable=true. For example:

<div id="container">
  <div id="A" undoscope>This will be editable</div>
  <div id="B" contenteditable=false undoscope>This will remain not
editable</div>
</div>

When div "container" gets contenteditable=true, the div "A" will have
its undoManager disconnected, but not the div "B", because its not
editable. Would a non-normative box with an example like this one be
helpful in the spec?

Maybe we could change the second paragraph of 2.2.1 to make things clearer:

----8<---
When the contenteditable content attribute is added to an element, the
user agent must remove all entries in the undo transaction histories
of the descendents of the element that were undo scope hosts but have
become editable without unapplying or reapplying the entries and
disconnect the corresponding UndoManagers as if the undoscope content
attribute was removed from the now editable descendent nodes.
--->8---

What do you think?


Cheers,

-- 
Caio Marcelo de Oliveira Filho
openBossa @ INdT - Instituto Nokia de Tecnologia



More information about the whatwg mailing list