summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVincent Sanders <vince@kyllikki.org>2015-10-31 13:19:25 +0000
committerVincent Sanders <vince@kyllikki.org>2015-10-31 13:19:49 +0000
commitac39440b4946df20756ad59c573b20cfd2e2af21 (patch)
treeeccf3193ae2328203c4804592d888a5800b7730b
parent5425792229081e233ad7a4960c85f7c620b92f59 (diff)
downloadlibdom-ac39440b4946df20756ad59c573b20cfd2e2af21.tar.gz
libdom-ac39440b4946df20756ad59c573b20cfd2e2af21.tar.bz2
add async property to script element
-rw-r--r--include/dom/html/html_script_element.h6
-rw-r--r--src/html/html_script_element.c28
2 files changed, 34 insertions, 0 deletions
diff --git a/include/dom/html/html_script_element.h b/include/dom/html/html_script_element.h
index b7df3aa..855bf9d 100644
--- a/include/dom/html/html_script_element.h
+++ b/include/dom/html/html_script_element.h
@@ -20,6 +20,12 @@ dom_exception dom_html_script_element_get_defer(
dom_exception dom_html_script_element_set_defer(
dom_html_script_element *ele, bool defer);
+dom_exception dom_html_script_element_get_async(
+ dom_html_script_element *ele, bool *async);
+
+dom_exception dom_html_script_element_set_async(
+ dom_html_script_element *ele, bool async);
+
dom_exception dom_html_script_element_get_text(
dom_html_script_element *element, dom_string **text);
diff --git a/src/html/html_script_element.c b/src/html/html_script_element.c
index f107d45..e0038f5 100644
--- a/src/html/html_script_element.c
+++ b/src/html/html_script_element.c
@@ -192,6 +192,34 @@ dom_exception dom_html_script_element_set_defer(dom_html_script_element *ele,
}
/**
+ * Get the async property
+ *
+ * \param ele The dom_html_script_element object
+ * \param async If the script is asynchronous
+ * \return DOM_NO_ERR on success, appropriate dom_exception on failure.
+ */
+dom_exception dom_html_script_element_get_async(dom_html_script_element *ele,
+ bool *async)
+{
+ return dom_html_element_get_bool_property(&ele->base, "async",
+ SLEN("async"), async);
+}
+
+/**
+ * Set the async property
+ *
+ * \param ele The dom_html_script_element object
+ * \param async If the script is asynchronous
+ * \return DOM_NO_ERR on success, appropriate dom_exception on failure.
+ */
+dom_exception dom_html_script_element_set_async(dom_html_script_element *ele,
+ bool async)
+{
+ return dom_html_element_set_bool_property(&ele->base, "async",
+ SLEN("async"), async);
+}
+
+/**
* Get the text property
*
* \param ele The dom_html_script_element object