PassRefPtr<AnimatableValue> CSSAnimatableValueFactory::createFromColor(CSSPropertyID property, const RenderStyle& style)
{
    Color color = style.colorIncludingFallback(property, false);
    Color visitedLinkColor = style.colorIncludingFallback(property, true);
    Color fallbackColor = style.color();
    Color fallbackVisitedLinkColor = style.visitedLinkColor();
    Color resolvedColor;
    if (color.isValid())
        resolvedColor = color;
    else
        resolvedColor = fallbackColor;
    Color resolvedVisitedLinkColor;
    if (visitedLinkColor.isValid())
        resolvedVisitedLinkColor = visitedLinkColor;
    else
        resolvedVisitedLinkColor = fallbackVisitedLinkColor;
    return AnimatableColor::create(resolvedColor, resolvedVisitedLinkColor);
}
示例#2
0
PassRefPtr<AnimatableValue> CSSAnimatableValueFactory::createFromColor(CSSPropertyID property, const RenderStyle& style)
{
    Color color = style.colorIncludingFallback(property);
    return AnimatableColor::create(color);
}
PassRefPtrWillBeRawPtr<AnimatableValue> CSSAnimatableValueFactory::createFromColor(CSSPropertyID property, const RenderStyle& style)
{
    Color color = style.colorIncludingFallback(property, false);
    Color visitedLinkColor = style.colorIncludingFallback(property, true);
    return AnimatableColor::create(color, visitedLinkColor);
}