Bug 64416 - Don't reuse the last InsertTextCommand
Summary: Don't reuse the last InsertTextCommand
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: HTML Editing (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Ryosuke Niwa
URL:
Keywords:
Depends on:
Blocks: 64414
  Show dependency treegraph
 
Reported: 2011-07-12 18:02 PDT by Ryosuke Niwa
Modified: 2011-07-13 10:55 PDT (History)
6 users (show)

See Also:


Attachments
Patch (9.62 KB, patch)
2011-07-12 18:09 PDT, Ryosuke Niwa
justin.garcia: 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-07-12 18:02:12 PDT
It seems unnecessary to reuse the last InsertTextCommand in TypingCommand.  Changing the interface of InsertTextCommand to use doApply will make fixing the bug 64414 easier.
Comment 1 Ryosuke Niwa 2011-07-12 18:09:30 PDT
Created attachment 100601 [details]
Patch
Comment 2 Hajime Morrita 2011-07-12 22:34:25 PDT
Comment on attachment 100601 [details]
Patch

Wow, I thought this reuse is for handling undo. But it isn't true....
Comment 3 Ryosuke Niwa 2011-07-12 23:22:14 PDT
(In reply to comment #2)
> (From update of attachment 100601 [details])
> Wow, I thought this reuse is for handling undo. But it isn't true....

Undo/Redo is taken care by reusing TypingCommand.  I'm guessing that this is an artifact of old days when InsertTextCommand was used differently than it is today.
Comment 4 Justin Garcia 2011-07-13 00:41:13 PDT
Comment on attachment 100601 [details]
Patch

Looks like you could get rid of:

virtual bool isInsertTextCommand() const;

as it is now unused.
Comment 5 Ryosuke Niwa 2011-07-13 00:42:57 PDT
Thanks for the review!

(In reply to comment #4)
> (From update of attachment 100601 [details])
> Looks like you could get rid of:
> 
> virtual bool isInsertTextCommand() const;
> 
> as it is now unused.

Oh, you're right.  I'll do that before I land.
Comment 6 Ryosuke Niwa 2011-07-13 10:55:24 PDT
Committed r90933: <http://trac.webkit.org/changeset/90933>