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)
commitfd42b9ceaa8ecabae459d65606879d773bf23f35
treea0146cbcb07f0525b3a27f2ac6f4ec0a681ed718
parent2be1324ba77c5c15512636e970b493d8ae990b66
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

        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
15 files changed:
LayoutTests/ChangeLog
LayoutTests/editing/undo/replace-by-span-then-remove-expected.txt [new file with mode: 0644]
LayoutTests/editing/undo/replace-by-span-then-remove.html [new file with mode: 0644]
LayoutTests/platform/chromium-win/editing/inserting/editable-html-element-expected.txt
LayoutTests/platform/chromium-win/editing/selection/editable-html-element-expected.txt
LayoutTests/platform/chromium-win/editing/selection/editable-links-expected.txt
LayoutTests/platform/chromium-win/editing/selection/focus_editable_html-expected.txt
LayoutTests/platform/chromium-win/editing/style/designmode-expected.txt
LayoutTests/platform/qt/editing/inserting/editable-html-element-expected.txt
LayoutTests/platform/qt/editing/selection/editable-html-element-expected.txt
LayoutTests/platform/qt/editing/selection/focus_editable_html-expected.txt
LayoutTests/platform/qt/editing/style/designmode-expected.txt
WebCore/ChangeLog
WebCore/editing/ReplaceNodeWithSpanCommand.cpp
WebCore/editing/ReplaceNodeWithSpanCommand.h