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

Unified Diff: Source/core/css/CSSGradientValue.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/CSSBasicShapes.cpp ('k') | Source/core/css/CSSValuePair.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/css/CSSGradientValue.cpp
diff --git a/Source/core/css/CSSGradientValue.cpp b/Source/core/css/CSSGradientValue.cpp
index f46cbf59f0fe2534b06b0aa5f60a27bdfa8c6b98..6a83a0508afa9c9011c7e81227d6e8232910b942 100644
--- a/Source/core/css/CSSGradientValue.cpp
+++ b/Source/core/css/CSSGradientValue.cpp
@@ -489,9 +489,9 @@ static float positionFromValue(CSSValue* value, const CSSToLengthConversionData&
// In this case the center of the gradient is given relative to an edge in the form of:
// [ top | bottom | right | left ] [ <percentage> | <length> ].
if (value->isValuePair()) {
- CSSValuePair* pair = toCSSValuePair(value);
- CSSValueID originID = toCSSPrimitiveValue(pair->first())->getValueID();
- value = pair->second();
+ CSSValuePair& pair = toCSSValuePair(*value);
+ CSSValueID originID = toCSSPrimitiveValue(pair.first()).getValueID();
+ value = &pair.second();
if (originID == CSSValueRight || originID == CSSValueBottom) {
// For right/bottom, the offset is relative to the far edge.
« no previous file with comments | « Source/core/css/CSSBasicShapes.cpp ('k') | Source/core/css/CSSValuePair.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698