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

Unified Diff: Source/core/css/CSSBasicShapes.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/css/CSSBasicShapes.h ('k') | Source/core/css/CSSBorderImage.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/css/CSSBasicShapes.cpp
diff --git a/Source/core/css/CSSBasicShapes.cpp b/Source/core/css/CSSBasicShapes.cpp
index 8af835b6039e250a0593a722076f1d80a18c641a..562234c97b2d9c6c1fb7cacf26df72f3d7262617 100644
--- a/Source/core/css/CSSBasicShapes.cpp
+++ b/Source/core/css/CSSBasicShapes.cpp
@@ -69,13 +69,13 @@ static String buildCircleString(const String& radius, const String& centerX, con
static String serializePositionOffset(const Pair& offset, const Pair& other)
{
- if ((toCSSPrimitiveValue(*offset.first()).getValueID() == CSSValueLeft && toCSSPrimitiveValue(*other.first()).getValueID() == CSSValueTop)
- || (toCSSPrimitiveValue(*offset.first()).getValueID() == CSSValueTop && toCSSPrimitiveValue(*other.first()).getValueID() == CSSValueLeft))
- return offset.second()->cssText();
+ if ((offset.first().getValueID() == CSSValueLeft && other.first().getValueID() == CSSValueTop)
+ || (offset.first().getValueID() == CSSValueTop && other.first().getValueID() == CSSValueLeft))
+ return offset.second().cssText();
return offset.cssText();
}
-static CSSPrimitiveValue buildSerializablePositionOffset(NullableCSSValue offset, CSSValueID defaultSide)
+static CSSPrimitiveValue buildSerializablePositionOffset(const NullableCSSValue& offset, CSSValueID defaultSide)
{
CSSValueID side = defaultSide;
NullableCSSValue amount;
@@ -85,7 +85,7 @@ static CSSPrimitiveValue buildSerializablePositionOffset(NullableCSSValue offset
} else if (toCSSPrimitiveValue(*offset).isValueID()) {
side = toCSSPrimitiveValue(*offset).getValueID();
} else if (Pair* pair = toCSSPrimitiveValue(*offset).getPairValue()) {
- side = toCSSPrimitiveValue(*pair->first()).getValueID();
+ side = pair->first().getValueID();
amount = pair->second();
} else {
amount = offset;
@@ -378,15 +378,14 @@ static String buildInsetString(const String& top, const String& right, const Str
return result.toString();
}
-static inline void updateCornerRadiusWidthAndHeight(NullableCSSValue corner, String& width, String& height)
+static inline void updateCornerRadiusWidthAndHeight(const NullableCSSValue& corner, String& width, String& height)
{
if (!corner)
return;
Pair* radius = toCSSPrimitiveValue(*corner).getPairValue();
- width = radius->first() ? radius->first()->cssText() : String("0");
- if (radius->second())
- height = radius->second()->cssText();
+ width = radius->first().cssText();
+ height = radius->second().cssText();
}
String CSSBasicShapeInset::cssText() const
« no previous file with comments | « Source/core/css/CSSBasicShapes.h ('k') | Source/core/css/CSSBorderImage.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698