From 91bee91db8eb8d9a62afb31b3be5a834e8f2135d Mon Sep 17 00:00:00 2001 From: Michael Drake Date: Thu, 23 Jan 2014 23:41:58 +0000 Subject: Strip and collapse whitespace when gathering html option values. --- src/core/document.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'src/core/document.c') diff --git a/src/core/document.c b/src/core/document.c index 22f08f1..a78cde9 100644 --- a/src/core/document.c +++ b/src/core/document.c @@ -147,6 +147,14 @@ dom_exception _dom_document_initialise(dom_document *doc, return err; } + err = dom_string_create_interned((const uint8_t *) "script", + SLEN("script"), &doc->script_string); + if (err != DOM_NO_ERR) { + dom_string_unref(doc->id_name); + dom_string_unref(doc->class_string); + return err; + } + /* Intern the empty string. The use of a space in the constant * is to prevent the compiler warning about an empty string. */ @@ -155,6 +163,7 @@ dom_exception _dom_document_initialise(dom_document *doc, if (err != DOM_NO_ERR) { dom_string_unref(doc->id_name); dom_string_unref(doc->class_string); + dom_string_unref(doc->script_string); return err; } @@ -165,6 +174,7 @@ dom_exception _dom_document_initialise(dom_document *doc, dom_string_unref(doc->_memo_empty); dom_string_unref(doc->id_name); dom_string_unref(doc->class_string); + dom_string_unref(doc->script_string); return err; } @@ -176,6 +186,7 @@ dom_exception _dom_document_initialise(dom_document *doc, dom_string_unref(doc->_memo_empty); dom_string_unref(doc->id_name); dom_string_unref(doc->class_string); + dom_string_unref(doc->script_string); return err; } @@ -188,6 +199,7 @@ dom_exception _dom_document_initialise(dom_document *doc, dom_string_unref(doc->_memo_empty); dom_string_unref(doc->id_name); dom_string_unref(doc->class_string); + dom_string_unref(doc->script_string); return err; } @@ -201,6 +213,7 @@ dom_exception _dom_document_initialise(dom_document *doc, dom_string_unref(doc->_memo_empty); dom_string_unref(doc->id_name); dom_string_unref(doc->class_string); + dom_string_unref(doc->script_string); return err; } @@ -215,6 +228,7 @@ dom_exception _dom_document_initialise(dom_document *doc, dom_string_unref(doc->_memo_empty); dom_string_unref(doc->id_name); dom_string_unref(doc->class_string); + dom_string_unref(doc->script_string); return err; } @@ -230,6 +244,7 @@ dom_exception _dom_document_initialise(dom_document *doc, dom_string_unref(doc->_memo_empty); dom_string_unref(doc->id_name); dom_string_unref(doc->class_string); + dom_string_unref(doc->script_string); return err; } @@ -246,6 +261,7 @@ dom_exception _dom_document_initialise(dom_document *doc, dom_string_unref(doc->_memo_empty); dom_string_unref(doc->id_name); dom_string_unref(doc->class_string); + dom_string_unref(doc->script_string); return err; } @@ -283,6 +299,7 @@ bool _dom_document_finalise(dom_document *doc) dom_string_unref(doc->id_name); dom_string_unref(doc->class_string); + dom_string_unref(doc->script_string); dom_string_unref(doc->_memo_empty); dom_string_unref(doc->_memo_domnodeinserted); dom_string_unref(doc->_memo_domnoderemoved); -- cgit v1.2.3