Applied background color is not retained after typing a characters
https://bugs.webkit.org/show_bug.cgi?id=117337

Patch by Vani Hegde <vani.hegde@samsung.com> on 2013-11-06
Reviewed by Ryosuke Niwa.

Source/WebCore:

While deleting a selection, only the inheritable style properties
applied on the selection were saved.
Since background color is considered as noninheritable style property,
on deleting the selection, background color set on it was being lost.
Hence on typing in new text, it would not have the applied
background color set.
Fixed by saving editing preoperties that are already in effect
on a selection before deleting it.

Test: editing/style/background-color-retained.html

* editing/DeleteSelectionCommand.cpp:
(WebCore::DeleteSelectionCommand::saveTypingStyleState):
Modified as to save EditingPropertiesInEffect on a selection before
deleting it.

LayoutTests:

* editing/style/background-color-retained-expected.txt: Added.
* editing/style/background-color-retained.html: Added.
Test to make sure that background color applied on a
selection is retained after deleting the selection.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@158815 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/Source/WebCore/editing/DeleteSelectionCommand.cpp b/Source/WebCore/editing/DeleteSelectionCommand.cpp
index 00b1d4f..71ee901 100644
--- a/Source/WebCore/editing/DeleteSelectionCommand.cpp
+++ b/Source/WebCore/editing/DeleteSelectionCommand.cpp
@@ -291,7 +291,7 @@
     }
 
     // Figure out the typing style in effect before the delete is done.
-    m_typingStyle = EditingStyle::create(m_selectionToDelete.start());
+    m_typingStyle = EditingStyle::create(m_selectionToDelete.start(), EditingStyle::EditingPropertiesInEffect);
     m_typingStyle->removeStyleAddedByNode(enclosingAnchorElement(m_selectionToDelete.start()));
 
     // If we're deleting into a Mail blockquote, save the style at end() instead of start()