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

Automatic DOM transactions in UndoManager

From: Sukolsak Sakshuwong <sukolsak@google.com>
Date: Tue, 7 Aug 2012 16:12:23 -0700
Message-ID: <CAJgW9=gEmnRT2a2syKg+un+1GLfKYCF=sBz0HJf=+ug0_ah8dQ@mail.gmail.com>
To: public-webapps@w3.org
Should we be able to revert the following transaction?

<!DOCTYPE html>
<div id="a">Hello</div>
var a = document.getElementById("a");

        "executeAutomatic": function () {
                var b = document.createElement("div");


Note that there are two DOM changes occurring inside the
executeAutomatic function:
1. "a" is removed from its parent.
2. "a" is added as a child of "b".

Only the first DOM change is recorded. The second DOM change is not
recorded because "b" is not a descendant of the undo scope host, which
is the document in this case.

Therefore, only the first DOM change will be reverted. However,
according to the spec
we can't revert it because a's parent is not null. Thus, "a" will not
be added back to the document.
Received on Wednesday, 8 August 2012 22:22:00 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 18:13:38 UTC