REGRESSION(3.2.3 - 4.0.2): Message composing: when I undo a color change to text...
authoradele@apple.com <adele@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 29 Oct 2009 23:37:17 +0000 (23:37 +0000)
committeradele@apple.com <adele@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 29 Oct 2009 23:37:17 +0000 (23:37 +0000)
commitf32b44d5a69b5f121730800d38fff9f0d603977c
tree34ff97a536b460fb8667ab3240122345fb24913d
parente2195b5c2a922b21aa3686c19c762fd9e7a51e61
REGRESSION(3.2.3 - 4.0.2): Message composing: when I undo a color change to text in Mail, undo/redo behaves strangely
<rdar://problem/7067033>
https://bugs.webkit.org/show_bug.cgi?id=30892

WebCore:

Patch by Enrica Casucci <enrica@apple.com> on 2009-10-29
Reviewed by Darin Adler.

This problem shows in any scenario where it is necessary to split a text
node to apply a style. SplitElementCommand and WrapContentsInDummySpanCommand both
have member variables initialized in the constructor to keep reference to elements
they need to operate upon. These reference are not updated when reapplying the command.
For this reason it is necessary to guarantee that unapply doesn not delete the references
and that these commands implement doReapply to correctly reuse the existing
elements.

Test: editing/undo/redo-style.html

* editing/SplitElementCommand.cpp:
(WebCore::SplitElementCommand::executeApply): Added.
(WebCore::SplitElementCommand::doApply): Modified to call executeApply.
(WebCore::SplitElementCommand::doUnapply): Doesn't release m_element1.
(WebCore::SplitElementCommand::doReapply): Added.
* editing/SplitElementCommand.h: Added doReapply and executeApply.
* editing/WrapContentsInDummySpanCommand.cpp:
(WebCore::WrapContentsInDummySpanCommand::executeApply): Added.
(WebCore::WrapContentsInDummySpanCommand::doApply): Modified to call executeApply.
(WebCore::WrapContentsInDummySpanCommand::doUnapply): Doesn't release m_dummySpan.
(WebCore::WrapContentsInDummySpanCommand::doReapply): Added.
* editing/WrapContentsInDummySpanCommand.h: Added doReapply and executeApply.

LayoutTests:

Patch by Enrica Casucci <enrica@apple.com> on 2009-10-29
* editing/undo/redo-style-expected.txt: Added.
* editing/undo/redo-style.html: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@50310 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/editing/undo/redo-style-expected.txt [new file with mode: 0644]
LayoutTests/editing/undo/redo-style.html [new file with mode: 0644]
WebCore/ChangeLog
WebCore/editing/SplitElementCommand.cpp
WebCore/editing/SplitElementCommand.h
WebCore/editing/WrapContentsInDummySpanCommand.cpp
WebCore/editing/WrapContentsInDummySpanCommand.h