summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/dom/html/html_button_element.h2
-rw-r--r--include/dom/html/html_input_element.h4
-rw-r--r--include/dom/html/html_text_area_element.h6
-rw-r--r--src/html/html_button_element.c2
-rw-r--r--src/html/html_element.c7
-rw-r--r--src/html/html_element.h2
-rw-r--r--src/html/html_input_element.c4
-rw-r--r--src/html/html_text_area_element.c6
8 files changed, 17 insertions, 16 deletions
diff --git a/include/dom/html/html_button_element.h b/include/dom/html/html_button_element.h
index 46376b2..9bbd562 100644
--- a/include/dom/html/html_button_element.h
+++ b/include/dom/html/html_button_element.h
@@ -37,7 +37,7 @@ dom_exception dom_html_button_element_set_name(
dom_html_button_element *button, dom_string *name);
dom_exception dom_html_button_element_get_tab_index(
- dom_html_button_element *button, unsigned long *tab_index);
+ dom_html_button_element *button, long *tab_index);
dom_exception dom_html_button_element_set_tab_index(
dom_html_button_element *button, unsigned long tab_index);
diff --git a/include/dom/html/html_input_element.h b/include/dom/html/html_input_element.h
index 60de08e..6d87bd9 100644
--- a/include/dom/html/html_input_element.h
+++ b/include/dom/html/html_input_element.h
@@ -67,7 +67,7 @@ dom_exception dom_html_input_element_set_disabled(
dom_html_input_element *input, bool disabled);
dom_exception dom_html_input_element_get_max_length(
- dom_html_input_element *input, unsigned long *max_length);
+ dom_html_input_element *input, long *max_length);
dom_exception dom_html_input_element_set_max_length(
dom_html_input_element *input, unsigned long max_length);
@@ -97,7 +97,7 @@ dom_exception dom_html_input_element_set_src(
dom_html_input_element *input, dom_string *src);
dom_exception dom_html_input_element_get_tab_index(
- dom_html_input_element *input, unsigned long *tab_index);
+ dom_html_input_element *input, long *tab_index);
dom_exception dom_html_input_element_set_tab_index(
dom_html_input_element *input, unsigned long tab_index);
diff --git a/include/dom/html/html_text_area_element.h b/include/dom/html/html_text_area_element.h
index 37264cf..ce610ad 100644
--- a/include/dom/html/html_text_area_element.h
+++ b/include/dom/html/html_text_area_element.h
@@ -37,13 +37,13 @@ dom_exception dom_html_text_area_element_set_disabled(
dom_html_text_area_element *text_area, bool disabled);
dom_exception dom_html_text_area_element_get_cols(
- dom_html_text_area_element *text_area, unsigned long *cols);
+ dom_html_text_area_element *text_area, long *cols);
dom_exception dom_html_text_area_element_set_cols(
dom_html_text_area_element *text_area, unsigned long cols);
dom_exception dom_html_text_area_element_get_rows(
- dom_html_text_area_element *text_area, unsigned long *rows);
+ dom_html_text_area_element *text_area, long *rows);
dom_exception dom_html_text_area_element_set_rows(
dom_html_text_area_element *text_area, unsigned long rows);
@@ -61,7 +61,7 @@ dom_exception dom_html_text_area_element_set_read_only(
dom_html_text_area_element *text_area, bool read_only);
dom_exception dom_html_text_area_element_get_tab_index(
- dom_html_text_area_element *text_area, unsigned long *tab_index);
+ dom_html_text_area_element *text_area, long *tab_index);
dom_exception dom_html_text_area_element_set_tab_index(
dom_html_text_area_element *text_area, unsigned long tab_index);
diff --git a/src/html/html_button_element.c b/src/html/html_button_element.c
index 68cb1a5..47fdb7b 100644
--- a/src/html/html_button_element.c
+++ b/src/html/html_button_element.c
@@ -196,7 +196,7 @@ SIMPLE_GET(type);
SIMPLE_GET_SET(value);
dom_exception dom_html_button_element_get_tab_index(
- dom_html_button_element *button, unsigned long *tab_index)
+ dom_html_button_element *button, long *tab_index)
{
return dom_html_element_get_long_property(&button->base, "tabindex",
SLEN("tabindex"), tab_index);
diff --git a/src/html/html_element.c b/src/html/html_element.c
index c2a4899..b3b3bfc 100644
--- a/src/html/html_element.c
+++ b/src/html/html_element.c
@@ -330,11 +330,11 @@ static char *_strndup(const char *s, size_t n)
* \param ele The dom_html_element object
* \param name The name of the attribute
* \param len The length of ::name
- * \param value The returned value
+ * \param value The returned value, or -1 if prop. not set
* \return DOM_NO_ERR on success, appropriate dom_exception on failure.
*/
dom_exception dom_html_element_get_long_property(dom_html_element *ele,
- const char *name, unsigned long len, unsigned long *value)
+ const char *name, unsigned long len, long *value)
{
dom_string *str = NULL, *s2 = NULL;
dom_attr *a = NULL;
@@ -358,7 +358,8 @@ dom_exception dom_html_element_get_long_property(dom_html_element *ele,
dom_string_unref(s2);
}
} else {
- *value = 0;
+ /* Property is not set on this node */
+ *value = -1;
}
dom_node_unref(a);
diff --git a/src/html/html_element.h b/src/html/html_element.h
index 2ac4b17..140e3f1 100644
--- a/src/html/html_element.h
+++ b/src/html/html_element.h
@@ -118,7 +118,7 @@ dom_exception dom_html_element_set_bool_property(dom_html_element *ele,
const char *name, unsigned long len, bool has);
dom_exception dom_html_element_get_long_property(dom_html_element *ele,
- const char *name, unsigned long len, unsigned long *value);
+ const char *name, unsigned long len, long *value);
dom_exception dom_html_element_set_long_property(dom_html_element *ele,
const char *name, unsigned long len, unsigned long value);
diff --git a/src/html/html_input_element.c b/src/html/html_input_element.c
index aa3e05f..694eb22 100644
--- a/src/html/html_input_element.c
+++ b/src/html/html_input_element.c
@@ -356,7 +356,7 @@ SIMPLE_GET_SET(use_map);
SIMPLE_GET_SET(value);
dom_exception dom_html_input_element_get_tab_index(
- dom_html_input_element *input, unsigned long *tab_index)
+ dom_html_input_element *input, long *tab_index)
{
return dom_html_element_get_long_property(&input->base, "tabindex",
SLEN("tabindex"), tab_index);
@@ -370,7 +370,7 @@ dom_exception dom_html_input_element_set_tab_index(
}
dom_exception dom_html_input_element_get_max_length(
- dom_html_input_element *input, unsigned long *max_length)
+ dom_html_input_element *input, long *max_length)
{
return dom_html_element_get_long_property(&input->base, "maxlength",
SLEN("maxlength"), max_length);
diff --git a/src/html/html_text_area_element.c b/src/html/html_text_area_element.c
index cb95920..887a2c0 100644
--- a/src/html/html_text_area_element.c
+++ b/src/html/html_text_area_element.c
@@ -365,7 +365,7 @@ dom_exception dom_html_text_area_element_get_type(
}
dom_exception dom_html_text_area_element_get_tab_index(
- dom_html_text_area_element *text_area, unsigned long *tab_index)
+ dom_html_text_area_element *text_area, long *tab_index)
{
return dom_html_element_get_long_property(&text_area->base, "tabindex",
SLEN("tabindex"), tab_index);
@@ -379,7 +379,7 @@ dom_exception dom_html_text_area_element_set_tab_index(
}
dom_exception dom_html_text_area_element_get_cols(
- dom_html_text_area_element *text_area, unsigned long *cols)
+ dom_html_text_area_element *text_area, long *cols)
{
return dom_html_element_get_long_property(&text_area->base, "cols",
SLEN("cols"), cols);
@@ -393,7 +393,7 @@ dom_exception dom_html_text_area_element_set_cols(
}
dom_exception dom_html_text_area_element_get_rows(
- dom_html_text_area_element *text_area, unsigned long *rows)
+ dom_html_text_area_element *text_area, long *rows)
{
return dom_html_element_get_long_property(&text_area->base, "rows",
SLEN("rows"), rows);