Author: jmb
Date: Sun Oct 26 16:07:57 2008
New Revision: 5640
URL:
http://source.netsurf-browser.org?rev=5640&view=rev
Log:
empty-cells
Modified:
trunk/libcss/src/parse/css21.c
trunk/libcss/src/parse/css21props.c
Modified: trunk/libcss/src/parse/css21.c
URL:
http://source.netsurf-browser.org/trunk/libcss/src/parse/css21.c?rev=5640...
==============================================================================
--- trunk/libcss/src/parse/css21.c (original)
+++ trunk/libcss/src/parse/css21.c Sun Oct 26 16:07:57 2008
@@ -57,6 +57,7 @@
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, BELOW, LEVEL, ABOVE, HIGHER, LOWER,
+ SHOW, HIDE,
LAST_KNOWN
};
@@ -219,6 +220,8 @@
{ "above", SLEN("above") },
{ "higher", SLEN("higher") },
{ "lower", SLEN("lower") },
+ { "show", SLEN("show") },
+ { "hide", SLEN("hide") },
};
typedef struct context_entry {
Modified: trunk/libcss/src/parse/css21props.c
URL:
http://source.netsurf-browser.org/trunk/libcss/src/parse/css21props.c?rev...
==============================================================================
--- trunk/libcss/src/parse/css21props.c (original)
+++ trunk/libcss/src/parse/css21props.c Sun Oct 26 16:07:57 2008
@@ -1384,10 +1384,39 @@
const parserutils_vector *vector, int *ctx,
css_style **result)
{
- UNUSED(c);
- UNUSED(vector);
- UNUSED(ctx);
- UNUSED(result);
+ css_error error;
+ const css_token *ident;
+ uint8_t flags = 0;
+ uint16_t value = 0;
+ uint32_t opv;
+
+ /* IDENT (show, hide, 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->lower.ptr == c->strings[INHERIT]) {
+ flags |= FLAG_INHERIT;
+ } else if (ident->lower.ptr == c->strings[SHOW]) {
+ value = EMPTY_CELLS_SHOW;
+ } else if (ident->lower.ptr == c->strings[HIDE]) {
+ value = EMPTY_CELLS_HIDE;
+ } else
+ return CSS_INVALID;
+
+ opv = buildOPV(OP_EMPTY_CELLS, flags, value);
+
+ /* Allocate result */
+ *result = css_stylesheet_style_create(c->sheet, sizeof(opv));
+ if (*result == NULL)
+ return CSS_NOMEM;
+
+ /* Copy the bytecode to it */
+ memcpy((*result)->bytecode, &opv, sizeof(opv));
return CSS_OK;
}