summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJohn Mark Bell <jmb@netsurf-browser.org>2009-01-25 18:42:23 +0000
committerJohn Mark Bell <jmb@netsurf-browser.org>2009-01-25 18:42:23 +0000
commitb4d0d63be81dce36b1ddc4365235036c8e9d1a3d (patch)
treea62ec6f46d1989a1268b44d95fa21c571cc45ac8 /src
parentddb3c1e8d9e62591f17a463aae05374effae66dc (diff)
downloadlibcss-b4d0d63be81dce36b1ddc4365235036c8e9d1a3d.tar.gz
libcss-b4d0d63be81dce36b1ddc4365235036c8e9d1a3d.tar.bz2
Simplify API of css_stylesheet_selector_create -- it's always used to create element selectors. Everything else is handled via detail.
svn path=/trunk/libcss/; revision=6266
Diffstat (limited to 'src')
-rw-r--r--src/parse/language.c6
-rw-r--r--src/stylesheet.c11
-rw-r--r--src/stylesheet.h3
3 files changed, 7 insertions, 13 deletions
diff --git a/src/parse/language.c b/src/parse/language.c
index 6f43f25..97b9f66 100644
--- a/src/parse/language.c
+++ b/src/parse/language.c
@@ -812,8 +812,7 @@ css_error parseSimpleSelector(css_language *c,
if (token->type == CSS_TOKEN_IDENT || tokenIsChar(token, '*')) {
/* Have element name */
error = css_stylesheet_selector_create(c->sheet,
- CSS_SELECTOR_ELEMENT, token->idata, NULL,
- &selector);
+ token->idata, &selector);
if (error != CSS_OK)
return error;
@@ -821,8 +820,7 @@ css_error parseSimpleSelector(css_language *c,
} else {
/* Universal selector */
error = css_stylesheet_selector_create(c->sheet,
- CSS_SELECTOR_ELEMENT, c->strings[UNIVERSAL],
- NULL, &selector);
+ c->strings[UNIVERSAL], &selector);
if (error != CSS_OK)
return error;
diff --git a/src/stylesheet.c b/src/stylesheet.c
index 24d46eb..c8eb2e7 100644
--- a/src/stylesheet.c
+++ b/src/stylesheet.c
@@ -368,20 +368,17 @@ css_error css_stylesheet_style_destroy(css_stylesheet *sheet, css_style *style)
}
/**
- * Create a selector
+ * Create an element selector
*
* \param sheet The stylesheet context
- * \param type The type of selector to create
* \param name Name of selector
- * \param value Value of selector, or NULL
* \param selector Pointer to location to receive selector object
* \return CSS_OK on success,
* CSS_BADPARM on bad parameters,
* CSS_NOMEM on memory exhaustion
*/
css_error css_stylesheet_selector_create(css_stylesheet *sheet,
- css_selector_type type, const parserutils_hash_entry *name,
- const parserutils_hash_entry *value, css_selector **selector)
+ const parserutils_hash_entry *name, css_selector **selector)
{
css_selector *sel;
@@ -394,9 +391,9 @@ css_error css_stylesheet_selector_create(css_stylesheet *sheet,
memset(sel, 0, sizeof(css_selector));
- sel->data.type = type;
+ sel->data.type = CSS_SELECTOR_ELEMENT;
sel->data.name = name;
- sel->data.value = value;
+ sel->data.value = NULL;
/** \todo specificity */
sel->specificity = 0;
diff --git a/src/stylesheet.h b/src/stylesheet.h
index 57bca56..532afc0 100644
--- a/src/stylesheet.h
+++ b/src/stylesheet.h
@@ -180,8 +180,7 @@ css_error css_stylesheet_style_create(css_stylesheet *sheet, uint32_t len,
css_error css_stylesheet_style_destroy(css_stylesheet *sheet, css_style *style);
css_error css_stylesheet_selector_create(css_stylesheet *sheet,
- css_selector_type type, const parserutils_hash_entry *name,
- const parserutils_hash_entry *value, css_selector **selector);
+ const parserutils_hash_entry *name, css_selector **selector);
css_error css_stylesheet_selector_destroy(css_stylesheet *sheet,
css_selector *selector);