#define ENABLE_TIZEN_LOAD_HTML_STRING_AS_UTF8 1 /* KwangYong Choi (ky0.choi@samsung.com) : Use UTF-8 instead of UTF-16 when the page is loaded by WebPage::loadHTMLString() */
#define ENABLE_TIZEN_DRAW_SCALED_PATTERN 1 /* Kyungjin Kim(gen.kim@samsung.com) : Scale image prior to draw it's pattern to enhance performance */
#define ENABLE_TIZEN_PAINT_SELECTION_ANTIALIAS_NONE 1 /* Hyeonji Kim(hyeonji.kim@samsung.com) : Remove the line between the preceding text block and the next text block which are selected */
-#define ENABLE_TIZEN_PRESERVE_STYLE_WHILE_COPYING 1 /* Grzegorz Czajkowski (g.czajkowski@samsung.com): while copying elements, their style are not being copied. It happens for span tag if it occurs alone. This is cherry-pick from https://bugs.webkit.org/show_bug.cgi?id=112329 which is under review. */
#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 */
styleToRemovePropertiesFrom->removePropertiesInSet(propertiesToRemove.data(), propertiesToRemove.size());
}
-#if ENABLE(TIZEN_PRESERVE_STYLE_WHILE_COPYING)
-bool EditingStyle::removeStyleFromRulesAndContext(StyledElement* element, Node* context)
-#else
void EditingStyle::removeStyleFromRulesAndContext(StyledElement* element, Node* context)
-#endif
{
ASSERT(element);
if (!m_mutableStyle)
-#if ENABLE(TIZEN_PRESERVE_STYLE_WHILE_COPYING)
- return false;
-#else
return;
-#endif
// 1. Remove style from matched rules because style remain without repeating it in inline style declaration
-#if ENABLE(TIZEN_PRESERVE_STYLE_WHILE_COPYING)
- bool removedStyleFromRules = false;
-#endif
RefPtr<StylePropertySet> styleFromMatchedRules = styleFromMatchedRulesForElement(element, StyleResolver::AllButEmptyCSSRules);
-#if ENABLE(TIZEN_PRESERVE_STYLE_WHILE_COPYING)
- if (styleFromMatchedRules && !styleFromMatchedRules->isEmpty()) {
- RefPtr<StylePropertySet> newStyle = getPropertiesNotIn(m_mutableStyle.get(), styleFromMatchedRules->ensureCSSStyleDeclaration());
- removedStyleFromRules = newStyle->propertyCount() != m_mutableStyle->propertyCount();
- if (removedStyleFromRules)
- m_mutableStyle = newStyle;
- }
-#else
if (styleFromMatchedRules && !styleFromMatchedRules->isEmpty())
m_mutableStyle = getPropertiesNotIn(m_mutableStyle.get(), styleFromMatchedRules->ensureCSSStyleDeclaration());
-#endif
// 2. Remove style present in context and not overriden by matched rules.
RefPtr<EditingStyle> computedStyle = EditingStyle::create(context, EditingPropertiesInEffect);
if (!styleFromMatchedRules->getPropertyCSSValue(CSSPropertyFloat) && getIdentifierValue(m_mutableStyle.get(), CSSPropertyFloat) == CSSValueNone)
m_mutableStyle->removeProperty(CSSPropertyFloat);
}
-
-#if ENABLE(TIZEN_PRESERVE_STYLE_WHILE_COPYING)
- return removedStyleFromRules;
-#endif
}
void EditingStyle::removePropertiesInElementDefaultStyle(Element* element)
static PassRefPtr<EditingStyle> wrappingStyleForSerialization(Node* context, bool shouldAnnotate);
void mergeStyleFromRules(StyledElement*);
void mergeStyleFromRulesForSerialization(StyledElement*);
-#if ENABLE(TIZEN_PRESERVE_STYLE_WHILE_COPYING)
- bool removeStyleFromRulesAndContext(StyledElement*, Node* context);
-#else
void removeStyleFromRulesAndContext(StyledElement*, Node* context);
-#endif
void removePropertiesInElementDefaultStyle(Element*);
void forceInline();
int legacyFontSize(Document*) const;
const StylePropertySet* inlineStyle = element->inlineStyle();
RefPtr<EditingStyle> newInlineStyle = EditingStyle::create(inlineStyle);
-#if ENABLE(TIZEN_PRESERVE_STYLE_WHILE_COPYING)
- bool removedStyleFromRules = false;
-#endif
if (inlineStyle) {
ContainerNode* context = element->parentNode();
// styles from blockquoteNode are allowed to override those from the source document, see <rdar://problem/4930986> and <rdar://problem/5089327>.
Node* blockquoteNode = isMailPasteAsQuotationNode(context) ? context : enclosingNodeOfType(firstPositionInNode(context), isMailBlockquote, CanCrossEditingBoundary);
if (blockquoteNode)
-#if ENABLE(TIZEN_PRESERVE_STYLE_WHILE_COPYING)
- removedStyleFromRules = newInlineStyle->removeStyleFromRulesAndContext(element, document()->documentElement());
-
- removedStyleFromRules |= newInlineStyle->removeStyleFromRulesAndContext(element, context);
-#else
newInlineStyle->removeStyleFromRulesAndContext(element, document()->documentElement());
newInlineStyle->removeStyleFromRulesAndContext(element, context);
-#endif
}
if (!inlineStyle || newInlineStyle->isEmpty()) {
-#if ENABLE(TIZEN_PRESERVE_STYLE_WHILE_COPYING)
- if (!removedStyleFromRules && (isStyleSpanOrSpanWithOnlyStyleAttribute(element))) {
-#else
if (isStyleSpanOrSpanWithOnlyStyleAttribute(element)) {
-#endif
insertedNodes.willRemoveNodePreservingChildren(element);
removeNodePreservingChildren(element);
continue;
if (body && areRangesEqual(VisibleSelection::selectionFromContentsOfNode(body).toNormalizedRange().get(), range))
fullySelectedRoot = body;
Node* specialCommonAncestor = highestAncestorToWrapMarkup(updatedRange.get(), shouldAnnotate);
-#if ENABLE(TIZEN_PRESERVE_STYLE_WHILE_COPYING)
- StyledMarkupAccumulator accumulator(nodes, shouldResolveURLs, AnnotateForInterchange, updatedRange.get(), specialCommonAncestor);
-#else
StyledMarkupAccumulator accumulator(nodes, shouldResolveURLs, shouldAnnotate, updatedRange.get(), specialCommonAncestor);
-#endif
Node* pastEnd = updatedRange->pastLastNode();
Node* startNode = updatedRange->firstNode();