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

Ian Hickson ian at hixie.ch
Thu Aug 25 16:06:51 PDT 2011


On Tue, 26 Jul 2011, Ryosuke Niwa wrote:
> 
> In the last couple of weeks, I've been working with developers of 
> CKEditor, TinyMCE, and Google Docs to come up with *new API for undo and 
> redo*.

I've removed the old UndoManager API from the HTML spec since your 
proposal seems far more thought out!

Here are some quick comments on it:

 - The Transaction interface should be named something less generic, e.g. 
   UndoTransaction or something.

 - "must return the object implementing the UndoManager interface" should 
   probably clarify _which_ object. There's presumably more than one 
   object in the world implementing this interface. :-)

 - We need to figure out how UndoManager objects affect the bfcache and 
   the document "salvageable" flag. Please ping me on IRC about this.

 - What's the story with window.onundo and window.onredo? Should they be 
   dropped?

In removing the UndoManager stuff I discovered that actually there was 
nothing other than the editing stuff that referred to it, so once I've 
removed the editing stuff there won't be a direct reference from the HTML 
spec to the undo/redo spec. Presumably Aryeh's editing spec will reference 
it, though? Looks like right now the 'undo' and 'redo' execCommand()s are 
undefined. I presume that most of the execCommand()s are going to end up 
defined as undo transactions, is that right?

-- 
Ian Hickson               U+1047E                )\._.,--....,'``.    fL
http://ln.hixie.ch/       U+263A                /,   _.. \   _\  ;`._ ,.
Things that are impossible just take longer.   `._.-(,_..'--(,_..'`-.;.'


More information about the whatwg mailing list