This source file includes following definitions.
- toCSSValueKeyword
- setNamedColors
#include "config.h"
#include "WebColorName.h"
#include "CSSValueKeywords.h"
#include "core/rendering/RenderTheme.h"
#include "platform/graphics/Color.h"
#include "public/platform/WebColor.h"
using namespace::WebCore;
namespace blink {
static int toCSSValueKeyword(WebColorName name)
{
switch (name) {
case WebColorActiveBorder:
return CSSValueActiveborder;
case WebColorActiveCaption:
return CSSValueActivecaption;
case WebColorAppworkspace:
return CSSValueAppworkspace;
case WebColorBackground:
return CSSValueBackground;
case WebColorButtonFace:
return CSSValueButtonface;
case WebColorButtonHighlight:
return CSSValueButtonhighlight;
case WebColorButtonShadow:
return CSSValueButtonshadow;
case WebColorButtonText:
return CSSValueButtontext;
case WebColorCaptionText:
return CSSValueCaptiontext;
case WebColorGrayText:
return CSSValueGraytext;
case WebColorHighlight:
return CSSValueHighlight;
case WebColorHighlightText:
return CSSValueHighlighttext;
case WebColorInactiveBorder:
return CSSValueInactiveborder;
case WebColorInactiveCaption:
return CSSValueInactivecaption;
case WebColorInactiveCaptionText:
return CSSValueInactivecaptiontext;
case WebColorInfoBackground:
return CSSValueInfobackground;
case WebColorInfoText:
return CSSValueInfotext;
case WebColorMenu:
return CSSValueMenu;
case WebColorMenuText:
return CSSValueMenutext;
case WebColorScrollbar:
return CSSValueScrollbar;
case WebColorText:
return CSSValueText;
case WebColorThreedDarkShadow:
return CSSValueThreeddarkshadow;
case WebColorThreedShadow:
return CSSValueThreedshadow;
case WebColorThreedFace:
return CSSValueThreedface;
case WebColorThreedHighlight:
return CSSValueThreedhighlight;
case WebColorThreedLightShadow:
return CSSValueThreedlightshadow;
case WebColorWebkitFocusRingColor:
return CSSValueWebkitFocusRingColor;
case WebColorWindow:
return CSSValueWindow;
case WebColorWindowFrame:
return CSSValueWindowframe;
case WebColorWindowText:
return CSSValueWindowtext;
default:
return CSSValueInvalid;
}
}
void setNamedColors(const WebColorName* colorNames, const WebColor* colors, size_t length)
{
for (size_t i = 0; i < length; ++i) {
WebColorName colorName = colorNames[i];
WebColor color = colors[i];
int internalColorName = toCSSValueKeyword(colorName);
if (internalColorName == CSSValueWebkitFocusRingColor) {
RenderTheme::theme().setCustomFocusRingColor(color);
continue;
}
}
}
}