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

Unified Diff: third_party/WebKit/Source/core/css/CSSGradientValue.cpp

Issue 2502413004: WTF/std normalization: replace WTF::Vector::last with ::back (Closed)
Patch Set: rebase Created 4 years, 1 month 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/css/CSSGradientValue.cpp
diff --git a/third_party/WebKit/Source/core/css/CSSGradientValue.cpp b/third_party/WebKit/Source/core/css/CSSGradientValue.cpp
index 1803ec9c717255ae42c9efba22dac904c0fcfafd..3c4e013d764d93ba16166125bad7470bc75639ad 100644
--- a/third_party/WebKit/Source/core/css/CSSGradientValue.cpp
+++ b/third_party/WebKit/Source/core/css/CSSGradientValue.cpp
@@ -257,7 +257,7 @@ static bool requiresStopsNormalization(const Vector<GradientStop>& stops,
return true;
// Degenerate stops
- if (stops.first().offset < 0 || stops.last().offset > 1)
+ if (stops.first().offset < 0 || stops.back().offset > 1)
return true;
return false;
@@ -270,7 +270,7 @@ static bool normalizeAndAddStops(const Vector<GradientStop>& stops,
ASSERT(stops.size() > 1);
const float firstOffset = stops.first().offset;
- const float lastOffset = stops.last().offset;
+ const float lastOffset = stops.back().offset;
const float span = lastOffset - firstOffset;
if (fabs(span) < std::numeric_limits<float>::epsilon()) {
@@ -283,7 +283,7 @@ static bool normalizeAndAddStops(const Vector<GradientStop>& stops,
// be significant (padding on both sides of the offset).
if (gradient->spreadMethod() != SpreadMethodRepeat)
gradient->addColorStop(clampedOffset, stops.first().color);
- gradient->addColorStop(clampedOffset, stops.last().color);
+ gradient->addColorStop(clampedOffset, stops.back().color);
return false;
}
@@ -461,7 +461,7 @@ void CSSGradientValue::addStops(Gradient* gradient,
}
}
- ASSERT(stops.first().specified && stops.last().specified);
+ ASSERT(stops.first().specified && stops.back().specified);
// If any color-stop still does not have a position, then, for each run of
// adjacent color-stops without positions, set their positions so that they
@@ -511,10 +511,10 @@ void CSSGradientValue::addStops(Gradient* gradient,
if (normalizeAndAddStops(stops, gradient)) {
if (isLinearGradientValue()) {
adjustGradientPointsForOffsetRange(gradient, stops.first().offset,
- stops.last().offset);
+ stops.back().offset);
} else {
adjustGradientRadiiForOffsetRange(gradient, stops.first().offset,
- stops.last().offset);
+ stops.back().offset);
}
} else {
// Normalization failed because the stop set is coincident.
« no previous file with comments | « third_party/WebKit/Source/core/animation/css/CSSAnimations.cpp ('k') | third_party/WebKit/Source/core/css/SelectorFilter.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698