| /* ANSI-C code produced by gperf version 2.7.2 */ |
| /* Command-line: gperf -a -L ANSI-C -E -C -c -o -t -k '*' -NfindProp -Hhash_prop -Wwordlist_prop -D -s 2 cssproperties.gperf */ |
| /* This file is automatically generated from cssproperties.in by makeprop, do not edit */ |
| /* Copyright 1999 W. Bastian */ |
| #include "cssproperties.h" |
| struct props { |
| const char *name; |
| int id; |
| }; |
| /* maximum key range = 742, duplicates = 0 */ |
| |
| #ifdef __GNUC__ |
| __inline |
| #else |
| #ifdef __cplusplus |
| inline |
| #endif |
| #endif |
| static unsigned int |
| hash_prop (register const char *str, register unsigned int len) |
| { |
| static const unsigned short asso_values[] = |
| { |
| 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, |
| 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, |
| 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, |
| 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, |
| 747, 747, 747, 747, 747, 0, 747, 747, 747, 747, |
| 747, 0, 747, 747, 747, 747, 747, 747, 747, 747, |
| 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, |
| 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, |
| 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, |
| 747, 747, 747, 747, 747, 747, 747, 10, 40, 0, |
| 0, 0, 30, 0, 15, 0, 5, 150, 0, 55, |
| 45, 0, 80, 5, 0, 145, 0, 5, 10, 135, |
| 205, 75, 0, 747, 747, 747, 747, 747, 747, 747, |
| 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, |
| 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, |
| 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, |
| 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, |
| 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, |
| 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, |
| 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, |
| 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, |
| 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, |
| 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, |
| 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, |
| 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, |
| 747, 747, 747, 747, 747, 747 |
| }; |
| register int hval = len; |
| |
| switch (hval) |
| { |
| default: |
| case 26: |
| hval += asso_values[(unsigned char)str[25]]; |
| case 25: |
| hval += asso_values[(unsigned char)str[24]]; |
| case 24: |
| hval += asso_values[(unsigned char)str[23]]; |
| case 23: |
| hval += asso_values[(unsigned char)str[22]]; |
| case 22: |
| hval += asso_values[(unsigned char)str[21]]; |
| case 21: |
| hval += asso_values[(unsigned char)str[20]]; |
| case 20: |
| hval += asso_values[(unsigned char)str[19]]; |
| case 19: |
| hval += asso_values[(unsigned char)str[18]]; |
| case 18: |
| hval += asso_values[(unsigned char)str[17]]; |
| case 17: |
| hval += asso_values[(unsigned char)str[16]]; |
| case 16: |
| hval += asso_values[(unsigned char)str[15]]; |
| case 15: |
| hval += asso_values[(unsigned char)str[14]]; |
| case 14: |
| hval += asso_values[(unsigned char)str[13]]; |
| case 13: |
| hval += asso_values[(unsigned char)str[12]]; |
| case 12: |
| hval += asso_values[(unsigned char)str[11]]; |
| case 11: |
| hval += asso_values[(unsigned char)str[10]]; |
| case 10: |
| hval += asso_values[(unsigned char)str[9]]; |
| case 9: |
| hval += asso_values[(unsigned char)str[8]]; |
| case 8: |
| hval += asso_values[(unsigned char)str[7]]; |
| case 7: |
| hval += asso_values[(unsigned char)str[6]]; |
| case 6: |
| hval += asso_values[(unsigned char)str[5]]; |
| case 5: |
| hval += asso_values[(unsigned char)str[4]]; |
| case 4: |
| hval += asso_values[(unsigned char)str[3]]; |
| case 3: |
| hval += asso_values[(unsigned char)str[2]]; |
| case 2: |
| hval += asso_values[(unsigned char)str[1]]; |
| case 1: |
| hval += asso_values[(unsigned char)str[0]]; |
| break; |
| } |
| return hval; |
| } |
| |
| #ifdef __GNUC__ |
| __inline |
| #endif |
| const struct props * |
| findProp (register const char *str, register unsigned int len) |
| { |
| enum |
| { |
| TOTAL_KEYWORDS = 112, |
| MIN_WORD_LENGTH = 3, |
| MAX_WORD_LENGTH = 26, |
| MIN_HASH_VALUE = 5, |
| MAX_HASH_VALUE = 746 |
| }; |
| |
| static const struct props wordlist_prop[] = |
| { |
| {"color", CSS_PROP_COLOR}, |
| {"clear", CSS_PROP_CLEAR}, |
| {"right", CSS_PROP_RIGHT}, |
| {"left", CSS_PROP_LEFT}, |
| {"height", CSS_PROP_HEIGHT}, |
| {"float", CSS_PROP_FLOAT}, |
| {"border", CSS_PROP_BORDER}, |
| {"border-color", CSS_PROP_BORDER_COLOR}, |
| {"direction", CSS_PROP_DIRECTION}, |
| {"outline", CSS_PROP_OUTLINE}, |
| {"outline-color", CSS_PROP_OUTLINE_COLOR}, |
| {"border-right", CSS_PROP_BORDER_RIGHT}, |
| {"border-right-color", CSS_PROP_BORDER_RIGHT_COLOR}, |
| {"font", CSS_PROP_FONT}, |
| {"border-left", CSS_PROP_BORDER_LEFT}, |
| {"top", CSS_PROP_TOP}, |
| {"clip", CSS_PROP_CLIP}, |
| {"line-height", CSS_PROP_LINE_HEIGHT}, |
| {"border-left-color", CSS_PROP_BORDER_LEFT_COLOR}, |
| {"vertical-align", CSS_PROP_VERTICAL_ALIGN}, |
| {"page", CSS_PROP_PAGE}, |
| {"content", CSS_PROP_CONTENT}, |
| {"bottom", CSS_PROP_BOTTOM}, |
| {"unicode-bidi", CSS_PROP_UNICODE_BIDI}, |
| {"margin", CSS_PROP_MARGIN}, |
| {"border-top", CSS_PROP_BORDER_TOP}, |
| {"border-top-color", CSS_PROP_BORDER_TOP_COLOR}, |
| {"margin-right", CSS_PROP_MARGIN_RIGHT}, |
| {"min-height", CSS_PROP_MIN_HEIGHT}, |
| {"padding", CSS_PROP_PADDING}, |
| {"border-bottom", CSS_PROP_BORDER_BOTTOM}, |
| {"size", CSS_PROP_SIZE}, |
| {"margin-left", CSS_PROP_MARGIN_LEFT}, |
| {"table-layout", CSS_PROP_TABLE_LAYOUT}, |
| {"border-bottom-color", CSS_PROP_BORDER_BOTTOM_COLOR}, |
| {"width", CSS_PROP_WIDTH}, |
| {"cursor", CSS_PROP_CURSOR}, |
| {"quotes", CSS_PROP_QUOTES}, |
| {"font-variant", CSS_PROP_FONT_VARIANT}, |
| {"padding-right", CSS_PROP_PADDING_RIGHT}, |
| {"padding-left", CSS_PROP_PADDING_LEFT}, |
| {"overflow", CSS_PROP_OVERFLOW}, |
| {"margin-top", CSS_PROP_MARGIN_TOP}, |
| {"border-width", CSS_PROP_BORDER_WIDTH}, |
| {"counter-reset", CSS_PROP_COUNTER_RESET}, |
| {"counter-increment", CSS_PROP_COUNTER_INCREMENT}, |
| {"outline-width", CSS_PROP_OUTLINE_WIDTH}, |
| {"margin-bottom", CSS_PROP_MARGIN_BOTTOM}, |
| {"border-right-width", CSS_PROP_BORDER_RIGHT_WIDTH}, |
| {"padding-top", CSS_PROP_PADDING_TOP}, |
| {"font-size", CSS_PROP_FONT_SIZE}, |
| {"scrollbar-3dlight-color", CSS_PROP_SCROLLBAR_3DLIGHT_COLOR}, |
| {"font-weight", CSS_PROP_FONT_WEIGHT}, |
| {"border-left-width", CSS_PROP_BORDER_LEFT_WIDTH}, |
| {"padding-bottom", CSS_PROP_PADDING_BOTTOM}, |
| {"font-stretch", CSS_PROP_FONT_STRETCH}, |
| {"scrollbar-face-color", CSS_PROP_SCROLLBAR_FACE_COLOR}, |
| {"font-family", CSS_PROP_FONT_FAMILY}, |
| {"z-index", CSS_PROP_Z_INDEX}, |
| {"min-width", CSS_PROP_MIN_WIDTH}, |
| {"background", CSS_PROP_BACKGROUND}, |
| {"scrollbar-highlight-color", CSS_PROP_SCROLLBAR_HIGHLIGHT_COLOR}, |
| {"background-color", CSS_PROP_BACKGROUND_COLOR}, |
| {"text-align", CSS_PROP_TEXT_ALIGN}, |
| {"border-style", CSS_PROP_BORDER_STYLE}, |
| {"text-decoration", CSS_PROP_TEXT_DECORATION}, |
| {"position", CSS_PROP_POSITION}, |
| {"visibility", CSS_PROP_VISIBILITY}, |
| {"text-decoration-color", CSS_PROP_TEXT_DECORATION_COLOR}, |
| {"outline-style", CSS_PROP_OUTLINE_STYLE}, |
| {"border-top-width", CSS_PROP_BORDER_TOP_WIDTH}, |
| {"border-collapse", CSS_PROP_BORDER_COLLAPSE}, |
| {"caption-side", CSS_PROP_CAPTION_SIDE}, |
| {"border-right-style", CSS_PROP_BORDER_RIGHT_STYLE}, |
| {"letter-spacing", CSS_PROP_LETTER_SPACING}, |
| {"orphans", CSS_PROP_ORPHANS}, |
| {"border-bottom-width", CSS_PROP_BORDER_BOTTOM_WIDTH}, |
| {"font-style", CSS_PROP_FONT_STYLE}, |
| {"text-indent", CSS_PROP_TEXT_INDENT}, |
| {"border-left-style", CSS_PROP_BORDER_LEFT_STYLE}, |
| {"max-height", CSS_PROP_MAX_HEIGHT}, |
| {"display", CSS_PROP_DISPLAY}, |
| {"background-image", CSS_PROP_BACKGROUND_IMAGE}, |
| {"border-spacing", CSS_PROP_BORDER_SPACING}, |
| {"page-break-after", CSS_PROP_PAGE_BREAK_AFTER}, |
| {"border-top-style", CSS_PROP_BORDER_TOP_STYLE}, |
| {"background-repeat", CSS_PROP_BACKGROUND_REPEAT}, |
| {"scrollbar-arrow-color", CSS_PROP_SCROLLBAR_ARROW_COLOR}, |
| {"empty-cells", CSS_PROP_EMPTY_CELLS}, |
| {"border-bottom-style", CSS_PROP_BORDER_BOTTOM_STYLE}, |
| {"list-style", CSS_PROP_LIST_STYLE}, |
| {"scrollbar-track-color", CSS_PROP_SCROLLBAR_TRACK_COLOR}, |
| {"page-break-before", CSS_PROP_PAGE_BREAK_BEFORE}, |
| {"white-space", CSS_PROP_WHITE_SPACE}, |
| {"font-size-adjust", CSS_PROP_FONT_SIZE_ADJUST}, |
| {"background-attachment", CSS_PROP_BACKGROUND_ATTACHMENT}, |
| {"widows", CSS_PROP_WIDOWS}, |
| {"word-spacing", CSS_PROP_WORD_SPACING}, |
| {"max-width", CSS_PROP_MAX_WIDTH}, |
| {"marker-offset", CSS_PROP_MARKER_OFFSET}, |
| {"-konq-flow-mode", CSS_PROP__KONQ_FLOW_MODE}, |
| {"list-style-image", CSS_PROP_LIST_STYLE_IMAGE}, |
| {"page-break-inside", CSS_PROP_PAGE_BREAK_INSIDE}, |
| {"text-transform", CSS_PROP_TEXT_TRANSFORM}, |
| {"text-shadow", CSS_PROP_TEXT_SHADOW}, |
| {"scrollbar-shadow-color", CSS_PROP_SCROLLBAR_SHADOW_COLOR}, |
| {"list-style-type", CSS_PROP_LIST_STYLE_TYPE}, |
| {"background-position", CSS_PROP_BACKGROUND_POSITION}, |
| {"background-position-y", CSS_PROP_BACKGROUND_POSITION_Y}, |
| {"list-style-position", CSS_PROP_LIST_STYLE_POSITION}, |
| {"scrollbar-darkshadow-color", CSS_PROP_SCROLLBAR_DARKSHADOW_COLOR}, |
| {"background-position-x", CSS_PROP_BACKGROUND_POSITION_X} |
| }; |
| |
| static const signed char lookup[] = |
| { |
| -1, -1, -1, -1, -1, 0, -1, -1, -1, -1, |
| -1, -1, -1, -1, -1, 1, -1, -1, -1, -1, |
| 2, -1, -1, -1, -1, -1, -1, -1, -1, -1, |
| -1, -1, -1, -1, 3, -1, 4, -1, -1, -1, |
| -1, -1, -1, -1, -1, 5, 6, -1, -1, -1, |
| -1, -1, 7, -1, 8, -1, -1, 9, -1, -1, |
| -1, -1, -1, 10, -1, -1, -1, 11, -1, -1, |
| -1, -1, -1, 12, -1, -1, -1, -1, -1, 13, |
| -1, 14, -1, 15, 16, -1, 17, 18, -1, 19, |
| -1, -1, -1, -1, 20, -1, -1, 21, -1, -1, |
| -1, 22, 23, -1, -1, -1, -1, -1, -1, -1, |
| -1, -1, -1, -1, -1, -1, 24, -1, -1, -1, |
| -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, |
| 25, -1, -1, -1, -1, -1, 26, 27, -1, -1, |
| 28, -1, 29, -1, -1, -1, -1, -1, 30, 31, |
| -1, 32, 33, -1, 34, 35, 36, -1, -1, -1, |
| -1, 37, 38, 39, -1, -1, -1, -1, -1, -1, |
| -1, -1, -1, -1, -1, -1, -1, 40, -1, -1, |
| -1, -1, -1, 41, -1, -1, -1, -1, -1, -1, |
| -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, |
| 42, -1, 43, -1, -1, -1, -1, -1, 44, -1, |
| -1, -1, 45, 46, -1, -1, -1, -1, 47, -1, |
| -1, -1, -1, 48, -1, -1, 49, -1, -1, 50, |
| -1, -1, -1, 51, -1, -1, 52, 53, -1, -1, |
| -1, -1, -1, -1, 54, -1, -1, 55, -1, -1, |
| -1, -1, -1, -1, -1, 56, 57, 58, -1, 59, |
| 60, -1, -1, -1, -1, 61, 62, -1, -1, -1, |
| 63, -1, 64, -1, -1, 65, -1, -1, 66, -1, |
| 67, 68, -1, 69, -1, -1, 70, -1, -1, -1, |
| 71, -1, 72, 73, 74, -1, -1, -1, -1, -1, |
| -1, -1, 75, -1, 76, 77, 78, 79, -1, -1, |
| 80, -1, -1, -1, -1, -1, -1, 81, -1, -1, |
| -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, |
| -1, 82, -1, -1, 83, -1, -1, -1, -1, -1, |
| -1, -1, -1, -1, -1, -1, 84, -1, -1, -1, |
| -1, -1, -1, -1, -1, -1, 85, 86, -1, -1, |
| -1, 87, -1, -1, -1, -1, 88, -1, -1, -1, |
| -1, -1, -1, -1, 89, 90, 91, 92, -1, -1, |
| -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, |
| -1, -1, -1, -1, -1, -1, 93, -1, -1, -1, |
| -1, 94, -1, -1, -1, -1, 95, -1, -1, -1, |
| -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, |
| -1, 96, -1, -1, -1, -1, -1, 97, -1, 98, |
| -1, -1, -1, 99, -1, 100, -1, -1, -1, -1, |
| -1, -1, -1, -1, -1, -1, 101, -1, -1, -1, |
| -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, |
| -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, |
| -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, |
| -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, |
| -1, -1, -1, -1, -1, -1, -1, 102, -1, -1, |
| -1, -1, -1, -1, 103, -1, -1, -1, -1, -1, |
| -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, |
| -1, 104, 105, -1, -1, -1, -1, -1, -1, -1, |
| -1, -1, -1, -1, -1, 106, -1, -1, -1, 107, |
| -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, |
| -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, |
| -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, |
| -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, |
| -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, |
| -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, |
| -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, |
| -1, -1, -1, -1, -1, -1, 108, -1, -1, -1, |
| -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, |
| -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, |
| -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, |
| -1, -1, -1, -1, 109, -1, -1, -1, -1, -1, |
| -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, |
| -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, |
| -1, -1, -1, -1, -1, -1, 110, -1, -1, -1, |
| -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, |
| -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, |
| -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, |
| -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, |
| -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, |
| -1, -1, -1, -1, -1, -1, 111 |
| }; |
| |
| if (len <= MAX_WORD_LENGTH && len >= MIN_WORD_LENGTH) |
| { |
| register int key = hash_prop (str, len); |
| |
| if (key <= MAX_HASH_VALUE && key >= 0) |
| { |
| register int index = lookup[key]; |
| |
| if (index >= 0) |
| { |
| register const char *s = wordlist_prop[index].name; |
| |
| if (*str == *s && !strncmp (str + 1, s + 1, len - 1) && s[len] == '\0') |
| return &wordlist_prop[index]; |
| } |
| } |
| } |
| return 0; |
| } |
| static const char * propertyList[] = { |
| "", |
| "background-color", |
| "background-image", |
| "background-repeat", |
| "background-attachment", |
| "background-position", |
| "background-position-x", |
| "background-position-y", |
| "border-collapse", |
| "border-spacing", |
| "border-top-color", |
| "border-right-color", |
| "border-bottom-color", |
| "border-left-color", |
| "border-top-style", |
| "border-right-style", |
| "border-bottom-style", |
| "border-left-style", |
| "border-top-width", |
| "border-right-width", |
| "border-bottom-width", |
| "border-left-width", |
| "bottom", |
| "caption-side", |
| "clear", |
| "clip", |
| "color", |
| "content", |
| "counter-increment", |
| "counter-reset", |
| "cursor", |
| "direction", |
| "display", |
| "empty-cells", |
| "float", |
| "font-family", |
| "font-size", |
| "font-size-adjust", |
| "font-stretch", |
| "font-style", |
| "font-variant", |
| "font-weight", |
| "height", |
| "left", |
| "letter-spacing", |
| "line-height", |
| "list-style-image", |
| "list-style-position", |
| "list-style-type", |
| "margin-top", |
| "margin-right", |
| "margin-bottom", |
| "margin-left", |
| "marker-offset", |
| "max-height", |
| "max-width", |
| "min-height", |
| "min-width", |
| "orphans", |
| "outline-color", |
| "outline-style", |
| "outline-width", |
| "overflow", |
| "padding-top", |
| "padding-right", |
| "padding-bottom", |
| "padding-left", |
| "page", |
| "page-break-after", |
| "page-break-before", |
| "page-break-inside", |
| "position", |
| "quotes", |
| "right", |
| "size", |
| "table-layout", |
| "text-align", |
| "text-decoration", |
| "text-decoration-color", |
| "text-indent", |
| "text-shadow", |
| "text-transform", |
| "top", |
| "unicode-bidi", |
| "vertical-align", |
| "visibility", |
| "white-space", |
| "widows", |
| "width", |
| "word-spacing", |
| "z-index", |
| "background", |
| "border", |
| "border-color", |
| "border-style", |
| "border-top", |
| "border-right", |
| "border-bottom", |
| "border-left", |
| "border-width", |
| "font", |
| "list-style", |
| "margin", |
| "outline", |
| "padding", |
| "scrollbar-face-color", |
| "scrollbar-shadow-color", |
| "scrollbar-highlight-color", |
| "scrollbar-3dlight-color", |
| "scrollbar-darkshadow-color", |
| "scrollbar-track-color", |
| "scrollbar-arrow-color", |
| "-konq-flow-mode", |
| 0 |
| }; |
| DOMString getPropertyName(unsigned short id) |
| { |
| if(id >= CSS_PROP_TOTAL || id == 0) |
| return 0; |
| else |
| return DOMString(propertyList[id]); |
| }; |
| |