Span element gets produced using backspace/delete to merge header with paragraph
authorrniwa@webkit.org <rniwa@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 21 Sep 2011 17:06:53 +0000 (17:06 +0000)
committerrniwa@webkit.org <rniwa@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 21 Sep 2011 17:06:53 +0000 (17:06 +0000)
commitd1ef975a7c0cd31bdb1a012e3cd9d6343c9e0497
treef06a6571405ddf67289aee3f40898925675743b5
parent678e41ae4a510ba135312afaefe62699cc40dcf8
Span element gets produced using backspace/delete to merge header with paragraph
https://bugs.webkit.org/show_bug.cgi?id=68413

Reviewed by Darin Adler.

Source/WebCore:

Add p element to the list of elements to retain appearance. Also modified removeStyleFromNode
(and renamed to removeStyleFromRules) not to remove inline style declarations because
inline styles need to stay on copy.

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

* editing/DeleteSelectionCommand.cpp:
(WebCore::DeleteSelectionCommand::saveTypingStyleState):
* editing/EditingStyle.cpp:
(WebCore::EditingStyle::removeStyleFromRules): Renamed from removeStyleFromNode.
* editing/EditingStyle.h:
* editing/markup.cpp:
(WebCore::isBlockNodeToRetainAppearance):
(WebCore::StyledMarkupAccumulator::serializeNodes):

LayoutTests:

Add a test to remove the line break before a p element. WebKit should not preserve
the font color from the style rule but should preserve the font style from inline style declaration.

Also fix merge-paragraph-from-h6* to actually h6 instead of h1.

* editing/deleting/merge-paragraph-from-h6-expected.txt:
* editing/deleting/merge-paragraph-from-h6-with-style-expected.txt:
* editing/deleting/merge-paragraph-from-h6-with-style.html:
* editing/deleting/merge-paragraph-from-h6.html:
* editing/deleting/merge-paragraph-from-p-with-style-expected.txt: Added.
* editing/deleting/merge-paragraph-from-p-with-style.html: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@95645 268f45cc-cd09-0410-ab3c-d52691b4dbfc
12 files changed:
LayoutTests/ChangeLog
LayoutTests/editing/deleting/merge-paragraph-from-h6-expected.txt
LayoutTests/editing/deleting/merge-paragraph-from-h6-with-style-expected.txt
LayoutTests/editing/deleting/merge-paragraph-from-h6-with-style.html
LayoutTests/editing/deleting/merge-paragraph-from-h6.html
LayoutTests/editing/deleting/merge-paragraph-from-p-with-style-expected.txt [new file with mode: 0644]
LayoutTests/editing/deleting/merge-paragraph-from-p-with-style.html [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/editing/DeleteSelectionCommand.cpp
Source/WebCore/editing/EditingStyle.cpp
Source/WebCore/editing/EditingStyle.h
Source/WebCore/editing/markup.cpp