summaryrefslogtreecommitdiff
path: root/src/select/properties/content.c
diff options
context:
space:
mode:
authorMichael Drake <tlsa@netsurf-browser.org>2013-12-13 20:16:52 +0000
committerMichael Drake <tlsa@netsurf-browser.org>2013-12-13 20:16:52 +0000
commit1b95fec601a3d006ba6b99e1dea3f61c3c8318fc (patch)
tree1a0c3a78afe1db919ff6b4c56a6c3f2e01d03607 /src/select/properties/content.c
parente3372335ec1628e1d6ef1a4fd63b11bb47f2e0e6 (diff)
downloadlibcss-1b95fec601a3d006ba6b99e1dea3f61c3c8318fc.tar.gz
libcss-1b95fec601a3d006ba6b99e1dea3f61c3c8318fc.tar.bz2
Various changes which modify API and ABI:
- Remove client allocation function. - Change node_classes callback not to yield array ownership to libcss. - Node bloom filters now built by, during selection libcss. - Added selection callbacks to get and set data on document nodes. Test suite, example, and documentation updated to match.
Diffstat (limited to 'src/select/properties/content.c')
-rw-r--r--src/select/properties/content.c31
1 files changed, 14 insertions, 17 deletions
diff --git a/src/select/properties/content.c b/src/select/properties/content.c
index 1d033f2..c79dd0d 100644
--- a/src/select/properties/content.c
+++ b/src/select/properties/content.c
@@ -35,16 +35,15 @@ css_error css__cascade_content(uint32_t opv, css_style *style,
lwc_string *he;
css_computed_content_item *temp;
- css__stylesheet_string_get(style->sheet, *((css_code_t *) style->bytecode), &he);
+ css__stylesheet_string_get(style->sheet,
+ *((css_code_t *) style->bytecode), &he);
- temp = state->computed->alloc(content,
+ temp = realloc(content,
(n_contents + 1) *
- sizeof(css_computed_content_item),
- state->computed->pw);
+ sizeof(css_computed_content_item));
if (temp == NULL) {
if (content != NULL) {
- state->computed->alloc(content,
- 0, state->computed->pw);
+ free(content);
}
return CSS_NOMEM;
}
@@ -127,11 +126,10 @@ css_error css__cascade_content(uint32_t opv, css_style *style,
if (n_contents > 0) {
css_computed_content_item *temp;
- temp = state->computed->alloc(content,
- (n_contents + 1) * sizeof(css_computed_content_item),
- state->computed->pw);
+ temp = realloc(content, (n_contents + 1) *
+ sizeof(css_computed_content_item));
if (temp == NULL) {
- state->computed->alloc(content, 0, state->computed->pw);
+ free(content);
return CSS_NOMEM;
}
@@ -146,11 +144,11 @@ css_error css__cascade_content(uint32_t opv, css_style *style,
error = set_content(state->computed, value, content);
if (error != CSS_OK && content != NULL)
- state->computed->alloc(content, 0, state->computed->pw);
+ free(content);
return error;
} else if (content != NULL) {
- state->computed->alloc(content, 0, state->computed->pw);
+ free(content);
}
return CSS_OK;
@@ -190,7 +188,7 @@ css_error css__set_content_from_hint(const css_hint *hint,
}
if (error != CSS_OK && hint->data.content != NULL)
- style->alloc(hint->data.content, 0, style->pw);
+ free(hint->data.content);
return error;
}
@@ -226,9 +224,8 @@ css_error css__compose_content(const css_computed_style *parent,
i++)
n_items++;
- copy = result->alloc(NULL, (n_items + 1) *
- sizeof(css_computed_content_item),
- result->pw);
+ copy = malloc((n_items + 1) *
+ sizeof(css_computed_content_item));
if (copy == NULL)
return CSS_NOMEM;
@@ -238,7 +235,7 @@ css_error css__compose_content(const css_computed_style *parent,
error = set_content(result, type, copy);
if (error != CSS_OK && copy != NULL)
- result->alloc(copy, 0, result->pw);
+ free(copy);
return error;
}