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

Unified Diff: Source/core/dom/TextLinkColors.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/dom/TextLinkColors.cpp
diff --git a/Source/core/dom/TextLinkColors.cpp b/Source/core/dom/TextLinkColors.cpp
index f6e1fd8eb2430e41927029f78daec32e0d51571c..59589a5d22aeea18eab30b40fbe1ceb5f27a2eb4 100644
--- a/Source/core/dom/TextLinkColors.cpp
+++ b/Source/core/dom/TextLinkColors.cpp
@@ -44,17 +44,17 @@ TextLinkColors::TextLinkColors()
void TextLinkColors::resetLinkColor()
{
- m_linkColor = Color(0, 0, 238);
+ m_linkColor = StyleColor(0, 0, 238);
}
void TextLinkColors::resetVisitedLinkColor()
{
- m_visitedLinkColor = Color(85, 26, 139);
+ m_visitedLinkColor = StyleColor(85, 26, 139);
}
void TextLinkColors::resetActiveLinkColor()
{
- m_activeLinkColor.setNamedColor("red");
+ m_activeLinkColor = StyleColor(255, 0, 0);
}
static Color colorForCSSValue(CSSValueID cssValueId)
@@ -94,10 +94,10 @@ static Color colorForCSSValue(CSSValueID cssValueId)
return RenderTheme::defaultTheme()->systemColor(cssValueId);
}
-Color TextLinkColors::colorFromPrimitiveValue(const CSSPrimitiveValue* value, Color currentColor, bool forVisitedLink) const
+StyleColor TextLinkColors::colorFromPrimitiveValue(const CSSPrimitiveValue* value, bool forVisitedLink) const
{
if (value->isRGBColor())
- return Color(value->getRGBA32Value());
+ return StyleColor(value->getRGBA32Value());
CSSValueID valueID = value->getValueID();
switch (valueID) {
@@ -112,7 +112,7 @@ Color TextLinkColors::colorFromPrimitiveValue(const CSSPrimitiveValue* value, Co
case CSSValueWebkitFocusRingColor:
return RenderTheme::focusRingColor();
case CSSValueCurrentcolor:
- return currentColor;
+ return StyleColor::currentColor();
default:
return colorForCSSValue(valueID);
}

Powered by Google App Engine
This is Rietveld 408576698