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

Unified Diff: Source/core/css/resolver/StyleBuilderCustom.cpp

Issue 23581008: Revert r154797: "Move isValid/isCurrentColor from Color to StyleColor" (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years, 3 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 a791d57dbbe3a461983def5daf0accfe54a52284..ae08e92539e3411be26334ad86102a66dd7ffe79 100644
--- a/Source/core/css/resolver/StyleBuilderCustom.cpp
+++ b/Source/core/css/resolver/StyleBuilderCustom.cpp
@@ -1095,11 +1095,11 @@ static bool degreeToGlyphOrientation(CSSPrimitiveValue* primitiveValue, EGlyphOr
return true;
}
-static Color colorFromSVGColorCSSValue(SVGColor* svgColor, const StyleColor& fgColor)
+static Color colorFromSVGColorCSSValue(SVGColor* svgColor, const Color& fgColor)
{
Color color;
if (svgColor->colorType() == SVGColor::SVG_COLORTYPE_CURRENTCOLOR)
- color = fgColor.color();
+ color = fgColor;
else
color = svgColor->color();
return color;
@@ -1266,6 +1266,10 @@ void StyleBuilder::applyProperty(CSSPropertyID id, StyleResolverState& state, CS
return;
}
+ CSSPrimitiveValue* primitiveValue = value->isPrimitiveValue() ? toCSSPrimitiveValue(value) : 0;
+ if (primitiveValue && primitiveValue->getValueID() == CSSValueCurrentcolor)
+ state.style()->setHasCurrentColor();
+
if (isInherit && !state.parentStyle()->hasExplicitlyInheritedProperties() && !CSSProperty::isInheritedProperty(id))
state.parentStyle()->setHasExplicitlyInheritedProperties();
@@ -1314,7 +1318,7 @@ void StyleBuilder::oldApplyProperty(CSSPropertyID id, StyleResolverState& state,
CSSValue* item = i.value();
if (item->isImageGeneratorValue()) {
if (item->isGradientValue())
- state.style()->setContent(StyleGeneratedImage::create(static_cast<CSSGradientValue*>(item)->gradientWithStylesResolved(state.document().textLinkColors()).get()), didSet);
+ state.style()->setContent(StyleGeneratedImage::create(static_cast<CSSGradientValue*>(item)->gradientWithStylesResolved(state.document().textLinkColors(), state.style()->color()).get()), didSet);
else
state.style()->setContent(StyleGeneratedImage::create(static_cast<CSSImageGeneratorValue*>(item)), didSet);
didSet = true;
@@ -1494,9 +1498,9 @@ void StyleBuilder::oldApplyProperty(CSSPropertyID id, StyleResolverState& state,
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;
- StyleColor color;
+ Color color;
if (item->color)
- color = state.document().textLinkColors().colorFromPrimitiveValue(item->color.get());
+ color = state.document().textLinkColors().colorFromPrimitiveValue(item->color.get(), state.style()->visitedDependentColor(CSSPropertyColor));
else if (state.style())
color = state.style()->color();
@@ -1614,7 +1618,7 @@ void StyleBuilder::oldApplyProperty(CSSPropertyID id, StyleResolverState& state,
if (!primitiveValue)
break;
- StyleColor col = state.document().textLinkColors().colorFromPrimitiveValue(primitiveValue);
+ Color col = state.document().textLinkColors().colorFromPrimitiveValue(primitiveValue, state.style()->visitedDependentColor(CSSPropertyColor));
state.style()->setTapHighlightColor(col);
return;
}

Powered by Google App Engine
This is Rietveld 408576698