[whatwg] Fixing undo on the Web - UndoManager and Transaction

Ryosuke Niwa rniwa at webkit.org
Thu Aug 11 14:56:06 PDT 2011

On Thu, Aug 11, 2011 at 2:53 PM, Ehsan Akhgari <ehsan at mozilla.com> wrote:
> I think the confusion is arising because you chose to attach undoManager to
> elements, not nodes.  Note that document _is_ a node in the DOM, but it's
> not an element.  I think we should just modify the spec to attach
> undoManager to nodes.  Once we have that, we don't need to treat
> documentElement specially at all, it just looks at its parent (the document
> node) and gets the undoManager from there.

Makes sense.

The only downside is that we should explicitly prohibit some node types from
> having an undoManager where it doesn't make sense (such as text nodes,
> comment nodes, etc.).  We can enumerate them explicitly and say that
> accessing the undoManager on these types of nodes will throw.

Alternatively, can we say that only Element and Document are allowed to have

- Ryosuke

More information about the whatwg mailing list