W3C home > Mailing lists > Public > public-webapps@w3.org > July to September 2012

Re: [UndoManager] Disallowing live UndoManager on detached nodes

From: Ryosuke Niwa <rniwa@webkit.org>
Date: Mon, 20 Aug 2012 23:56:49 -0700
Message-ID: <CABNRm62BMibQVVA0_nK+sHDQGXJE0NG04=pHR71hmkpu69neiA@mail.gmail.com>
To: Jonas Sicking <jonas@sicking.cc>
Cc: Ehsan Akhgari <ehsan@mozilla.com>, Sukolsak Sakshuwong <sukolsak@google.com>, Kentaro Hara <haraken@chromium.org>, Maciej Stachowiak <mjs@apple.com>, Adam Barth <abarth@webkit.org>, Olli Pettay <Olli.Pettay@helsinki.fi>, public-webapps <public-webapps@w3.org>, Ojan Vafai <ojan@chromium.org>
No. Allowing the host to be moved without removing automatic transaction is
what causes the problem because automatic transactions need to keep
relevant nodes alive.

Essentially, this has the same problem has the magic iframe. We can
alternatively change the way automatic transactions work so that they don't
retain the original nodes but that model has its own problems.
On Aug 20, 2012 11:47 PM, "Jonas Sicking" <jonas@sicking.cc> wrote:

> Will this still allow a node which has an undo manager to be moved
> from one part of the document to another part of the document, without
> losing all transactions attached to the undo manager?
>
> That seems like an important use case.
>
> / Jonas
>
> On Mon, Aug 20, 2012 at 9:52 PM, Ryosuke Niwa <rniwa@webkit.org> wrote:
> > Greetings all,
> >
> > We've been implementing undo manager in WebKit, and we've found out that
> > allowing live undo manager on a detached undo scope host is a terrible
> idea.
> >
> > e.g. say you have a subtree like follows:
> >
> > A
> >
> > B
> >
> > D
> >
> > C
> >
> > where A is the undo scope host. If we then detach B from A, and then
> insert
> > A under D, all automatic transactions in A's undo manager are broken and
> may
> > create a cyclic reference graph because nodes touched in automatic
> > transactions need to be kept alive for undo/redo.
> >
> > If there is no objection, I'm changing the spec to disallow live undo
> > manager on detached nodes so that scripts can't move the host around
> inside
> > a document or between documents; i.e. when a undo scope host is removed
> from
> > its parent, its undo manager must be disconnected and a new undo manager
> be
> > created for the node.
> >
> > Alternatively, we can turn all automatic transactions in the undo manager
> > into no-ops but I'd prefer disconnecting the undo manager altogether to
> make
> > the behavior simple.
> >
> > Best,
> > Ryosuke Niwa
> > Software Engineer
> > Google Inc.
> >
> >
>
Received on Tuesday, 21 August 2012 06:57:16 GMT

This archive was generated by hypermail 2.3.1 : Tuesday, 26 March 2013 18:49:54 GMT