2010-10-08 Ryosuke Niwa <rniwa@webkit.org>
authorrniwa@webkit.org <rniwa@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 9 Oct 2010 19:49:48 +0000 (19:49 +0000)
committerrniwa@webkit.org <rniwa@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 9 Oct 2010 19:49:48 +0000 (19:49 +0000)
        Reviewed by Darin Adler.

        Redo in ReplaceNodeWithSpanCommand is broken
        https://bugs.webkit.org/show_bug.cgi?id=47428

        The bug was caused by ReplaceNodeWithSpanCommand's inheriting from CompositeEditCommand,
        and ReplaceNodeWithSpanCommand's not implementing doReapply. Because ReplaceNodeWithSpanCommand's doApply
        directly modifies DOM and does not use simple edit commands while CompositeEditCommand's doReapply
        only calls reapply of compositing simple edit commands, ReplaceNodeWithSpanCommand's doReapply was no-op.

        Fixed the bug by changing the base class of ReplaceNodeWithSpanCommand to SimpleEditCommand.
        This allows ReplaceNodeWithSpanCommand's doReapply to call its doApply, which already supports redo operation.

        Test: editing/undo/replace-by-span-then-remove.html

        * editing/ApplyStyleCommand.h:
        (WebCore::ApplyStyleCommand::printStyle):
        * editing/ReplaceNodeWithSpanCommand.cpp:
        (WebCore::ReplaceNodeWithSpanCommand::ReplaceNodeWithSpanCommand):
        * editing/ReplaceNodeWithSpanCommand.h:
2010-10-08  Ryosuke Niwa  <rniwa@webkit.org>

        Reviewed by Darin Adler.

        Redo in ReplaceNodeWithSpanCommand is broken
        https://bugs.webkit.org/show_bug.cgi?id=47428

        Added a test to ensure replacing a node with span can be redone,
        and doing so does not disrupt subsequent redo's.

        * editing/undo/replace-by-span-then-remove-expected.txt: Added.
        * editing/undo/replace-by-span-then-remove.html: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@69453 268f45cc-cd09-0410-ab3c-d52691b4dbfc


No differences found