Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(714)

Unified Diff: Source/core/editing/EditingStyle.cpp

Issue 1195813003: Refactoring: Remove a boolean parameter from EditingStyle::wrappingStyleForSerialization (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: comment 80 chars in a line Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/core/editing/EditingStyle.h ('k') | Source/core/editing/StyledMarkupSerializer.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/editing/EditingStyle.cpp
diff --git a/Source/core/editing/EditingStyle.cpp b/Source/core/editing/EditingStyle.cpp
index 52a3c39c96301892632d7f7bacee2d4b5bc6184c..24bef043a64f95bcb58a5527559cbc2d1a8bd5b7 100644
--- a/Source/core/editing/EditingStyle.cpp
+++ b/Source/core/editing/EditingStyle.cpp
@@ -1091,24 +1091,25 @@ void EditingStyle::mergeInlineAndImplicitStyleOfElement(Element* element, CSSPro
}
}
-PassRefPtrWillBeRawPtr<EditingStyle> EditingStyle::wrappingStyleForSerialization(ContainerNode* context, bool shouldAnnotate)
+PassRefPtrWillBeRawPtr<EditingStyle> EditingStyle::wrappingStyleForAnnotatedSerialization(ContainerNode* context)
{
- RefPtrWillBeRawPtr<EditingStyle> wrappingStyle = nullptr;
- if (shouldAnnotate) {
- wrappingStyle = EditingStyle::create(context, EditingStyle::EditingPropertiesInEffect);
+ RefPtrWillBeRawPtr<EditingStyle> wrappingStyle = EditingStyle::create(context, EditingStyle::EditingPropertiesInEffect);
- // Styles that Mail blockquotes contribute should only be placed on the Mail blockquote,
- // to help us differentiate those styles from ones that the user has applied.
- // This helps us get the color of content pasted into blockquotes right.
- wrappingStyle->removeStyleAddedByElement(toHTMLElement(enclosingNodeOfType(firstPositionInOrBeforeNode(context), isMailHTMLBlockquoteElement, CanCrossEditingBoundary)));
+ // Styles that Mail blockquotes contribute should only be placed on the Mail
+ // blockquote, to help us differentiate those styles from ones that the user
+ // has applied. This helps us get the color of content pasted into
+ // blockquotes right.
+ wrappingStyle->removeStyleAddedByElement(toHTMLElement(enclosingNodeOfType(firstPositionInOrBeforeNode(context), isMailHTMLBlockquoteElement, CanCrossEditingBoundary)));
- // Call collapseTextDecorationProperties first or otherwise it'll copy the value over from in-effect to text-decorations.
- wrappingStyle->collapseTextDecorationProperties();
+ // Call collapseTextDecorationProperties first or otherwise it'll copy the value over from in-effect to text-decorations.
+ wrappingStyle->collapseTextDecorationProperties();
- return wrappingStyle.release();
- }
+ return wrappingStyle.release();
+}
- wrappingStyle = EditingStyle::create();
+PassRefPtrWillBeRawPtr<EditingStyle> EditingStyle::wrappingStyleForSerialization(ContainerNode* context)
+{
+ RefPtrWillBeRawPtr<EditingStyle> wrappingStyle = EditingStyle::create();
// When not annotating for interchange, we only preserve inline style declarations.
for (ContainerNode* node = context; node && !node->isDocumentNode(); node = node->parentNode()) {
@@ -1121,7 +1122,6 @@ PassRefPtrWillBeRawPtr<EditingStyle> EditingStyle::wrappingStyleForSerialization
return wrappingStyle.release();
}
-
static void mergeTextDecorationValues(CSSValueList* mergedValue, const CSSValueList* valueToMerge)
{
DEFINE_STATIC_REF_WILL_BE_PERSISTENT(CSSPrimitiveValue, underline, (CSSPrimitiveValue::createIdentifier(CSSValueUnderline)));
« no previous file with comments | « Source/core/editing/EditingStyle.h ('k') | Source/core/editing/StyledMarkupSerializer.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698