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

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

Issue 2233333002: Made StylePropertySet::setProperty take a const CSSValue& instead of ptr (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 4 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
Index: third_party/WebKit/Source/core/editing/EditingStyle.cpp
diff --git a/third_party/WebKit/Source/core/editing/EditingStyle.cpp b/third_party/WebKit/Source/core/editing/EditingStyle.cpp
index edca53680c2b26d723d228b46bfce27ca1c95ffe..5c012479f37d58d2fe12590b61be7d683508139e 100644
--- a/third_party/WebKit/Source/core/editing/EditingStyle.cpp
+++ b/third_party/WebKit/Source/core/editing/EditingStyle.cpp
@@ -1140,16 +1140,16 @@ EditingStyle* EditingStyle::wrappingStyleForSerialization(ContainerNode* context
return wrappingStyle;
}
-static CSSValueList* mergeTextDecorationValues(const CSSValueList& mergedValue, const CSSValueList& valueToMerge)
+static const CSSValueList& mergeTextDecorationValues(const CSSValueList& mergedValue, const CSSValueList& valueToMerge)
{
DEFINE_STATIC_LOCAL(CSSPrimitiveValue, underline, (CSSPrimitiveValue::createIdentifier(CSSValueUnderline)));
DEFINE_STATIC_LOCAL(CSSPrimitiveValue, lineThrough, (CSSPrimitiveValue::createIdentifier(CSSValueLineThrough)));
- CSSValueList* result = mergedValue.copy();
+ CSSValueList& result = *mergedValue.copy();
if (valueToMerge.hasValue(underline) && !mergedValue.hasValue(underline))
- result->append(underline);
+ result.append(underline);
if (valueToMerge.hasValue(lineThrough) && !mergedValue.hasValue(lineThrough))
- result->append(lineThrough);
+ result.append(lineThrough);
return result;
}
@@ -1172,7 +1172,7 @@ void EditingStyle::mergeStyle(const StylePropertySet* style, CSSPropertyOverride
// text decorations never override values
if ((property.id() == textDecorationPropertyForEditing() || property.id() == CSSPropertyWebkitTextDecorationsInEffect) && property.value().isValueList() && value) {
if (value->isValueList()) {
- CSSValueList* result = mergeTextDecorationValues(*toCSSValueList(value), toCSSValueList(property.value()));
+ const CSSValueList& result = mergeTextDecorationValues(*toCSSValueList(value), toCSSValueList(property.value()));
m_mutableStyle->setProperty(property.id(), result, property.isImportant());
continue;
}
@@ -1307,10 +1307,10 @@ void EditingStyle::addAbsolutePositioningFromElement(const Element& element)
}
m_mutableStyle->setProperty(CSSPropertyPosition, CSSValueAbsolute);
- m_mutableStyle->setProperty(CSSPropertyLeft, CSSPrimitiveValue::create(x, CSSPrimitiveValue::UnitType::Pixels));
- m_mutableStyle->setProperty(CSSPropertyTop, CSSPrimitiveValue::create(y, CSSPrimitiveValue::UnitType::Pixels));
- m_mutableStyle->setProperty(CSSPropertyWidth, CSSPrimitiveValue::create(width, CSSPrimitiveValue::UnitType::Pixels));
- m_mutableStyle->setProperty(CSSPropertyHeight, CSSPrimitiveValue::create(height, CSSPrimitiveValue::UnitType::Pixels));
+ m_mutableStyle->setProperty(CSSPropertyLeft, *CSSPrimitiveValue::create(x, CSSPrimitiveValue::UnitType::Pixels));
+ m_mutableStyle->setProperty(CSSPropertyTop, *CSSPrimitiveValue::create(y, CSSPrimitiveValue::UnitType::Pixels));
+ m_mutableStyle->setProperty(CSSPropertyWidth, *CSSPrimitiveValue::create(width, CSSPrimitiveValue::UnitType::Pixels));
+ m_mutableStyle->setProperty(CSSPropertyHeight, *CSSPrimitiveValue::create(height, CSSPrimitiveValue::UnitType::Pixels));
}
void EditingStyle::forceInline()
« no previous file with comments | « third_party/WebKit/Source/core/dom/Element.cpp ('k') | third_party/WebKit/Source/core/editing/commands/ApplyStyleCommand.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698