summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/html/html_document.c8
-rw-r--r--src/html/html_document.h3
2 files changed, 9 insertions, 2 deletions
diff --git a/src/html/html_document.c b/src/html/html_document.c
index 607bbaf..80737e6 100644
--- a/src/html/html_document.c
+++ b/src/html/html_document.c
@@ -75,7 +75,9 @@ dom_exception _dom_html_document_initialise(dom_html_document *doc,
doc->url = NULL;
doc->cookie = NULL;
- return DOM_NO_ERR;
+ error = dom_string_create_interned((const uint8_t *) "id", SLEN("id"),
+ &doc->_memo_id);
+ return error;
}
/* Finalise a HTMLDocument */
@@ -86,7 +88,9 @@ void _dom_html_document_finalise(dom_html_document *doc)
dom_string_unref(doc->domain);
dom_string_unref(doc->referrer);
dom_string_unref(doc->title);
-
+
+ dom_string_unref(doc->_memo_id);
+
_dom_document_finalise(&doc->base);
}
diff --git a/src/html/html_document.h b/src/html/html_document.h
index a77a683..e3cd80a 100644
--- a/src/html/html_document.h
+++ b/src/html/html_document.h
@@ -23,6 +23,9 @@ struct dom_html_document {
dom_string *domain; /**< HTML document domain */
dom_string *url; /**< HTML document URL */
dom_string *cookie; /**< HTML document cookie */
+
+ /* Cached strings for html objects to use */
+ dom_string *_memo_id; /**< Memoised 'id' */
};
/* Create a HTMLDocument */