[webkit-dev] Unapplying execCommand

Darin Adler darin at apple.com
Fri Oct 8 17:51:01 PDT 2010

On Oct 8, 2010, at 3:47 PM, Ryosuke Niwa wrote:

> Does anyone know if this was a UI / functionality decision or it is a bug?

This undo behavior you describe in Safari is what is automatically implemented by Cocoa’s NSUndoManager. The concept is that when a user undoes something, they want to undo everything they did that corresponds to one end user event, not a single command from some lower level point of view.

Getting different behavior on Mac OS X might be challenging. The Mac version of WebKit ties undo in with the Cocoa undo management rather than creating its own separate undo mechanism. This allows the end user to undo a set of operations that involve web views interleaved with other operations. That’s good for the Undo menu items in applications. But when a webpage does execCommand("undo") that behavior is not as useful. If this turns out to be important from a web compatibility point of view we can try to find some way to change it without losing the beneficial effects.

    -- Darin

More information about the webkit-dev mailing list