summaryrefslogtreecommitdiff
path: root/src/parse/properties/properties.c
diff options
context:
space:
mode:
authorJohn Mark Bell <jmb@netsurf-browser.org>2009-05-27 00:39:43 +0000
committerJohn Mark Bell <jmb@netsurf-browser.org>2009-05-27 00:39:43 +0000
commitc3b4574ce6fa79cf786575b8c5a455fdff5365a6 (patch)
treed92db4e1b036ccfb9c03802cf3a5bb50b6fbc66f /src/parse/properties/properties.c
parent859a254f2480bf0fc7b8cb1985ced4b225be9c5c (diff)
downloadlibcss-c3b4574ce6fa79cf786575b8c5a455fdff5365a6.tar.gz
libcss-c3b4574ce6fa79cf786575b8c5a455fdff5365a6.tar.bz2
Move display parser
svn path=/trunk/libcss/; revision=7573
Diffstat (limited to 'src/parse/properties/properties.c')
-rw-r--r--src/parse/properties/properties.c71
1 files changed, 0 insertions, 71 deletions
diff --git a/src/parse/properties/properties.c b/src/parse/properties/properties.c
index 6634378..bc81d91 100644
--- a/src/parse/properties/properties.c
+++ b/src/parse/properties/properties.c
@@ -119,75 +119,4 @@ const css_prop_handler property_handlers[LAST_PROP + 1 - FIRST_PROP] =
parse_z_index,
};
-css_error parse_display(css_language *c,
- const parserutils_vector *vector, int *ctx,
- css_style **result)
-{
- css_error error;
- const css_token *ident;
- uint8_t flags = 0;
- uint16_t value = 0;
- uint32_t opv;
-
- /* IDENT (inline, block, list-item, run-in, inline-block, table,
- * inline-table, table-row-group, table-header-group,
- * table-footer-group, table-row, table-column-group, table-column,
- * table-cell, table-caption, none, inherit) */
- ident = parserutils_vector_iterate(vector, ctx);
- if (ident == NULL || ident->type != CSS_TOKEN_IDENT)
- return CSS_INVALID;
-
- error = parse_important(c, vector, ctx, &flags);
- if (error != CSS_OK)
- return error;
-
- if (ident->ilower == c->strings[INHERIT]) {
- flags |= FLAG_INHERIT;
- } else if (ident->ilower == c->strings[INLINE]) {
- value = DISPLAY_INLINE;
- } else if (ident->ilower == c->strings[BLOCK]) {
- value = DISPLAY_BLOCK;
- } else if (ident->ilower == c->strings[LIST_ITEM]) {
- value = DISPLAY_LIST_ITEM;
- } else if (ident->ilower == c->strings[RUN_IN]) {
- value = DISPLAY_RUN_IN;
- } else if (ident->ilower == c->strings[INLINE_BLOCK]) {
- value = DISPLAY_INLINE_BLOCK;
- } else if (ident->ilower == c->strings[TABLE]) {
- value = DISPLAY_TABLE;
- } else if (ident->ilower == c->strings[INLINE_TABLE]) {
- value = DISPLAY_INLINE_TABLE;
- } else if (ident->ilower == c->strings[TABLE_ROW_GROUP]) {
- value = DISPLAY_TABLE_ROW_GROUP;
- } else if (ident->ilower == c->strings[TABLE_HEADER_GROUP]) {
- value = DISPLAY_TABLE_HEADER_GROUP;
- } else if (ident->ilower == c->strings[TABLE_FOOTER_GROUP]) {
- value = DISPLAY_TABLE_FOOTER_GROUP;
- } else if (ident->ilower == c->strings[TABLE_ROW]) {
- value = DISPLAY_TABLE_ROW;
- } else if (ident->ilower == c->strings[TABLE_COLUMN_GROUP]) {
- value = DISPLAY_TABLE_COLUMN_GROUP;
- } else if (ident->ilower == c->strings[TABLE_COLUMN]) {
- value = DISPLAY_TABLE_COLUMN;
- } else if (ident->ilower == c->strings[TABLE_CELL]) {
- value = DISPLAY_TABLE_CELL;
- } else if (ident->ilower == c->strings[TABLE_CAPTION]) {
- value = DISPLAY_TABLE_CAPTION;
- } else if (ident->ilower == c->strings[NONE]) {
- value = DISPLAY_NONE;
- } else
- return CSS_INVALID;
-
- opv = buildOPV(CSS_PROP_DISPLAY, flags, value);
-
- /* Allocate result */
- error = css_stylesheet_style_create(c->sheet, sizeof(opv), result);
- if (error != CSS_OK)
- return error;
-
- /* Copy the bytecode to it */
- memcpy((*result)->bytecode, &opv, sizeof(opv));
-
- return CSS_OK;
-}