Deleting across multiple paragraphs can change the style of surrounding text
authorrniwa@webkit.org <rniwa@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 5 Oct 2012 18:26:37 +0000 (18:26 +0000)
committerrniwa@webkit.org <rniwa@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 5 Oct 2012 18:26:37 +0000 (18:26 +0000)
commit92541d35ac8a0b74d6981ebb9639c0b1f54ed7e4
treeabc838b2589185ad04f5ebd0fd453bbfaaef95fa
parentec648e62920ece0a48e0b040baae42f590db7f80
Deleting across multiple paragraphs can change the style of surrounding text
https://bugs.webkit.org/show_bug.cgi?id=97266

Reviewed by Levi Weintraub.

Source/WebCore:

Preserve editing styles from CSS rules in wrappingStyleForSerialization as well as inline styles
even when we're not annotating. We don't want to preserve all styles because it's against
the user expectation to keep borders, etc... when merging paragraphs. We also don't want to copy
styles from a mail blockquote because that's not a style the user has applied. See the comment
in EditingStyle::wrappingStyleForSerialization.

Test: editing/deleting/merge-paragraph-with-style-from-rule.html

* editing/EditingStyle.cpp:
(WebCore::EditingStyle::mergeInlineAndImplicitStyleOfElement):
(WebCore::EditingStyle::wrappingStyleForSerialization):

LayoutTests:

Added a regression test and rebaselined tests.

* editing/deleting/delete-before-block-image-2-expected.txt:
* editing/deleting/merge-paragraph-from-p-with-style-expected.txt:
* editing/deleting/merge-paragraph-from-p-with-style.html: We changed the behavior. The editing style of p
is now preserved when merging paragraphs.
* editing/deleting/merge-paragraph-with-style-from-rule-expected.txt: Added.
* editing/deleting/merge-paragraph-with-style-from-rule.html: Added.
* platform/mac/editing/deleting/delete-block-merge-contents-001-expected.txt:
* platform/mac/editing/pasteboard/merge-end-blockquote-expected.txt:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@130532 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/editing/deleting/delete-before-block-image-2-expected.txt
LayoutTests/editing/deleting/merge-paragraph-from-p-with-style-expected.txt
LayoutTests/editing/deleting/merge-paragraph-from-p-with-style.html
LayoutTests/editing/deleting/merge-paragraph-with-style-from-rule-expected.txt [new file with mode: 0644]
LayoutTests/editing/deleting/merge-paragraph-with-style-from-rule.html [new file with mode: 0644]
LayoutTests/platform/mac/editing/deleting/delete-block-merge-contents-001-expected.txt
LayoutTests/platform/mac/editing/pasteboard/merge-end-blockquote-expected.txt
Source/WebCore/ChangeLog
Source/WebCore/editing/EditingStyle.cpp