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)
committerGrzegorz Czajkowski <g.czajkowski@samsung.com>
Mon, 3 Jun 2013 12:56:19 +0000 (14:56 +0200)
commit3913f516f41fc490c3d44d394756a20ec600ec61
treebd3eba6aaf26b4a185cb3015d810ac157817dbd8
parent5d2357690066adc3f68873ef102216e9f4225246
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:

Change-Id: I1965220755b35616dbb6c48608047b241a3b3d5f
git-svn-id: http://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