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

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

Issue 20061003: Move isValid/isCurrentColor from Color to StyleColor (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 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
Index: Source/core/css/CSSGradientValue.cpp
diff --git a/Source/core/css/CSSGradientValue.cpp b/Source/core/css/CSSGradientValue.cpp
index 7b4e7535d05eea0cd708998c8084377881564975..4f72ea96e99380d9c743d17d8fa35e4f08ee3527 100644
--- a/Source/core/css/CSSGradientValue.cpp
+++ b/Source/core/css/CSSGradientValue.cpp
@@ -105,7 +105,7 @@ struct GradientStop {
{ }
};
-PassRefPtr<CSSGradientValue> CSSGradientValue::gradientWithStylesResolved(const TextLinkColors& textLinkColors, Color currentColor)
+PassRefPtr<CSSGradientValue> CSSGradientValue::gradientWithStylesResolved(const TextLinkColors& textLinkColors)
{
bool derived = false;
for (unsigned i = 0; i < m_stops.size(); i++)
@@ -128,7 +128,7 @@ PassRefPtr<CSSGradientValue> CSSGradientValue::gradientWithStylesResolved(const
}
for (unsigned i = 0; i < result->m_stops.size(); i++)
- result->m_stops[i].m_resolvedColor = textLinkColors.colorFromPrimitiveValue(result->m_stops[i].m_color.get(), currentColor);
+ result->m_stops[i].m_resolvedColor = textLinkColors.colorFromPrimitiveValue(result->m_stops[i].m_color.get());
return result.release();
}
@@ -149,7 +149,7 @@ void CSSGradientValue::addStops(Gradient* gradient, RenderObject* renderer, Rend
else
offset = stop.m_position->getFloatValue(CSSPrimitiveValue::CSS_NUMBER);
- gradient->addColorStop(offset, stop.m_resolvedColor);
+ gradient->addColorStop(offset, renderer->resolveColor(stop.m_resolvedColor));
}
// The back end already sorted the stops.
@@ -174,7 +174,7 @@ void CSSGradientValue::addStops(Gradient* gradient, RenderObject* renderer, Rend
for (size_t i = 0; i < numStops; ++i) {
const CSSGradientColorStop& stop = m_stops[i];
- stops[i].color = stop.m_resolvedColor;
+ stops[i].color = renderer->resolveColor(stop.m_resolvedColor);
if (stop.m_position) {
if (stop.m_position->isPercentage())

Powered by Google App Engine
This is Rietveld 408576698