Bug 61340

Summary: Undo gets broken in contenteditable area when a text field's value is set by script
Product: WebKit Reporter: Ryosuke Niwa <rniwa>
Component: HTML EditingAssignee: Ryosuke Niwa <rniwa>
Severity: Critical CC: adele, alex, darin, enrica, justin.garcia, leviw, morrita, sullivan, tkent, xji
Priority: P1    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Description Flags
fixes the bug darin: review+

Description Ryosuke Niwa 2011-05-23 20:41:57 PDT
Reproduction steps:
1. Open the attached demo
2. Type something into the black box.
3. Undo

Expected result:
Undo works.

Actual result:
Undo doesn't work.
Comment 1 Ryosuke Niwa 2011-05-23 20:42:22 PDT
This is why simple-rte.rniwa.com doesn't work properly on WebKit / Chrome.
Comment 2 Ryosuke Niwa 2011-05-23 22:46:02 PDT
Created attachment 94567 [details]

Apparently, I forgot to attach the test case earlier.  It turned out that this bug is nothing to with event handler.  The problem reproduces whenever you modify input element's value.
Comment 3 Ryosuke Niwa 2011-05-24 11:49:43 PDT
Of course this is broken because we call clearUndoRedoOperations() in RenderTextControl::setInnerTextValue.

Relevant changesets:
Comment 4 Ryosuke Niwa 2011-05-24 12:18:42 PDT
Created attachment 94662 [details]
fixes the bug
Comment 5 Ryosuke Niwa 2011-05-24 12:52:40 PDT
Thanks for the review, Darin.  Landing it now.
Comment 6 Ryosuke Niwa 2011-05-24 14:22:32 PDT
Committed r87204: <http://trac.webkit.org/changeset/87204>
Comment 7 Daniel Bates 2013-12-02 14:19:38 PST
*** Bug 48665 has been marked as a duplicate of this bug. ***