Bug 61340 - Undo gets broken in contenteditable area when a text field's value is set by script
Summary: Undo gets broken in contenteditable area when a text field's value is set by ...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: HTML Editing (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P1 Critical
Assignee: Ryosuke Niwa
URL:
Keywords:
: 48665 (view as bug list)
Depends on:
Blocks:
 
Reported: 2011-05-23 20:41 PDT by Ryosuke Niwa
Modified: 2013-12-02 14:19 PST (History)
10 users (show)

See Also:


Attachments
demo (347 bytes, text/html)
2011-05-23 22:46 PDT, Ryosuke Niwa
no flags Details
fixes the bug (4.63 KB, patch)
2011-05-24 12:18 PDT, Ryosuke Niwa
darin: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
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]
demo

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:
http://trac.webkit.org/changeset/15565
http://trac.webkit.org/changeset/29748
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. ***