Exemplo n.º 1
0
Color TextLinkColors::colorFromPrimitiveValue(const CSSPrimitiveValue* value, Color currentColor, bool forVisitedLink) const
{
    if (value->isRGBColor())
        return Color(value->getRGBA32Value());

    CSSValueID valueID = value->getValueID();
    switch (valueID) {
    case 0:
        return Color();
    case CSSValueWebkitText:
        return textColor();
    case CSSValueWebkitLink:
        return forVisitedLink ? visitedLinkColor() : linkColor();
    case CSSValueWebkitActivelink:
        return activeLinkColor();
    case CSSValueWebkitFocusRingColor:
        return RenderTheme::focusRingColor();
    case CSSValueCurrentcolor:
        return currentColor;
    default:
        return colorForCSSValue(valueID);
    }
}
Exemplo n.º 2
0
Color StyleResolverState::colorFromPrimitiveValue(CSSPrimitiveValue* value, bool forVisitedLink) const
{
    if (value->isRGBColor())
        return Color(value->getRGBA32Value());

    int ident = value->getIdent();
    switch (ident) {
    case 0:
        return Color();
    case CSSValueWebkitText:
        return document()->textColor();
    case CSSValueWebkitLink:
        return (element()->isLink() && forVisitedLink) ? document()->visitedLinkColor() : document()->linkColor();
    case CSSValueWebkitActivelink:
        return document()->activeLinkColor();
    case CSSValueWebkitFocusRingColor:
        return RenderTheme::focusRingColor();
    case CSSValueCurrentcolor:
        return style()->color();
    default:
        return colorForCSSValue(ident);
    }
}