<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.webkit.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4.1"
          urlbase="https://bugs.webkit.org/"
          
          maintainer="admin@webkit.org"
>

    <bug>
          <bug_id>88595</bug_id>
          
          <creation_ts>2012-06-07 17:08:19 -0700</creation_ts>
          <short_desc>[GTK] WebKitGtk+&apos;s WebView should allow arbitrary actions to be added to the UndoStack.</short_desc>
          <delta_ts>2018-02-16 02:53:34 -0800</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>HTML Editing</component>
          <version>528+ (Nightly build)</version>
          <rep_platform>Unspecified</rep_platform>
          <op_sys>Linux</op_sys>
          <bug_status>UNCONFIRMED</bug_status>
          <resolution></resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>0</everconfirmed>
          <reporter>matthew</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>bugs-noreply</cc>
    
    <cc>clopez</cc>
    
    <cc>cmarcelo</cc>
    
    <cc>geary</cc>
    
    <cc>matthew</cc>
    
    <cc>mcatanzaro</cc>
    
    <cc>mcrha</cc>
    
    <cc>mike</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>644098</commentid>
    <comment_count>0</comment_count>
    <who name="">matthew</who>
    <bug_when>2012-06-07 17:08:19 -0700</bug_when>
    <thetext>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 &quot;undo/redo&quot;, &quot;can_undo/can_redo&quot;, and the &quot;undo/redo&quot; signals, but you have no way of adding actions to the stack yourself.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1266798</commentid>
    <comment_count>1</comment_count>
    <who name="Michael Gratton">mike</who>
    <bug_when>2017-01-14 04:48:55 -0800</bug_when>
    <thetext>Geary bug with broad requirements for this: https://bugzilla.gnome.org/show_bug.cgi?id=777250

I&apos;ll have a look at this sometime in the medium term if no one beats me to it.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1399853</commentid>
    <comment_count>2</comment_count>
    <who name="Milan Crha">mcrha</who>
    <bug_when>2018-02-16 02:53:34 -0800</bug_when>
    <thetext>Having also some API to &quot;glue&quot; 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&apos;d do something like:

   dom_document-&gt;startUndoCommand(&quot;xxx&quot;)
   ... do the changes...
   dom_document-&gt;stopUndoCommand()

It won&apos;t be probably dom_document, but something lower, I do not know, it doesn&apos;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).</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>