UNCONFIRMED 88595
[GTK] WebKitGtk+'s WebView should allow arbitrary actions to be added to the UndoStack.
https://bugs.webkit.org/show_bug.cgi?id=88595
Summary [GTK] WebKitGtk+'s WebView should allow arbitrary actions to be added to the ...
matthew
Reported 2012-06-07 17:08:19 PDT
When the you manipulate the DOM pro grammatically, you no longer get undo/redo for free. The Objective-C programming guide recommends working around this by adding your own undo/redo steps to the stack (see https://developer.apple.com/library/mac/#documentation/Cocoa/Conceptual/DisplayWebContent/Tasks/UsingUndo.html#//apple_ref/doc/uid/TP40001473-CJBEHAAG). However, WebKitGtk+ does not expose this functionality. You have access to "undo/redo", "can_undo/can_redo", and the "undo/redo" signals, but you have no way of adding actions to the stack yourself.
Attachments
Michael Gratton
Comment 1 2017-01-14 04:48:55 PST
Geary bug with broad requirements for this: https://bugzilla.gnome.org/show_bug.cgi?id=777250 I'll have a look at this sometime in the medium term if no one beats me to it.
Milan Crha
Comment 2 2018-02-16 02:53:34 PST
Having also some API to "glue" together several commands on the Undo stack and make them behave like a single Undo/Redo step would be a (related) benefit. That would be for cases when you know you are going to do a complicated task, which can be partly recorded by WebKit, but which also requires some additional manual DOM changes. Then you'd do something like: dom_document->startUndoCommand("xxx") ... do the changes... dom_document->stopUndoCommand() It won't be probably dom_document, but something lower, I do not know, it doesn't matter that much, the thing is to be able to have undo, which does several other undo steps. Whether nesting of complex undo commands will be allowed is a question. It probably could be allowed. An API to clear Undo stack would be also nice to have. All these things together would relax Undo/Redo code in applications like Geary and Evolution, where the undo stacks are duplicated due to semi-complex changes on the DOM (which, in case of Evolution, sometimes leads to misbehaviour).
Note You need to log in before you can comment on or make changes to this bug.