summaryrefslogtreecommitdiff
path: root/src/select/properties/font_family.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/font_family.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/font_family.c')
-rw-r--r--src/select/properties/font_family.c30
1 files changed, 11 insertions, 19 deletions
diff --git a/src/select/properties/font_family.c b/src/select/properties/font_family.c
index 44860f9..514a43a 100644
--- a/src/select/properties/font_family.c
+++ b/src/select/properties/font_family.c
@@ -63,13 +63,11 @@ css_error css__cascade_font_family(uint32_t opv, css_style *style,
* first generic-family are ignored. */
/** \todo Do this at bytecode generation time? */
if (value == CSS_FONT_FAMILY_INHERIT && font != NULL) {
- temp = state->computed->alloc(fonts,
- (n_fonts + 1) * sizeof(lwc_string *),
- state->computed->pw);
+ temp = realloc(fonts,
+ (n_fonts + 1) * sizeof(lwc_string *));
if (temp == NULL) {
if (fonts != NULL) {
- state->computed->alloc(fonts, 0,
- state->computed->pw);
+ free(fonts);
}
return CSS_NOMEM;
}
@@ -90,11 +88,9 @@ css_error css__cascade_font_family(uint32_t opv, css_style *style,
if (n_fonts > 0) {
lwc_string **temp;
- temp = state->computed->alloc(fonts,
- (n_fonts + 1) * sizeof(lwc_string *),
- state->computed->pw);
+ temp = realloc(fonts, (n_fonts + 1) * sizeof(lwc_string *));
if (temp == NULL) {
- state->computed->alloc(fonts, 0, state->computed->pw);
+ free(fonts);
return CSS_NOMEM;
}
@@ -126,9 +122,7 @@ css_error css__cascade_font_family(uint32_t opv, css_style *style,
}
if (hint.data.strings != NULL) {
- state->computed->alloc(
- hint.data.strings,
- 0, state->computed->pw);
+ free(hint.data.strings);
}
}
@@ -145,12 +139,12 @@ css_error css__cascade_font_family(uint32_t opv, css_style *style,
error = set_font_family(state->computed, value, fonts);
if (error != CSS_OK && n_fonts > 0)
- state->computed->alloc(fonts, 0, state->computed->pw);
+ free(fonts);
return error;
} else {
if (n_fonts > 0)
- state->computed->alloc(fonts, 0, state->computed->pw);
+ free(fonts);
}
return CSS_OK;
@@ -170,7 +164,7 @@ css_error css__set_font_family_from_hint(const css_hint *hint,
}
if (error != CSS_OK && hint->data.strings != NULL)
- style->alloc(hint->data.strings, 0, style->pw);
+ free(hint->data.strings);
return error;
}
@@ -209,9 +203,7 @@ css_error css__compose_font_family(const css_computed_style *parent,
for (i = names; (*i) != NULL; i++)
n_names++;
- copy = result->alloc(NULL, (n_names + 1) *
- sizeof(lwc_string *),
- result->pw);
+ copy = malloc((n_names + 1) * sizeof(lwc_string *));
if (copy == NULL)
return CSS_NOMEM;
@@ -221,7 +213,7 @@ css_error css__compose_font_family(const css_computed_style *parent,
error = set_font_family(result, type, copy);
if (error != CSS_OK && copy != NULL)
- result->alloc(copy, 0, result->pw);
+ free(copy);
return error;
}