summaryrefslogtreecommitdiff
path: root/src/select/properties/content.c
diff options
context:
space:
mode:
authorVincent Sanders <vince@netsurf-browser.org>2011-01-19 23:12:37 +0000
committerVincent Sanders <vince@netsurf-browser.org>2011-01-19 23:12:37 +0000
commit6a50bef84ae6a0a67e03ac1356f8d85d15fe09d6 (patch)
tree01f78f04b22517899f603787f6005f70b359271e /src/select/properties/content.c
parent63c21aca7c77b1d37cb64ad2b1fa76d6b0b92f48 (diff)
downloadlibcss-6a50bef84ae6a0a67e03ac1356f8d85d15fe09d6.tar.gz
libcss-6a50bef84ae6a0a67e03ac1356f8d85d15fe09d6.tar.bz2
Merge parser autogeneration and string handling refactor branch r=jmb,kinnison,vince
svn path=/trunk/libcss/; revision=11408
Diffstat (limited to 'src/select/properties/content.c')
-rw-r--r--src/select/properties/content.c53
1 files changed, 10 insertions, 43 deletions
diff --git a/src/select/properties/content.c b/src/select/properties/content.c
index 40fb018..f6e8452 100644
--- a/src/select/properties/content.c
+++ b/src/select/properties/content.c
@@ -32,8 +32,10 @@ css_error cascade_content(uint32_t opv, css_style *style,
value = CSS_CONTENT_SET;
while (v != CONTENT_NORMAL) {
- lwc_string *he = *((lwc_string **) style->bytecode);
+ lwc_string *he;
css_computed_content_item *temp;
+
+ css_stylesheet_string_get(style->sheet, *((css_code_t *) style->bytecode), &he);
temp = state->computed->alloc(content,
(n_contents + 1) *
@@ -51,7 +53,7 @@ css_error cascade_content(uint32_t opv, css_style *style,
switch (v & 0xff) {
case CONTENT_COUNTER:
- advance_bytecode(style, sizeof(he));
+ advance_bytecode(style, sizeof(css_code_t));
content[n_contents].type =
CSS_COMPUTED_CONTENT_COUNTER;
@@ -62,11 +64,10 @@ css_error cascade_content(uint32_t opv, css_style *style,
{
lwc_string *sep;
- advance_bytecode(style, sizeof(he));
+ advance_bytecode(style, sizeof(css_code_t));
- sep = *((lwc_string **)
- style->bytecode);
- advance_bytecode(style, sizeof(sep));
+ css_stylesheet_string_get(style->sheet, *((css_code_t *) style->bytecode), &sep);
+ advance_bytecode(style, sizeof(css_code_t));
content[n_contents].type =
CSS_COMPUTED_CONTENT_COUNTERS;
@@ -76,21 +77,21 @@ css_error cascade_content(uint32_t opv, css_style *style,
}
break;
case CONTENT_URI:
- advance_bytecode(style, sizeof(he));
+ advance_bytecode(style, sizeof(css_code_t));
content[n_contents].type =
CSS_COMPUTED_CONTENT_URI;
content[n_contents].data.uri = he;
break;
case CONTENT_ATTR:
- advance_bytecode(style, sizeof(he));
+ advance_bytecode(style, sizeof(css_code_t));
content[n_contents].type =
CSS_COMPUTED_CONTENT_ATTR;
content[n_contents].data.attr = he;
break;
case CONTENT_STRING:
- advance_bytecode(style, sizeof(he));
+ advance_bytecode(style, sizeof(css_code_t));
content[n_contents].type =
CSS_COMPUTED_CONTENT_STRING;
@@ -245,37 +246,3 @@ css_error compose_content(const css_computed_style *parent,
return CSS_OK;
}
-uint32_t destroy_content(void *bytecode)
-{
- uint32_t consumed = sizeof(uint32_t);
- uint32_t value = getValue(*((uint32_t*)bytecode));
- bytecode = ((uint8_t*)bytecode) + sizeof(uint32_t);
-
- if (value == CONTENT_NONE || value == CONTENT_NORMAL)
- return sizeof(uint32_t);
-
- while (value != 0) {
- switch (value & 0xff) {
- case CONTENT_COUNTERS: {
- lwc_string *str = *(lwc_string **)bytecode;
- lwc_string_unref(str);
- consumed += sizeof(lwc_string*);
- bytecode = (uint8_t*)bytecode + sizeof(lwc_string *);
- }
- case CONTENT_STRING:
- case CONTENT_URI:
- case CONTENT_COUNTER:
- case CONTENT_ATTR: {
- lwc_string *str = *(lwc_string **)bytecode;
- lwc_string_unref(str);
- consumed += sizeof(lwc_string*);
- bytecode = (uint8_t*)bytecode + sizeof(lwc_string *);
- }
- }
- consumed += sizeof(uint32_t);
- value = *((uint32_t*)bytecode);
- bytecode = ((uint8_t*)bytecode) + sizeof(uint32_t);
- }
-
- return consumed;
-}