From 3b384400b23edbf52e15ff8610bb0384f5745054 Mon Sep 17 00:00:00 2001 From: Michael Drake Date: Sat, 24 Mar 2012 17:02:02 +0000 Subject: Store 'class' string on document. svn path=/trunk/libdom/; revision=13604 --- src/core/document.c | 7 +++++++ src/core/document.h | 4 +++- 2 files changed, 10 insertions(+), 1 deletion(-) (limited to 'src/core') diff --git a/src/core/document.c b/src/core/document.c index 3f7ce77..c4e0283 100644 --- a/src/core/document.c +++ b/src/core/document.c @@ -132,6 +132,11 @@ dom_exception _dom_document_initialise(dom_document *doc, doc->id_name = NULL; + if (lwc_intern_string("class", SLEN("class"), + &doc->class_string) != lwc_error_ok) { + return DOM_NO_MEM_ERR; + } + /* We should not pass a NULL when all things hook up */ return _dom_document_event_internal_initialise(doc, &doc->dei, daf); } @@ -164,6 +169,8 @@ bool _dom_document_finalise(dom_document *doc) if (doc->id_name != NULL) dom_string_unref(doc->id_name); + + lwc_string_unref(doc->class_string); _dom_document_event_internal_finalise(doc, &doc->dei); diff --git a/src/core/document.h b/src/core/document.h index 4f9990c..f79c9a9 100644 --- a/src/core/document.h +++ b/src/core/document.h @@ -50,7 +50,9 @@ struct dom_document { struct list_entry pending_nodes; /**< The deletion pending list */ - dom_string *id_name; /**< The ID attribute's name */ + dom_string *id_name; /**< The ID attribute's name */ + + lwc_string *class_string; /**< The string "class". */ dom_document_event_internal dei; /**< The DocumentEVent interface */ -- cgit v1.2.3