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

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

Issue 1233363002: CSSValue Immediates: Replace CSSPrimitiveValue usage with const references (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@cssvalue_patch_4_attempt_2
Patch Set: Rebase Created 5 years, 5 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/ApplyStyleCommand.cpp ('k') | Source/core/layout/svg/ReferenceFilterBuilder.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 16e2bcf61ac9825437f68c010054c806b79bdee0..82f1cc9196c08c42792b47c147066962004996ae 100644
--- a/Source/core/editing/EditingStyle.cpp
+++ b/Source/core/editing/EditingStyle.cpp
@@ -148,8 +148,8 @@ static PassRefPtrWillBeRawPtr<MutableStylePropertySet> editingStyleFromComputedS
static PassRefPtrWillBeRawPtr<MutableStylePropertySet> getPropertiesNotIn(StylePropertySet* styleWithRedundantProperties, CSSStyleDeclaration* baseStyle);
enum LegacyFontSizeMode { AlwaysUseLegacyFontSize, UseLegacyFontSizeOnlyIfPixelValuesMatch };
-static int legacyFontSizeFromCSSValue(Document*, CSSPrimitiveValue, bool, LegacyFontSizeMode);
-static bool isTransparentColorValue(NullableCSSValue);
+static int legacyFontSizeFromCSSValue(Document*, const CSSPrimitiveValue&, bool, LegacyFontSizeMode);
+static bool isTransparentColorValue(const NullableCSSValue&);
static bool hasTransparentBackgroundColor(CSSStyleDeclaration*);
static bool hasTransparentBackgroundColor(StylePropertySet*);
static NullableCSSValue backgroundColorInEffect(Node*);
@@ -391,7 +391,7 @@ static RGBA32 cssValueToRGBA(NullableCSSValue colorValue)
if (!colorValue || !colorValue->isPrimitiveValue())
return Color::transparent;
- CSSPrimitiveValue primitiveColor = toCSSPrimitiveValue(*colorValue);
+ const CSSPrimitiveValue& primitiveColor = toCSSPrimitiveValue(*colorValue);
if (primitiveColor.isRGBColor())
return primitiveColor.getRGBA32Value();
@@ -523,7 +523,7 @@ void EditingStyle::extractFontSizeDelta()
if (!value || !value->isPrimitiveValue())
return;
- CSSPrimitiveValue primitiveValue = toCSSPrimitiveValue(*value);
+ const CSSPrimitiveValue& primitiveValue = toCSSPrimitiveValue(*value);
// Only PX handled now. If we handle more types in the future, perhaps
// a switch statement here would be more appropriate.
@@ -1555,9 +1555,9 @@ void StyleChange::extractTextStyles(Document* document, MutableStylePropertySet*
}
}
-static void diffTextDecorations(MutableStylePropertySet* style, CSSPropertyID propertyID, NullableCSSValue refTextDecoration)
+static void diffTextDecorations(MutableStylePropertySet* style, CSSPropertyID propertyID, const NullableCSSValue& refTextDecoration)
{
- NullableCSSValue textDecoration = style->getPropertyCSSValue(propertyID);
+ const NullableCSSValue& textDecoration = style->getPropertyCSSValue(propertyID);
if (!textDecoration || !textDecoration->isValueList() || !refTextDecoration || !refTextDecoration->isValueList())
return;
@@ -1660,7 +1660,7 @@ CSSValueID getIdentifierValue(CSSStyleDeclaration* style, CSSPropertyID property
return toCSSPrimitiveValue(*value).getValueID();
}
-int legacyFontSizeFromCSSValue(Document* document, CSSPrimitiveValue value, bool isMonospaceFont, LegacyFontSizeMode mode)
+int legacyFontSizeFromCSSValue(Document* document, const CSSPrimitiveValue& value, bool isMonospaceFont, LegacyFontSizeMode mode)
{
CSSPrimitiveValue::LengthUnitType lengthType;
if (CSSPrimitiveValue::unitTypeToLengthUnitType(value.primitiveType(), lengthType)
@@ -1681,13 +1681,13 @@ int legacyFontSizeFromCSSValue(Document* document, CSSPrimitiveValue value, bool
return 0;
}
-bool isTransparentColorValue(NullableCSSValue cssValue)
+bool isTransparentColorValue(const NullableCSSValue& cssValue)
{
if (!cssValue)
return true;
if (!cssValue->isPrimitiveValue())
return false;
- CSSPrimitiveValue value = toCSSPrimitiveValue(*cssValue);
+ const CSSPrimitiveValue& value = toCSSPrimitiveValue(*cssValue);
if (value.isRGBColor())
return !alphaChannel(value.getRGBA32Value());
return value.getValueID() == CSSValueTransparent;
« no previous file with comments | « Source/core/editing/ApplyStyleCommand.cpp ('k') | Source/core/layout/svg/ReferenceFilterBuilder.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698