7#include "core/fxcrt/css/cfx_cssdata.h"
12#include "core/fxcrt/css/cfx_cssstyleselector.h"
13#include "core/fxcrt/css/cfx_cssvaluelistparser.h"
14#include "core/fxcrt/fx_codepage.h"
15#include "core/fxcrt/fx_extension.h"
20#define CSS_PROP____(a, b, c, d) {CFX_CSSProperty::a, c, d},
22#include "core/fxcrt/css/properties.inc"
26#undef CSS_PROP_VALUE____
27#define CSS_PROP_VALUE____(a, b, c) {CFX_CSSPropertyValue::a, c},
29#include "core/fxcrt/css/property_values.inc"
31#undef CSS_PROP_VALUE____
46 {L"aqua", 0xff00ffff}, {L"black", 0xff000000}, {L"blue", 0xff0000ff},
47 {L"fuchsia", 0xffff00ff}, {L"gray", 0xff808080}, {L"green", 0xff008000},
48 {L"grey", 0xff808080}, {L"lime", 0xff00ff00}, {L"maroon", 0xff800000},
49 {L"navy", 0xff000080}, {L"olive", 0xff808000}, {L"orange", 0xffffa500},
50 {L"purple", 0xff800080}, {L"red", 0xffff0000}, {L"silver", 0xffc0c0c0},
51 {L"teal", 0xff008080}, {L"white", 0xffffffff}, {L"yellow", 0xffffff00},
57 WideStringView name) {
61 uint32_t hash = FX_HashCode_GetLoweredW(name);
62 auto* result =
std::lower_bound(
63 std::begin(kPropertyTable),
std::end(kPropertyTable), hash,
68 if (result !=
std::end(kPropertyTable) && result->dwHash == hash) {
76 return &kPropertyTable[
static_cast<uint8_t>(property)];
80 WideStringView wsName) {
84 uint32_t hash = FX_HashCode_GetLoweredW(wsName);
85 auto* result =
std::lower_bound(
86 std::begin(kPropertyValueTable),
std::end(kPropertyValueTable), hash,
91 if (result !=
std::end(kPropertyValueTable) && result->dwHash == hash) {
98 WideStringView wsName) {
99 if (wsName.IsEmpty() || wsName.GetLength() != 2)
102 WideString lowerName = WideString(wsName);
105 for (
auto* iter =
std::begin(kLengthUnitTable);
106 iter !=
std::end(kLengthUnitTable); ++iter) {
107 if (lowerName == iter->value)
115 if (wsName.IsEmpty())
118 WideString lowerName = WideString(wsName);
121 for (
auto* iter =
std::begin(kColorTable); iter !=
std::end(kColorTable);
123 if (lowerName == iter->name)
static const Property * GetPropertyByEnum(CFX_CSSProperty property)
static const Color * GetColorByName(WideStringView wsName)
static const LengthUnit * GetLengthUnitByName(WideStringView wsName)
static const Property * GetPropertyByName(WideStringView name)
static const PropertyValue * GetPropertyValueByName(WideStringView wsName)