diff options
author | John Mark Bell <jmb@netsurf-browser.org> | 2009-01-25 14:02:45 +0000 |
---|---|---|
committer | John Mark Bell <jmb@netsurf-browser.org> | 2009-01-25 14:02:45 +0000 |
commit | 1c23bae15b2bb019c39af68b1c0cfc5bb40ba2a7 (patch) | |
tree | 0d5426e92b6ea7dbadd2f3558be67ef4595e106d /src/stylesheet.c | |
parent | d0bb179f15f58958bc7d52bb36c1148b2ea79880 (diff) | |
download | libcss-1c23bae15b2bb019c39af68b1c0cfc5bb40ba2a7.tar.gz libcss-1c23bae15b2bb019c39af68b1c0cfc5bb40ba2a7.tar.bz2 |
Selector hash.
svn path=/trunk/libcss/; revision=6263
Diffstat (limited to 'src/stylesheet.c')
-rw-r--r-- | src/stylesheet.c | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/src/stylesheet.c b/src/stylesheet.c index ca53170..80f2a1b 100644 --- a/src/stylesheet.c +++ b/src/stylesheet.c @@ -77,11 +77,19 @@ css_error css_stylesheet_create(css_language_level level, return error; } - /** \todo create selector hash */ + error = css_selector_hash_create(alloc, alloc_pw, &sheet->selectors); + if (error != CSS_OK) { + css_language_destroy(sheet->parser_frontend); + css_parser_destroy(sheet->parser); + parserutils_hash_destroy(sheet->dictionary); + alloc(sheet, 0, alloc_pw); + return error; + } len = strlen(url) + 1; sheet->url = alloc(NULL, len, alloc_pw); if (sheet->url == NULL) { + css_selector_hash_destroy(sheet->selectors); css_language_destroy(sheet->parser_frontend); css_parser_destroy(sheet->parser); parserutils_hash_destroy(sheet->dictionary); @@ -95,6 +103,7 @@ css_error css_stylesheet_create(css_language_level level, sheet->title = alloc(NULL, len, alloc_pw); if (sheet->title == NULL) { alloc(sheet->url, 0, alloc_pw); + css_selector_hash_destroy(sheet->selectors); css_language_destroy(sheet->parser_frontend); css_parser_destroy(sheet->parser); parserutils_hash_destroy(sheet->dictionary); @@ -136,7 +145,9 @@ css_error css_stylesheet_destroy(css_stylesheet *sheet) sheet->alloc(sheet->url, 0, sheet->pw); - /** \todo destroy selector hash + other data */ + /** \todo destroy other data */ + + css_selector_hash_destroy(sheet->selectors); css_language_destroy(sheet->parser_frontend); |