In 'mergeInlineAndImplicitStyleOfElement' we get style from matched rules.
If they contain either background-color or text-decoration they will be removed
in removeNonEditingProperties() due to implicit OnlyInheritableEditingProperties
parameter.
We have already had similar issue at https://bugs.webkit.org/show_bug.cgi?id=53196
This is being discussed at https://bugs.webkit.org/show_bug.cgi?id=116215.
Change-Id: I63a37cbf5a7f729487c52e824f57941782a37da0
#define ENABLE_TIZEN_USE_SETTINGS_FONT 1 /* Hyeonji Kim(hyeonji.kim@samsung.com) : When font-family is "Tizen", use system's setting font as default font-family */
#define ENABLE_TIZEN_PARAGRAPH_SEPARATOR_FIX 1 /* Michal Pakula (m.pakula@samsung.com) : This is a quick fix for a bug where new paragraph was not created on contenteditable area with image and text nodes inside span tag */
#define ENABLE_TIZEN_CONTENT_EDITABLE_BACKSPACE 1 /* Wojciech Bielawski(w.bielawski.com) : This is a quick fix for a bug where after pressing backspace image was moved not correctly */
+#define ENABLE_TIZEN_PRESERVE_PROPERTIES_WHEN_PARAGRAPH_MERGE 1 /* Grzegorz Czajkowski (g.czajkowski@samsung.com): This is a quick fix for background-color and text-decoration defined in class are not copied when paragraph is merged. We erroneously copy only CSS inheritable properties via removeNonEditingProperties(). */
#if ENABLE(TEXT_AUTOSIZING)
#define ENABLE_TIZEN_TEXT_AUTOSIZING 1 /* Jaehun Lim(ljaehun.lim@samsung.com) : for Tizen environment */
m_mutableStyle->removeProperty(nodeStyle->propertyAt(i).id());
}
+#if ENABLE(TIZEN_PRESERVE_PROPERTIES_WHEN_PARAGRAPH_MERGE)
+void EditingStyle::removeNonEditingProperties(bool removeNonInheritableEditingProperties)
+#else
void EditingStyle::removeNonEditingProperties()
+#endif
{
if (m_mutableStyle)
+#if ENABLE(TIZEN_PRESERVE_PROPERTIES_WHEN_PARAGRAPH_MERGE)
+ m_mutableStyle = copyEditingProperties(m_mutableStyle.get(), removeNonInheritableEditingProperties ? OnlyInheritableEditingProperties : AllEditingProperties);
+#else
m_mutableStyle = copyEditingProperties(m_mutableStyle.get());
+#endif
}
void EditingStyle::collapseTextDecorationProperties()
{
RefPtr<EditingStyle> styleFromRules = EditingStyle::create();
styleFromRules->mergeStyleFromRulesForSerialization(element);
+#if ENABLE(TIZEN_PRESERVE_PROPERTIES_WHEN_PARAGRAPH_MERGE)
+ styleFromRules->removeNonEditingProperties(propertiesToInclude == OnlyEditingInheritableProperties);
+#else
styleFromRules->removeNonEditingProperties();
+#endif
mergeStyle(styleFromRules->m_mutableStyle.get(), mode);
mergeInlineStyleOfElement(element, mode, propertiesToInclude);
void removeBlockProperties();
void removeStyleAddedByNode(Node*);
void removeStyleConflictingWithStyleOfNode(Node*);
+#if ENABLE(TIZEN_PRESERVE_PROPERTIES_WHEN_PARAGRAPH_MERGE)
+ void removeNonEditingProperties(bool removeNonInheritableEditingProperties = true);
+#else
void removeNonEditingProperties();
+#endif
void collapseTextDecorationProperties();
enum ShouldIgnoreTextOnlyProperties { IgnoreTextOnlyProperties, DoNotIgnoreTextOnlyProperties };
TriState triStateOfStyle(EditingStyle*) const;