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

Jonas Sicking jonas at sicking.cc
Fri Aug 5 10:20:08 PDT 2011

On Fri, Aug 5, 2011 at 10:01 AM, Ryosuke Niwa <rniwa at webkit.org> wrote:
> On Fri, Aug 5, 2011 at 9:57 AM, Jonas Sicking <jonas at sicking.cc> wrote:
>> Why treat documentElement specially here? Just make the documentElement
>> *not* have a undoManager by default and have it just use it's ancestor's,
>> just like all other elements.
>> The document is an ancestor of the documentElement after all.
> Anne had a different idea to make documentElement have the root undoManager
> to avoid adding a new property to Document.  I personally like your approach
> but I don't know enough about Web IDLs to give a call.
> Anyone else have opinions on this?

I don't think this is a WebIDL issue really.

Given the inconsistencies that it introduces in that a property
appears on documentElement, but isn't actually associated with the
element, and the fact that people will have to wrote the longer syntax
"document.documentElement.undoManager" rather than
"document.undoManager", I think it's better to just expose it on the

Adding things to the Window object is always iffy as that's the global
object, adding things to Document isn't really a big deal IMHO.

/ Jonas

More information about the whatwg mailing list