summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRupinder Singh Khokhar <rsk1coder99@gmail.com>2014-07-30 13:54:05 (GMT)
committer Rupinder Singh Khokhar <rsk1coder99@gmail.com>2014-07-30 21:31:27 (GMT)
commitfd73a1bac9d352c77c2e8412d076f16ae06a795d (patch)
treeb32263620adb0ff9ccb31b30fc9f402aa6ae1c30
parent98ad579a47319265989eb419f66e782a8a7ae4a6 (diff)
downloadlibdom-fd73a1bac9d352c77c2e8412d076f16ae06a795d.tar.gz
libdom-fd73a1bac9d352c77c2e8412d076f16ae06a795d.tar.bz2
fix style element string leak & also removed returning of default value
-rw-r--r--src/html/html_style_element.c42
-rw-r--r--src/html/html_style_element.h2
2 files changed, 1 insertions, 43 deletions
diff --git a/src/html/html_style_element.c b/src/html/html_style_element.c
index 681f0b8..c97955e 100644
--- a/src/html/html_style_element.c
+++ b/src/html/html_style_element.c
@@ -55,7 +55,6 @@ dom_exception _dom_html_style_element_initialise(struct dom_html_document *doc,
struct dom_html_style_element *ele)
{
dom_string *name = NULL;
- dom_string *media_default = NULL;
dom_exception err;
err = dom_string_create((const uint8_t *) "STYLE", SLEN("STYLE"),
@@ -63,12 +62,6 @@ dom_exception _dom_html_style_element_initialise(struct dom_html_document *doc,
if (err != DOM_NO_ERR)
return err;
- err = dom_string_create((const uint8_t *) "screen", SLEN("screen"),
- &media_default);
- if (err != DOM_NO_ERR)
- return err;
-
- ele->media = media_default;
err = _dom_html_element_initialise(doc, &ele->base, name, NULL, NULL);
dom_string_unref(name);
@@ -168,7 +161,7 @@ dom_exception dom_html_style_element_set_##attr( \
#define SIMPLE_GET_SET(attr) SIMPLE_GET(attr) SIMPLE_SET(attr)
SIMPLE_GET_SET(type);
-SIMPLE_SET(media);
+SIMPLE_GET_SET(media);
/**
* Get the disabled property
@@ -198,36 +191,3 @@ dom_exception dom_html_style_element_set_disabled(dom_html_style_element *ele,
SLEN("disabled"), disabled);
}
-/**
- * Get the media property
- *
- * \param ele The dom_html_style_element object
- * \param media The returned status
- * \return DOM_NO_ERR on success, appropriate dom_exception on failure.
- */
-dom_exception dom_html_style_element_get_media(dom_html_style_element *ele,
- dom_string **media)
-{
- dom_html_document *doc;
- bool has_value = false;
- dom_exception err;
-
- doc = (dom_html_document *) ((dom_node_internal *) ele)->owner;
-
- err = dom_element_has_attribute(ele,
- doc->memoised[hds_media], &has_value);
- if(err !=DOM_NO_ERR)
- return err;
-
- if(has_value) {
- return dom_element_get_attribute(ele,
- doc->memoised[hds_media], media);
- }
-
- *media = ele->media;
- if (*media != NULL)
- dom_string_ref(*media);
- return DOM_NO_ERR;
-
-}
-
diff --git a/src/html/html_style_element.h b/src/html/html_style_element.h
index 285da94..e7a47e5 100644
--- a/src/html/html_style_element.h
+++ b/src/html/html_style_element.h
@@ -15,8 +15,6 @@
struct dom_html_style_element {
struct dom_html_element base;
/**< The base class */
- dom_string *media;
- /**< The default string value for the media attribute*/
};
/* Create a dom_html_style_element object */