gecko-dev/layout/style/nsCSSProps.cpp

366 строки
11 KiB
C++
Исходник Обычный вид История

1998-04-14 00:24:54 +04:00
/*
** This is a generated file, do not edit it. This file is created by
** genhash.pl
*/
#include "plstr.h"
#include "nsCSSProps.h"
1998-05-28 05:11:30 +04:00
#define TOTAL_KEYWORDS 80
1998-04-14 00:24:54 +04:00
#define MIN_WORD_LENGTH 3
#define MAX_WORD_LENGTH 21
#define MIN_HASH_VALUE 6
1998-05-28 05:11:30 +04:00
#define MAX_HASH_VALUE 261
/* maximum key range = 256, duplicates = 0 */
1998-04-14 00:24:54 +04:00
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 nsCSSProps::LookupName(const char* str)
{
1998-05-28 05:11:30 +04:00
static unsigned short asso_values[] =
1998-04-14 00:24:54 +04:00
{
1998-05-28 05:11:30 +04:00
262, 262, 262, 262, 262, 262, 262, 262, 262, 262,
262, 262, 262, 262, 262, 262, 262, 262, 262, 262,
262, 262, 262, 262, 262, 262, 262, 262, 262, 262,
262, 262, 262, 262, 262, 262, 262, 262, 262, 262,
262, 262, 262, 262, 262, 65, 262, 262, 262, 262,
262, 262, 262, 262, 262, 262, 262, 262, 262, 262,
262, 262, 262, 262, 262, 262, 262, 262, 262, 262,
262, 262, 262, 262, 262, 262, 262, 262, 262, 262,
262, 262, 262, 262, 262, 262, 262, 262, 262, 262,
262, 262, 262, 262, 262, 262, 262, 45, 0, 85,
100, 25, 5, 0, 80, 0, 262, 262, 25, 90,
0, 0, 5, 262, 0, 65, 40, 20, 0, 80,
10, 25, 5, 262, 262, 262, 262, 262,
1998-04-14 00:24:54 +04:00
};
static unsigned char lengthtable[] =
{
0, 0, 0, 0, 0, 0, 6, 0, 0, 0, 0, 6, 12, 8,
1998-05-28 05:11:30 +04:00
0, 10, 0, 0, 0, 19, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 10, 0, 0, 0, 0, 0, 0,
0, 0, 19, 0, 11, 0, 3, 4, 0, 11, 0, 0, 0, 0,
1998-04-24 23:55:53 +04:00
0, 7, 18, 0, 0, 0, 12, 0, 14, 0, 11, 17, 0, 19,
1998-05-28 05:11:30 +04:00
0, 0, 0, 0, 0, 5, 21, 7, 0, 0, 0, 0, 17, 18,
0, 0, 16, 0, 0, 0, 5, 21, 12, 0, 4, 0, 0, 12,
0, 19, 0, 16, 17, 13, 9, 10, 16, 17, 0, 0, 0, 6,
7, 8, 19, 5, 11, 0, 0, 4, 10, 0, 0, 0, 14, 10,
0, 0, 0, 0, 0, 16, 0, 0, 0, 0, 11, 0, 18, 0,
0, 6, 12, 0, 0, 0, 16, 0, 0, 9, 10, 21, 0, 0,
0, 10, 11, 12, 0, 0, 10, 0, 17, 8, 0, 5, 0, 12,
0, 0, 15, 0, 12, 0, 0, 0, 16, 7, 0, 0, 0, 0,
0, 13, 9, 0, 11, 0, 0, 0, 0, 6, 0, 0, 14, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 14,
0, 11, 0, 0, 0, 0, 0, 0, 0, 0, 15, 0, 0, 0,
0, 0, 0, 12, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
13, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 11,
1998-04-14 00:24:54 +04:00
};
static struct StaticNameTable wordlist[] =
{
{"",}, {"",}, {"",}, {"",}, {"",}, {"",},
{"border", 9},
{"",}, {"",}, {"",}, {"",},
1998-04-24 23:55:53 +04:00
{"filter", 40},
1998-04-14 00:24:54 +04:00
{"border-color", 14},
1998-05-28 05:11:30 +04:00
{"position", 68},
1998-04-14 00:24:54 +04:00
{"",},
{"border-top", 24},
{"",}, {"",}, {"",},
{"border-bottom-color", 11},
{"",}, {"",}, {"",}, {"",}, {"",}, {"",}, {"",}, {"",}, {"",},
1998-05-28 05:11:30 +04:00
{"",}, {"",}, {"",}, {"",}, {"",}, {"",},
{"visibility", 75},
{"",}, {"",}, {"",}, {"",}, {"",}, {"",}, {"",}, {"",},
{"border-bottom-style", 12},
1998-04-14 00:24:54 +04:00
{"",},
1998-04-24 23:55:53 +04:00
{"font-family", 43},
1998-05-28 05:11:30 +04:00
{"",},
{"top", 73},
1998-04-24 23:55:53 +04:00
{"font", 42},
1998-04-14 00:24:54 +04:00
{"",},
{"border-left", 15},
1998-05-28 05:11:30 +04:00
{"",}, {"",}, {"",}, {"",}, {"",},
{"padding", 63},
1998-04-14 00:24:54 +04:00
{"border-right-color", 20},
{"",}, {"",}, {"",},
{"border-style", 23},
1998-04-24 23:55:53 +04:00
{"",},
{"letter-spacing", 50},
{"",},
1998-05-28 05:11:30 +04:00
{"padding-top", 67},
1998-04-14 00:24:54 +04:00
{"background-filter", 3},
{"",},
{"background-position", 5},
1998-04-24 23:55:53 +04:00
{"",}, {"",}, {"",}, {"",}, {"",},
{"float", 41},
1998-04-14 00:24:54 +04:00
{"background-x-position", 6},
1998-05-28 05:11:30 +04:00
{"opacity", 61},
{"",}, {"",}, {"",}, {"",},
{"border-left-color", 16},
1998-04-14 00:24:54 +04:00
{"border-right-style", 21},
1998-04-24 23:55:53 +04:00
{"",}, {"",},
1998-04-14 00:24:54 +04:00
{"background-image", 4},
1998-04-24 23:55:53 +04:00
{"",}, {"",}, {"",},
1998-04-14 00:24:54 +04:00
{"color", 35},
1998-05-28 05:11:30 +04:00
{"background-y-position", 7},
1998-04-14 00:24:54 +04:00
{"border-right", 19},
{"",},
1998-04-24 23:55:53 +04:00
{"left", 49},
1998-04-14 00:24:54 +04:00
{"",}, {"",},
1998-04-24 23:55:53 +04:00
{"font-variant", 46},
{"",},
1998-04-14 00:24:54 +04:00
{"border-bottom-width", 13},
1998-04-24 23:55:53 +04:00
{"",},
1998-04-14 00:24:54 +04:00
{"border-top-color", 25},
{"background-repeat", 8},
1998-04-24 23:55:53 +04:00
{"border-bottom", 10},
{"font-size", 44},
{"font-style", 45},
1998-04-14 00:24:54 +04:00
{"border-top-style", 26},
1998-05-28 05:11:30 +04:00
{"border-left-style", 17},
{"",}, {"",}, {"",},
{"cursor", 36},
{"z-index", 79},
{"overflow", 62},
1998-04-24 23:55:53 +04:00
{"list-style-position", 54},
1998-04-14 00:24:54 +04:00
{"clear", 29},
1998-05-28 05:11:30 +04:00
{"text-indent", 71},
1998-04-14 00:24:54 +04:00
{"",}, {"",},
{"clip", 30},
1998-05-28 05:11:30 +04:00
{"text-align", 69},
1998-04-24 23:55:53 +04:00
{"",}, {"",}, {"",},
1998-05-28 05:11:30 +04:00
{"vertical-align", 74},
1998-04-24 23:55:53 +04:00
{"list-style", 52},
1998-05-28 05:11:30 +04:00
{"",}, {"",}, {"",}, {"",}, {"",},
1998-04-24 23:55:53 +04:00
{"list-style-image", 53},
1998-05-28 05:11:30 +04:00
{"",}, {"",}, {"",}, {"",},
1998-04-24 23:55:53 +04:00
{"font-weight", 47},
{"",},
1998-04-14 00:24:54 +04:00
{"border-right-width", 22},
1998-04-24 23:55:53 +04:00
{"",}, {"",},
{"margin", 56},
1998-05-28 05:11:30 +04:00
{"padding-left", 65},
1998-04-14 00:24:54 +04:00
{"",}, {"",}, {"",},
{"background-color", 2},
1998-04-24 23:55:53 +04:00
{"",}, {"",},
1998-05-28 05:11:30 +04:00
{"direction", 38},
1998-04-24 23:55:53 +04:00
{"margin-top", 60},
1998-04-14 00:24:54 +04:00
{"background-attachment", 1},
1998-05-28 05:11:30 +04:00
{"",}, {"",}, {"",},
{"background", 0},
1998-04-24 23:55:53 +04:00
{"line-height", 51},
1998-05-28 05:11:30 +04:00
{"word-spacing", 78},
1998-04-24 23:55:53 +04:00
{"",}, {"",},
1998-04-14 00:24:54 +04:00
{"clip-right", 33},
1998-05-28 05:11:30 +04:00
{"",},
{"border-left-width", 18},
1998-04-14 00:24:54 +04:00
{"clip-top", 34},
{"",},
1998-05-28 05:11:30 +04:00
{"width", 77},
{"",},
{"cursor-image", 37},
{"",}, {"",},
1998-04-24 23:55:53 +04:00
{"list-style-type", 55},
{"",},
1998-04-14 00:24:54 +04:00
{"border-width", 28},
1998-04-24 23:55:53 +04:00
{"",}, {"",}, {"",},
{"border-top-width", 27},
1998-05-28 05:11:30 +04:00
{"display", 39},
1998-04-24 23:55:53 +04:00
{"",}, {"",}, {"",}, {"",}, {"",},
1998-05-28 05:11:30 +04:00
{"padding-right", 66},
1998-04-14 00:24:54 +04:00
{"clip-left", 32},
1998-04-24 23:55:53 +04:00
{"",},
{"margin-left", 58},
{"",}, {"",}, {"",}, {"",},
{"height", 48},
1998-04-14 00:24:54 +04:00
{"",}, {"",},
1998-05-28 05:11:30 +04:00
{"padding-bottom", 64},
{"",}, {"",}, {"",}, {"",}, {"",}, {"",}, {"",}, {"",}, {"",},
1998-04-24 23:55:53 +04:00
{"",}, {"",}, {"",}, {"",}, {"",},
1998-05-28 05:11:30 +04:00
{"text-transform", 72},
1998-04-14 00:24:54 +04:00
{"",},
{"clip-bottom", 31},
1998-05-28 05:11:30 +04:00
{"",}, {"",}, {"",}, {"",}, {"",}, {"",}, {"",}, {"",},
{"text-decoration", 70},
1998-04-24 23:55:53 +04:00
{"",}, {"",}, {"",}, {"",}, {"",}, {"",},
{"margin-right", 59},
1998-05-28 05:11:30 +04:00
{"",}, {"",}, {"",}, {"",}, {"",}, {"",}, {"",}, {"",}, {"",},
{"",},
1998-04-24 23:55:53 +04:00
{"margin-bottom", 57},
1998-05-28 05:11:30 +04:00
{"",}, {"",}, {"",}, {"",}, {"",}, {"",}, {"",}, {"",}, {"",},
{"",}, {"",}, {"",}, {"",}, {"",}, {"",}, {"",}, {"",}, {"",},
{"",}, {"",}, {"",}, {"",},
{"white-space", 76},
1998-04-14 00:24:54 +04:00
};
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 12:
hval += asso_values[MYLOWER(str[11])];
case 11:
case 10:
case 9:
case 8:
case 7:
case 6:
hval += asso_values[MYLOWER(str[5])];
case 5:
case 4:
case 3:
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 nsCSSProps::NameTableEntry nsCSSProps::kNameTable[] = {
{ "background", 0 },
{ "background-attachment", 1 },
{ "background-color", 2 },
{ "background-filter", 3 },
{ "background-image", 4 },
{ "background-position", 5 },
{ "background-x-position", 6 },
{ "background-y-position", 7 },
{ "background-repeat", 8 },
{ "border", 9 },
{ "border-bottom", 10 },
{ "border-bottom-color", 11 },
{ "border-bottom-style", 12 },
{ "border-bottom-width", 13 },
{ "border-color", 14 },
{ "border-left", 15 },
{ "border-left-color", 16 },
{ "border-left-style", 17 },
{ "border-left-width", 18 },
{ "border-right", 19 },
{ "border-right-color", 20 },
{ "border-right-style", 21 },
{ "border-right-width", 22 },
{ "border-style", 23 },
{ "border-top", 24 },
{ "border-top-color", 25 },
{ "border-top-style", 26 },
{ "border-top-width", 27 },
{ "border-width", 28 },
{ "clear", 29 },
{ "clip", 30 },
{ "clip-bottom", 31 },
{ "clip-left", 32 },
{ "clip-right", 33 },
{ "clip-top", 34 },
{ "color", 35 },
1998-04-24 23:55:53 +04:00
{ "cursor", 36 },
{ "cursor-image", 37 },
{ "direction", 38 },
{ "display", 39 },
{ "filter", 40 },
{ "float", 41 },
{ "font", 42 },
{ "font-family", 43 },
{ "font-size", 44 },
{ "font-style", 45 },
{ "font-variant", 46 },
{ "font-weight", 47 },
{ "height", 48 },
{ "left", 49 },
{ "letter-spacing", 50 },
{ "line-height", 51 },
{ "list-style", 52 },
{ "list-style-image", 53 },
{ "list-style-position", 54 },
{ "list-style-type", 55 },
{ "margin", 56 },
{ "margin-bottom", 57 },
{ "margin-left", 58 },
{ "margin-right", 59 },
{ "margin-top", 60 },
1998-05-28 05:11:30 +04:00
{ "opacity", 61 },
{ "overflow", 62 },
{ "padding", 63 },
{ "padding-bottom", 64 },
{ "padding-left", 65 },
{ "padding-right", 66 },
{ "padding-top", 67 },
{ "position", 68 },
{ "text-align", 69 },
{ "text-decoration", 70 },
{ "text-indent", 71 },
{ "text-transform", 72 },
{ "top", 73 },
{ "vertical-align", 74 },
{ "visibility", 75 },
{ "white-space", 76 },
{ "width", 77 },
{ "word-spacing", 78 },
{ "z-index", 79 },
1998-04-14 00:24:54 +04:00
};