summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRupinder Singh Khokhar <rsk1coder99@gmail.com>2014-08-06 20:50:40 (GMT)
committer Rupinder Singh Khokhar <rsk1coder99@gmail.com>2014-08-06 21:03:32 (GMT)
commit9710e41ebef7c587e91df17d555bb86c65810161 (patch)
tree6a15b99ed2d3f7c0fc52ffc76acbbbbc3d4e1a4f
parent0411dc6ff54fc981387a946ef523466b179177f6 (diff)
downloadlibdom-rupindersingh/libdom_recovered.tar.gz
libdom-rupindersingh/libdom_recovered.tar.bz2
removed redundant variables & fixed leaksrupindersingh/libdom_recovered
-rw-r--r--src/html/html_frame_element.c90
-rw-r--r--src/html/html_frame_element.h2
-rw-r--r--src/html/html_frameset_element.c80
-rw-r--r--src/html/html_frameset_element.h1
-rw-r--r--src/html/html_iframe_element.c93
-rw-r--r--src/html/html_iframe_element.h2
-rw-r--r--src/html/html_label_element.c2
-rw-r--r--src/html/html_label_element.h2
-rw-r--r--src/html/html_object_element.c1
-rw-r--r--src/html/html_object_element.h2
10 files changed, 11 insertions, 264 deletions
diff --git a/src/html/html_frame_element.c b/src/html/html_frame_element.c
index a03b32d..9e1ea1e 100644
--- a/src/html/html_frame_element.c
+++ b/src/html/html_frame_element.c
@@ -60,26 +60,9 @@ dom_exception _dom_html_frame_element_initialise(struct dom_html_document *doc,
dom_string *namespace, dom_string *prefix,
struct dom_html_frame_element *ele)
{
- dom_string *scrolling_default = NULL;
- dom_exception err;
- err = dom_string_create((const uint8_t *) "auto", SLEN("auto"), &scrolling_default);
- if (err != DOM_NO_ERR)
- return err;
-
-
- dom_string *frame_border_default = NULL;
- err = dom_string_create((const uint8_t *) "1", SLEN("1"), &frame_border_default);
- if (err != DOM_NO_ERR)
- return err;
-
- err = _dom_html_element_initialise(doc, &ele->base,
+ return _dom_html_element_initialise(doc, &ele->base,
doc->memoised[hds_FRAME],
namespace, prefix);
-
- ele->scrolling_default = scrolling_default;
- ele->frame_border_default = frame_border_default;
-
- return err;
}
/**
@@ -205,77 +188,10 @@ dom_exception dom_html_frame_element_set_##attr( \
SIMPLE_GET_SET(long_desc);
SIMPLE_GET_SET(name);
SIMPLE_GET_SET(src);
-SIMPLE_SET(frame_border);
+SIMPLE_GET_SET(frame_border);
SIMPLE_GET_SET(margin_width);
SIMPLE_GET_SET(margin_height);
-SIMPLE_SET(scrolling);
-
-
-/**
- * Get the frame_border property
- *
- * \param ele The dom_html_frame_element object
- * \param frame_border The returned status
- * \return DOM_NO_ERR on success, appropriate dom_exception on failure.
- */
-dom_exception dom_html_frame_element_get_frame_border(
- dom_html_frame_element *ele,
- dom_string **frame_border)
-{
- 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_frame_border], &has_value);
- if(err !=DOM_NO_ERR)
- return err;
-
- if(has_value) {
- return dom_element_get_attribute(ele,
- doc->memoised[hds_frame_border], frame_border);
- }
-
- *frame_border = ele->frame_border_default;
- if (*frame_border != NULL)
- dom_string_ref(*frame_border);
- return DOM_NO_ERR;
-}
-
-/**
- * Get the frame_border property
- *
- * \param ele The dom_html_frame_element object
- * \param scrolling The returned status
- * \return DOM_NO_ERR on success, appropriate dom_exception on failure.
- */
-dom_exception dom_html_frame_element_get_scrolling(
- dom_html_frame_element *ele,
- dom_string **scrolling)
-{
- 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_scrolling], &has_value);
- if(err !=DOM_NO_ERR)
- return err;
-
- if(has_value) {
- return dom_element_get_attribute(ele,
- doc->memoised[hds_scrolling], scrolling);
- }
-
- *scrolling = ele->scrolling_default;
- if (*scrolling != NULL)
- dom_string_ref(*scrolling);
- return DOM_NO_ERR;
-}
+SIMPLE_GET_SET(scrolling);
dom_exception dom_html_frame_element_get_content_document(
dom_html_frame_element *ele,
diff --git a/src/html/html_frame_element.h b/src/html/html_frame_element.h
index c313cbc..d83c9fc 100644
--- a/src/html/html_frame_element.h
+++ b/src/html/html_frame_element.h
@@ -16,8 +16,6 @@
struct dom_html_frame_element {
struct dom_html_element base;
/**< The base class */
- dom_string *scrolling_default;
- dom_string *frame_border_default;
};
/* Create a dom_html_frame_element object */
diff --git a/src/html/html_frameset_element.c b/src/html/html_frameset_element.c
index b096156..871906b 100644
--- a/src/html/html_frameset_element.c
+++ b/src/html/html_frameset_element.c
@@ -60,17 +60,9 @@ dom_exception _dom_html_frame_set_element_initialise(struct dom_html_document *d
dom_string *namespace, dom_string *prefix,
struct dom_html_frame_set_element *ele)
{
- dom_string *cols_rows_default = NULL;
- dom_exception err;
- err = dom_string_create((const uint8_t *) "100%", SLEN("100%"), &cols_rows_default);
- if (err != DOM_NO_ERR)
- return err;
-
- err = _dom_html_element_initialise(doc, &ele->base,
+ return _dom_html_element_initialise(doc, &ele->base,
doc->memoised[hds_FRAMESET],
namespace, prefix);
- ele->cols_rows_default = cols_rows_default;
- return err;
}
/**
@@ -165,72 +157,6 @@ dom_exception dom_html_frame_set_element_set_##attr( \
#define SIMPLE_GET_SET(attr) SIMPLE_GET(attr) SIMPLE_SET(attr)
-SIMPLE_SET(rows);
-SIMPLE_SET(cols);
-
-/**
- * Get the rows property
- *
- * \param ele The dom_html_frame_set_element object
- * \param rows The returned status
- * \return DOM_NO_ERR on success, appropriate dom_exception on failure.
- */
-dom_exception dom_html_frame_set_element_get_rows(
- dom_html_frame_set_element *ele,
- dom_string **rows)
-{
- 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_rows], &has_value);
- if(err !=DOM_NO_ERR)
- return err;
-
- if(has_value) {
- return dom_element_get_attribute(ele,
- doc->memoised[hds_rows], rows);
- }
+SIMPLE_GET_SET (rows);
+SIMPLE_GET_SET (cols);
- *rows = ele->cols_rows_default;
- if (*rows != NULL)
- dom_string_ref(*rows);
-
- return DOM_NO_ERR;
-}
-
-/**
- * Get the cols property
- *
- * \param ele The dom_html_frame_set_element object
- * \param cols The returned status
- * \return DOM_NO_ERR on success, appropriate dom_exception on failure.
- */
-dom_exception dom_html_frame_set_element_get_cols(
- dom_html_frame_set_element *ele,
- dom_string **cols)
-{
- 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_cols], &has_value);
- if(err !=DOM_NO_ERR)
- return err;
-
- if(has_value) {
- return dom_element_get_attribute(ele,
- doc->memoised[hds_cols], cols);
- }
-
- *cols = ele->cols_rows_default;
- if (*cols != NULL)
- dom_string_ref(*cols);
- return DOM_NO_ERR;
-}
diff --git a/src/html/html_frameset_element.h b/src/html/html_frameset_element.h
index fd1c255..dd4037a 100644
--- a/src/html/html_frameset_element.h
+++ b/src/html/html_frameset_element.h
@@ -16,7 +16,6 @@
struct dom_html_frame_set_element {
struct dom_html_element base;
/**< The base class */
- dom_string *cols_rows_default;
};
/* Create a dom_html_frame_set_element object */
diff --git a/src/html/html_iframe_element.c b/src/html/html_iframe_element.c
index 0972d56..41a30d9 100644
--- a/src/html/html_iframe_element.c
+++ b/src/html/html_iframe_element.c
@@ -60,26 +60,9 @@ dom_exception _dom_html_iframe_element_initialise(struct dom_html_document *doc,
dom_string *namespace, dom_string *prefix,
struct dom_html_iframe_element *ele)
{
- dom_string *scrolling_default = NULL;
- dom_exception err;
- err = dom_string_create((const uint8_t *) "auto", SLEN("auto"), &scrolling_default);
- if (err != DOM_NO_ERR)
- return err;
-
-
- dom_string *frame_border_default = NULL;
- err = dom_string_create((const uint8_t *) "1", SLEN("1"), &frame_border_default);
- if (err != DOM_NO_ERR)
- return err;
-
- err = _dom_html_element_initialise(doc, &ele->base,
+ return _dom_html_element_initialise(doc, &ele->base,
doc->memoised[hds_IFRAME],
namespace, prefix);
-
- ele->scrolling_default = scrolling_default;
- ele->frame_border_default = frame_border_default;
-
- return err;
}
/**
@@ -180,82 +163,16 @@ SIMPLE_GET_SET(name);
SIMPLE_GET_SET(src);
SIMPLE_GET_SET(margin_width);
SIMPLE_GET_SET(margin_height);
-SIMPLE_SET(scrolling);
-SIMPLE_SET(frame_border);
+SIMPLE_GET_SET(scrolling);
+SIMPLE_GET_SET(frame_border);
SIMPLE_GET_SET(width);
SIMPLE_GET_SET(height);
/**
- * Get the frame_border property
- *
- * \param ele The dom_html_iframe_element object
- * \param iframe_border The returned status
- * \return DOM_NO_ERR on success, appropriate dom_exception on failure.
- */
-dom_exception dom_html_iframe_element_get_frame_border(
- dom_html_iframe_element *ele,
- dom_string **frame_border)
-{
- 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_frame_border], &has_value);
- if(err !=DOM_NO_ERR)
- return err;
-
- if(has_value) {
- return dom_element_get_attribute(ele,
- doc->memoised[hds_frame_border], frame_border);
- }
-
- *frame_border = ele->frame_border_default;
- if (*frame_border != NULL)
- dom_string_ref(*frame_border);
- return DOM_NO_ERR;
-}
-
-/**
- * Get the frame_border property
- *
- * \param ele The dom_html_iframe_element object
- * \param scrolling The returned status
- * \return DOM_NO_ERR on success, appropriate dom_exception on failure.
- */
-dom_exception dom_html_iframe_element_get_scrolling(
- dom_html_iframe_element *ele,
- dom_string **scrolling)
-{
- 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_scrolling], &has_value);
- if(err !=DOM_NO_ERR)
- return err;
-
- if(has_value) {
- return dom_element_get_attribute(ele,
- doc->memoised[hds_scrolling], scrolling);
- }
-
- *scrolling = ele->scrolling_default;
- if (*scrolling != NULL)
- dom_string_ref(*scrolling);
- return DOM_NO_ERR;
-}
-
-/**
- * Get the frame_border property
+ * Get the content_document property
*
- * \param ele The dom_html_iframe_element object
+ * \param ele The dom_html_iframe_element object
* \param content_document The returned status
* \return DOM_NO_ERR on success, appropriate dom_exception on failure.
*/
diff --git a/src/html/html_iframe_element.h b/src/html/html_iframe_element.h
index dafc9e1..2375adf 100644
--- a/src/html/html_iframe_element.h
+++ b/src/html/html_iframe_element.h
@@ -16,8 +16,6 @@
struct dom_html_iframe_element {
struct dom_html_element base;
/**< The base class */
- dom_string *scrolling_default;
- dom_string *frame_border_default;
};
/* Create a dom_html_iframe_element object */
diff --git a/src/html/html_label_element.c b/src/html/html_label_element.c
index 1ffbf71..c3a522f 100644
--- a/src/html/html_label_element.c
+++ b/src/html/html_label_element.c
@@ -58,8 +58,6 @@ dom_exception _dom_html_label_element_initialise(struct dom_html_document *doc,
dom_string *namespace, dom_string *prefix,
struct dom_html_label_element *ele)
{
- ele->form = NULL;
-
return _dom_html_element_initialise(doc, &ele->base,
doc->memoised[hds_LABEL],
namespace, prefix);
diff --git a/src/html/html_label_element.h b/src/html/html_label_element.h
index e28b453..36c817e 100644
--- a/src/html/html_label_element.h
+++ b/src/html/html_label_element.h
@@ -16,8 +16,6 @@
struct dom_html_label_element {
struct dom_html_element base;
/**< The base class */
- dom_html_form_element *form;
- /**< The form associated with label */
};
/* Create a dom_html_label_element object */
diff --git a/src/html/html_object_element.c b/src/html/html_object_element.c
index 7da4567..1568630 100644
--- a/src/html/html_object_element.c
+++ b/src/html/html_object_element.c
@@ -63,7 +63,6 @@ dom_exception _dom_html_object_element_initialise(struct dom_html_document *doc,
dom_string *namespace, dom_string *prefix,
struct dom_html_object_element *ele)
{
- ele->form = NULL;
return _dom_html_element_initialise(doc, &ele->base,
doc->memoised[hds_OBJECT],
namespace, prefix);
diff --git a/src/html/html_object_element.h b/src/html/html_object_element.h
index 83512d6..5170f2c 100644
--- a/src/html/html_object_element.h
+++ b/src/html/html_object_element.h
@@ -16,8 +16,6 @@
struct dom_html_object_element {
struct dom_html_element base;
/**< The base class */
- dom_html_form_element *form;
- /**< The form associated with object */
};
/* Create a dom_html_object_element object */