summaryrefslogtreecommitdiff
path: root/src/html/html_element.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/html/html_element.c')
-rw-r--r--src/html/html_element.c26
1 files changed, 13 insertions, 13 deletions
diff --git a/src/html/html_element.c b/src/html/html_element.c
index ffa7db9..4d43205 100644
--- a/src/html/html_element.c
+++ b/src/html/html_element.c
@@ -106,19 +106,19 @@ dom_exception _dom_html_element_copy(dom_node_internal *old,
dom_exception _dom_html_element_get_id(dom_html_element *element,
dom_string **id)
{
- dom_exception ret;
- dom_string *idstr;
-
- ret = dom_string_create_interned((const uint8_t *) "id", SLEN("id"),
- &idstr);
- if (ret != DOM_NO_ERR)
- return ret;
-
- ret = dom_element_get_attribute(element, idstr, id);
-
- dom_string_unref(idstr);
-
- return ret;
+ dom_exception ret;
+ dom_string *_memo_id;
+
+ /* Because we're an HTML element, our document is always
+ * an HTML document, so we can get its memoised id string
+ */
+ _memo_id =
+ ((struct dom_html_document *)
+ ((struct dom_node_internal *)element)->owner)->_memo_id;
+
+ ret = dom_element_get_attribute(element, _memo_id, id);
+
+ return ret;
}
dom_exception _dom_html_element_set_id(dom_html_element *element,