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

Unified Diff: Source/core/css/resolver/StyleBuilderCustom.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/resolver/StyleBuilderCustom.cpp
diff --git a/Source/core/css/resolver/StyleBuilderCustom.cpp b/Source/core/css/resolver/StyleBuilderCustom.cpp
index a9575e5cea114305480848b1ee38676715140cc6..26562a980ddfead8ccda6b0904cee385315489b9 100644
--- a/Source/core/css/resolver/StyleBuilderCustom.cpp
+++ b/Source/core/css/resolver/StyleBuilderCustom.cpp
@@ -1009,11 +1009,11 @@ static bool degreeToGlyphOrientation(CSSPrimitiveValue* primitiveValue, EGlyphOr
return true;
}
-static Color colorFromSVGColorCSSValue(SVGColor* svgColor, const Color& fgColor)
+static Color colorFromSVGColorCSSValue(SVGColor* svgColor, const StyleColor& fgColor)
{
Color color;
if (svgColor->colorType() == SVGColor::SVG_COLORTYPE_CURRENTCOLOR)
- color = fgColor;
+ color = fgColor.color();
else
color = svgColor->color();
return color;
@@ -1079,7 +1079,7 @@ void StyleBuilder::oldApplyProperty(CSSPropertyID id, StyleResolver* styleResolv
CSSValue* item = i.value();
if (item->isImageGeneratorValue()) {
if (item->isGradientValue())
- state.style()->setContent(StyleGeneratedImage::create(static_cast<CSSGradientValue*>(item)->gradientWithStylesResolved(state.document()->textLinkColors(), state.style()->color()).get()), didSet);
+ state.style()->setContent(StyleGeneratedImage::create(static_cast<CSSGradientValue*>(item)->gradientWithStylesResolved(state.document()->textLinkColors()).get()), didSet);
else
state.style()->setContent(StyleGeneratedImage::create(static_cast<CSSImageGeneratorValue*>(item)), didSet);
didSet = true;
@@ -1259,9 +1259,9 @@ void StyleBuilder::oldApplyProperty(CSSPropertyID id, StyleResolver* styleResolv
int blur = item->blur ? item->blur->computeLength<int>(state.style(), state.rootElementStyle(), zoomFactor) : 0;
int spread = item->spread ? item->spread->computeLength<int>(state.style(), state.rootElementStyle(), zoomFactor) : 0;
ShadowStyle shadowStyle = item->style && item->style->getValueID() == CSSValueInset ? Inset : Normal;
- Color color;
+ StyleColor color;
if (item->color)
- color = state.document()->textLinkColors().colorFromPrimitiveValue(item->color.get(), state.style()->visitedDependentColor(CSSPropertyColor));
+ color = state.document()->textLinkColors().colorFromPrimitiveValue(item->color.get());
else if (state.style())
color = state.style()->color();
@@ -1379,7 +1379,7 @@ void StyleBuilder::oldApplyProperty(CSSPropertyID id, StyleResolver* styleResolv
if (!primitiveValue)
break;
- Color col = state.document()->textLinkColors().colorFromPrimitiveValue(primitiveValue, state.style()->visitedDependentColor(CSSPropertyColor));
+ StyleColor col = state.document()->textLinkColors().colorFromPrimitiveValue(primitiveValue);
state.style()->setTapHighlightColor(col);
return;
}
@@ -2190,9 +2190,9 @@ void StyleBuilder::oldApplyProperty(CSSPropertyID id, StyleResolver* styleResolv
IntPoint location(item->x->computeLength<int>(state.style(), state.rootElementStyle()),
item->y->computeLength<int>(state.style(), state.rootElementStyle()));
int blur = item->blur ? item->blur->computeLength<int>(state.style(), state.rootElementStyle()) : 0;
- Color color;
+ StyleColor color;
if (item->color)
- color = state.document()->textLinkColors().colorFromPrimitiveValue(item->color.get(), state.style()->visitedDependentColor(CSSPropertyColor));
+ color = state.document()->textLinkColors().colorFromPrimitiveValue(item->color.get());
// -webkit-svg-shadow does should not have a spread or style
ASSERT(!item->spread);

Powered by Google App Engine
This is Rietveld 408576698