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

Unified Diff: Source/core/css/CSSBasicShapes.cpp

Issue 1318543010: Change first() and second() in CSSPairValue to return const references (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Review feedback Created 5 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
« no previous file with comments | « Source/core/css/BasicShapeFunctions.cpp ('k') | Source/core/css/CSSGradientValue.cpp » ('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 8db9f27afba5fa3683391a586fbed4e9a23ee786..13e7e8ab9a2f8c181f918af9c3eedfb6b8af690b 100644
--- a/Source/core/css/CSSBasicShapes.cpp
+++ b/Source/core/css/CSSBasicShapes.cpp
@@ -65,9 +65,9 @@ static String buildCircleString(const String& radius, const String& centerX, con
static String serializePositionOffset(const CSSValuePair& offset, const CSSValuePair& 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 ((toCSSPrimitiveValue(offset.first()).getValueID() == CSSValueLeft && toCSSPrimitiveValue(other.first()).getValueID() == CSSValueTop)
+ || (toCSSPrimitiveValue(offset.first()).getValueID() == CSSValueTop && toCSSPrimitiveValue(other.first()).getValueID() == CSSValueLeft))
+ return offset.second().cssText();
return offset.cssText();
}
@@ -81,8 +81,8 @@ static PassRefPtrWillBeRawPtr<CSSValuePair> buildSerializablePositionOffset(Pass
} else if (offset->isPrimitiveValue() && toCSSPrimitiveValue(offset.get())->isValueID()) {
side = toCSSPrimitiveValue(offset.get())->getValueID();
} else if (offset->isValuePair()) {
- side = toCSSPrimitiveValue(toCSSValuePair(offset.get())->first())->getValueID();
- amount = toCSSPrimitiveValue(toCSSValuePair(offset.get())->second());
+ side = toCSSPrimitiveValue(toCSSValuePair(*offset).first()).getValueID();
+ amount = &toCSSPrimitiveValue(toCSSValuePair(*offset).second());
} else {
amount = toCSSPrimitiveValue(offset.get());
}
@@ -354,14 +354,13 @@ static String buildInsetString(const String& top, const String& right, const Str
return result.toString();
}
-static inline void updateCornerRadiusWidthAndHeight(CSSValuePair* cornerRadius, String& width, String& height)
+static inline void updateCornerRadiusWidthAndHeight(const CSSValuePair* cornerRadius, String& width, String& height)
{
if (!cornerRadius)
return;
- width = cornerRadius->first() ? cornerRadius->first()->cssText() : String("0");
- if (cornerRadius->second())
- height = cornerRadius->second()->cssText();
+ width = cornerRadius->first().cssText();
+ height = cornerRadius->second().cssText();
}
String CSSBasicShapeInset::cssText() const
« no previous file with comments | « Source/core/css/BasicShapeFunctions.cpp ('k') | Source/core/css/CSSGradientValue.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698