gecko-dev/layout/style/nsCSSKeywords.cpp

453 строки
13 KiB
C++

/*
** This is a generated file, do not edit it. This file is created by
** genhash.pl
*/
#include "plstr.h"
#include "nsCSSKeywords.h"
#define TOTAL_KEYWORDS 104
#define MIN_WORD_LENGTH 2
#define MAX_WORD_LENGTH 18
#define MIN_HASH_VALUE 12
#define MAX_HASH_VALUE 437
/* maximum key range = 426, duplicates = 0 */
struct StaticNameTable {
char* tag;
PRInt32 id;
};
static const unsigned char kLowerLookup[256] = {
0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,
16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,
32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,
48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,
64,
97,98,99,100,101,102,103,104,105,106,107,108,109,
110,111,112,113,114,115,116,117,118,119,120,121,122,
91, 92, 93, 94, 95, 96, 97, 98, 99,100,101,102,103,104,105,106,107,108,109,110,111,
112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,
128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,
144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,
160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,
176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,
192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,
208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,
224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239,
240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255
};
#define MYLOWER(x) kLowerLookup[((x) & 0x7f)]
/**
* Map a name to an ID or -1
*/
PRInt32 nsCSSKeywords::LookupName(const char* str)
{
static unsigned short asso_values[] =
{
438, 438, 438, 438, 438, 438, 438, 438, 438, 438,
438, 438, 438, 438, 438, 438, 438, 438, 438, 438,
438, 438, 438, 438, 438, 438, 438, 438, 438, 438,
438, 438, 438, 438, 438, 438, 438, 438, 438, 438,
438, 438, 438, 438, 438, 5, 438, 438, 438, 438,
438, 438, 438, 438, 438, 438, 438, 438, 438, 438,
438, 438, 438, 438, 438, 438, 438, 438, 438, 438,
438, 438, 438, 438, 438, 438, 438, 438, 438, 438,
438, 438, 438, 438, 438, 438, 438, 438, 438, 438,
438, 438, 438, 438, 438, 438, 438, 40, 103, 125,
57, 0, 25, 35, 75, 110, 10, 15, 124, 30,
5, 0, 25, 0, 0, 5, 0, 122, 10, 110,
5, 10, 438, 438, 438, 438, 438, 438,
};
static unsigned char lengthtable[] =
{
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0,
4, 0, 0, 7, 0, 9, 0, 0, 0, 8, 0, 0, 0, 2,
3, 0, 0, 6, 0, 0, 0, 0, 0, 2, 8, 0, 0, 6,
0, 8, 0, 0, 11, 0, 8, 0, 0, 0, 0, 3, 0, 0,
0, 0, 8, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 6, 0, 0, 0, 0, 0, 7, 0,
0, 0, 0, 0, 0, 0, 0, 11, 2, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 6, 0, 2, 6, 0, 5,
6, 3, 6, 7, 0, 0, 7, 6, 0, 6, 6, 0, 6, 6,
0, 7, 8, 0, 0, 0, 6, 0, 5, 0, 5, 0, 0, 4,
0, 5, 8, 5, 0, 0, 0, 8, 7, 0, 7, 6, 4, 0,
0, 5, 6, 0, 5, 0, 0, 0, 6, 0, 0, 0, 0, 4,
4, 15, 0, 6, 0, 2, 11, 9, 0, 5, 0, 0, 4, 0,
0, 7, 0, 0, 0, 0, 5, 6, 5, 5, 0, 0, 0, 0,
0, 18, 0, 0, 0, 10, 0, 0, 0, 0, 0, 9, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 7, 0, 0, 0,
0, 0, 0, 6, 0, 0, 0, 6, 0, 5, 5, 0, 11, 3,
0, 6, 0, 0, 12, 0, 0, 0, 6, 18, 9, 11, 0, 0,
0, 0, 0, 0, 7, 8, 0, 0, 0, 0, 7, 2, 9, 0,
0, 6, 0, 9, 0, 12, 13, 0, 4, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 4, 0, 9, 0, 0, 0, 0,
0, 0, 0, 18, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 10, 11, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 5, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 12, 10, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 7,
};
static struct StaticNameTable wordlist[] =
{
{"",}, {"",}, {"",}, {"",}, {"",}, {"",}, {"",}, {"",}, {"",},
{"",}, {"",}, {"",},
{"ex", 21},
{"",},
{"none", 50},
{"",}, {"",},
{"noshade", 52},
{"",},
{"no-repeat", 49},
{"",}, {"",}, {"",},
{"overline", 57},
{"",}, {"",}, {"",},
{"pt", 61},
{"pre", 60},
{"",}, {"",},
{"repeat", 64},
{"",}, {"",}, {"",}, {"",}, {"",},
{"px", 62},
{"text-top", 90},
{"",}, {"",},
{"groove", 23},
{"",},
{"repeat-x", 65},
{"",}, {"",},
{"text-bottom", 89},
{"",},
{"repeat-y", 66},
{"",}, {"",}, {"",}, {"",},
{"top", 93},
{"",}, {"",}, {"",}, {"",},
{"xx-large", 102},
{"",}, {"",}, {"",},
{"em", 20},
{"",}, {"",}, {"",}, {"",}, {"",}, {"",}, {"",}, {"",}, {"",},
{"",}, {"",}, {"",}, {"",},
{"marker", 45},
{"",}, {"",}, {"",}, {"",}, {"",},
{"smaller", 74},
{"",}, {"",}, {"",}, {"",}, {"",}, {"",}, {"",}, {"",},
{"transparent", 94},
{"mm", 48},
{"",}, {"",}, {"",}, {"",}, {"",}, {"",}, {"",}, {"",}, {"",},
{"",}, {"",}, {"",}, {"",}, {"",}, {"",}, {"",}, {"",}, {"",},
{"",}, {"",}, {"",}, {"",}, {"",}, {"",}, {"",}, {"",}, {"",},
{"dotted", 18},
{"",},
{"in", 27},
{"medium", 46},
{"",},
{"inset", 31},
{"inside", 32},
{"ltr", 44},
{"outset", 55},
{"outside", 56},
{"",}, {"",},
{"visible", 99},
{"square", 76},
{"",},
{"normal", 51},
{"center", 11},
{"",},
{"run-in", 70},
{"bottom", 9},
{"",},
{"x-large", 100},
{"relative", 63},
{"",}, {"",}, {"",},
{"nowrap", 53},
{"",},
{"table", 80},
{"",},
{"right", 68},
{"",}, {"",},
{"left", 37},
{"",},
{"arrow", 1},
{"absolute", 0},
{"super", 79},
{"",}, {"",}, {"",},
{"baseline", 3},
{"compact", 14},
{"",},
{"justify", 34},
{"dashed", 15},
{"auto", 2},
{"",}, {"",},
{"large", 35},
{"larger", 36},
{"",},
{"ridge", 67},
{"",}, {"",}, {"",},
{"static", 77},
{"",}, {"",}, {"",}, {"",},
{"hand", 24},
{"both", 8},
{"table-row-group", 88},
{"",},
{"double", 19},
{"",},
{"cm", 13},
{"upper-roman", 97},
{"paragraph", 58},
{"",},
{"solid", 75},
{"",}, {"",},
{"thin", 92},
{"",}, {"",},
{"inherit", 28},
{"",}, {"",}, {"",}, {"",},
{"fixed", 22},
{"middle", 47},
{"small", 72},
{"thick", 91},
{"",}, {"",}, {"",}, {"",}, {"",},
{"table-footer-group", 85},
{"",}, {"",}, {"",},
{"small-caps", 73},
{"",}, {"",}, {"",}, {"",}, {"",},
{"uppercase", 98},
{"",}, {"",}, {"",}, {"",}, {"",}, {"",}, {"",}, {"",}, {"",},
{"",}, {"",},
{"bolder", 7},
{"oblique", 54},
{"",}, {"",}, {"",}, {"",}, {"",}, {"",},
{"circle", 12},
{"",}, {"",}, {"",},
{"inline", 29},
{"",},
{"block", 5},
{"ibeam", 26},
{"",},
{"lower-roman", 42},
{"rtl", 69},
{"",},
{"hidden", 25},
{"",}, {"",},
{"inline-table", 30},
{"",}, {"",}, {"",},
{"scroll", 71},
{"table-header-group", 86},
{"table-row", 87},
{"upper-alpha", 96},
{"",}, {"",}, {"",}, {"",}, {"",}, {"",},
{"x-small", 101},
{"xx-small", 103},
{"",}, {"",}, {"",}, {"",},
{"lighter", 38},
{"pc", 59},
{"list-item", 40},
{"",}, {"",},
{"italic", 33},
{"",},
{"lowercase", 43},
{"",},
{"table-column", 83},
{"table-caption", 81},
{"",},
{"bold", 6},
{"",}, {"",}, {"",}, {"",}, {"",}, {"",}, {"",}, {"",}, {"",},
{"",}, {"",}, {"",},
{"disc", 17},
{"",},
{"underline", 95},
{"",}, {"",}, {"",}, {"",}, {"",}, {"",}, {"",},
{"table-column-group", 84},
{"",}, {"",}, {"",}, {"",}, {"",}, {"",}, {"",}, {"",}, {"",},
{"",}, {"",}, {"",},
{"capitalize", 10},
{"lower-alpha", 41},
{"",}, {"",}, {"",}, {"",}, {"",}, {"",}, {"",}, {"",}, {"",},
{"",},
{"sub", 78},
{"",}, {"",}, {"",}, {"",}, {"",}, {"",}, {"",}, {"",}, {"",},
{"",}, {"",}, {"",}, {"",}, {"",}, {"",}, {"",}, {"",}, {"",},
{"",}, {"",},
{"blink", 4},
{"",}, {"",}, {"",}, {"",}, {"",}, {"",}, {"",}, {"",}, {"",},
{"",}, {"",}, {"",}, {"",}, {"",}, {"",}, {"",}, {"",}, {"",},
{"",}, {"",}, {"",}, {"",}, {"",}, {"",}, {"",}, {"",}, {"",},
{"",}, {"",}, {"",}, {"",}, {"",}, {"",}, {"",}, {"",}, {"",},
{"",}, {"",}, {"",}, {"",}, {"",}, {"",}, {"",},
{"line-through", 39},
{"table-cell", 82},
{"",}, {"",}, {"",}, {"",}, {"",}, {"",}, {"",}, {"",}, {"",},
{"",}, {"",}, {"",}, {"",}, {"",}, {"",}, {"",}, {"",}, {"",},
{"",}, {"",}, {"",}, {"",}, {"",}, {"",}, {"",}, {"",}, {"",},
{"",}, {"",}, {"",}, {"",}, {"",}, {"",}, {"",},
{"decimal", 16},
};
if (str != NULL) {
int len = PL_strlen(str);
if (len <= MAX_WORD_LENGTH && len >= MIN_WORD_LENGTH) {
register int hval = len;
switch (hval)
{
default:
case 7:
hval += asso_values[MYLOWER(str[6])];
case 6:
case 5:
case 4:
case 3:
hval += asso_values[MYLOWER(str[2])];
case 2:
hval += asso_values[MYLOWER(str[1])];
case 1:
hval += asso_values[MYLOWER(str[0])];
break;
}
hval += asso_values[MYLOWER(str[len - 1])];
if (hval <= MAX_HASH_VALUE && hval >= MIN_HASH_VALUE) {
if (len == lengthtable[hval]) {
register const char *tag = wordlist[hval].tag;
/*
** While not at the end of the string, if they ever differ
** they are not equal. We know "tag" is already lower case.
*/
while ((*tag != '\0')&&(*str != '\0')) {
if (*tag != (char) MYLOWER(*str)) {
return -1;
}
tag++;
str++;
}
/*
** One of the strings has ended, if they are both ended, then they
** are equal, otherwise not.
*/
if ((*tag == '\0')&&(*str == '\0')) {
return wordlist[hval].id;
}
}
}
}
}
return -1;
}
const nsCSSKeywords::NameTableEntry nsCSSKeywords::kNameTable[] = {
{ "absolute", 0 },
{ "arrow", 1 },
{ "auto", 2 },
{ "baseline", 3 },
{ "blink", 4 },
{ "block", 5 },
{ "bold", 6 },
{ "bolder", 7 },
{ "both", 8 },
{ "bottom", 9 },
{ "capitalize", 10 },
{ "center", 11 },
{ "circle", 12 },
{ "cm", 13 },
{ "compact", 14 },
{ "dashed", 15 },
{ "decimal", 16 },
{ "disc", 17 },
{ "dotted", 18 },
{ "double", 19 },
{ "em", 20 },
{ "ex", 21 },
{ "fixed", 22 },
{ "groove", 23 },
{ "hand", 24 },
{ "hidden", 25 },
{ "ibeam", 26 },
{ "in", 27 },
{ "inherit", 28 },
{ "inline", 29 },
{ "inline-table", 30 },
{ "inset", 31 },
{ "inside", 32 },
{ "italic", 33 },
{ "justify", 34 },
{ "large", 35 },
{ "larger", 36 },
{ "left", 37 },
{ "lighter", 38 },
{ "line-through", 39 },
{ "list-item", 40 },
{ "lower-alpha", 41 },
{ "lower-roman", 42 },
{ "lowercase", 43 },
{ "ltr", 44 },
{ "marker", 45 },
{ "medium", 46 },
{ "middle", 47 },
{ "mm", 48 },
{ "no-repeat", 49 },
{ "none", 50 },
{ "normal", 51 },
{ "noshade", 52 },
{ "nowrap", 53 },
{ "oblique", 54 },
{ "outset", 55 },
{ "outside", 56 },
{ "overline", 57 },
{ "paragraph", 58 },
{ "pc", 59 },
{ "pre", 60 },
{ "pt", 61 },
{ "px", 62 },
{ "relative", 63 },
{ "repeat", 64 },
{ "repeat-x", 65 },
{ "repeat-y", 66 },
{ "ridge", 67 },
{ "right", 68 },
{ "rtl", 69 },
{ "run-in", 70 },
{ "scroll", 71 },
{ "small", 72 },
{ "small-caps", 73 },
{ "smaller", 74 },
{ "solid", 75 },
{ "square", 76 },
{ "static", 77 },
{ "sub", 78 },
{ "super", 79 },
{ "table", 80 },
{ "table-caption", 81 },
{ "table-cell", 82 },
{ "table-column", 83 },
{ "table-column-group", 84 },
{ "table-footer-group", 85 },
{ "table-header-group", 86 },
{ "table-row", 87 },
{ "table-row-group", 88 },
{ "text-bottom", 89 },
{ "text-top", 90 },
{ "thick", 91 },
{ "thin", 92 },
{ "top", 93 },
{ "transparent", 94 },
{ "underline", 95 },
{ "upper-alpha", 96 },
{ "upper-roman", 97 },
{ "uppercase", 98 },
{ "visible", 99 },
{ "x-large", 100 },
{ "x-small", 101 },
{ "xx-large", 102 },
{ "xx-small", 103 },
};