Bug 64416

Summary: Don't reuse the last InsertTextCommand
Product: WebKit Reporter: Ryosuke Niwa <rniwa>
Component: HTML EditingAssignee: Ryosuke Niwa <rniwa>
Status: RESOLVED FIXED    
Severity: Normal CC: darin, enrica, justin.garcia, leviw, morrita, tkent
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Bug Depends on:    
Bug Blocks: 64414    
Attachments:
Description Flags
Patch justin.garcia: review+

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>