From 4bd00fd2f2e1b4951be2b168261e1bc92f844c24 Mon Sep 17 00:00:00 2001 From: Michael Drake Date: Thu, 28 Jan 2016 10:02:31 +0000 Subject: Fix: Pass tag_name through to HTMLQuoteElement initialiser. It needs to be given the tag_name, because it could have been created by a Q or BLOCKQUOTE element. --- src/html/html_document.c | 3 ++- src/html/html_quote_element.c | 10 +++++----- src/html/html_quote_element.h | 4 ++-- 3 files changed, 9 insertions(+), 8 deletions(-) diff --git a/src/html/html_document.c b/src/html/html_document.c index 3d2a7f30..839cf997 100644 --- a/src/html/html_document.c +++ b/src/html/html_document.c @@ -606,7 +606,8 @@ _dom_html_document_create_element_internal( break; case DOM_HTML_ELEMENT_TYPE_BLOCKQUOTE: case DOM_HTML_ELEMENT_TYPE_Q: - exc = _dom_html_quote_element_create(html, namespace, prefix, + exc = _dom_html_quote_element_create(html, tag_name, + namespace, prefix, (dom_html_quote_element **) result); break; case DOM_HTML_ELEMENT_TYPE_PRE: diff --git a/src/html/html_quote_element.c b/src/html/html_quote_element.c index 988ef5b8..17961c04 100644 --- a/src/html/html_quote_element.c +++ b/src/html/html_quote_element.c @@ -32,7 +32,7 @@ static struct dom_element_protected_vtable _protect_vtable = { * \return DOM_NO_ERR on success, appropriate dom_exception on failure. */ dom_exception _dom_html_quote_element_create(struct dom_html_document *doc, - dom_string *namespace, dom_string *prefix, + dom_string *tag_name, dom_string *namespace, dom_string *prefix, struct dom_html_quote_element **ele) { struct dom_node_internal *node; @@ -46,7 +46,8 @@ dom_exception _dom_html_quote_element_create(struct dom_html_document *doc, node->base.vtable = &_dom_html_element_vtable; node->vtable = &_protect_vtable; - return _dom_html_quote_element_initialise(doc, namespace, prefix, *ele); + return _dom_html_quote_element_initialise(doc, tag_name, + namespace, prefix, *ele); } /** @@ -57,12 +58,11 @@ dom_exception _dom_html_quote_element_create(struct dom_html_document *doc, * \return DOM_NO_ERR on success, appropriate dom_exception on failure. */ dom_exception _dom_html_quote_element_initialise(struct dom_html_document *doc, - dom_string *namespace, dom_string *prefix, + dom_string *tag_name, dom_string *namespace, dom_string *prefix, struct dom_html_quote_element *ele) { return _dom_html_element_initialise(doc, &ele->base, - doc->elements[DOM_HTML_ELEMENT_TYPE_Q], - namespace, prefix); + tag_name, namespace, prefix); } /** diff --git a/src/html/html_quote_element.h b/src/html/html_quote_element.h index a8bfbb2c..ee79ee1f 100644 --- a/src/html/html_quote_element.h +++ b/src/html/html_quote_element.h @@ -20,12 +20,12 @@ struct dom_html_quote_element { /* Create a dom_html_quote_element object */ dom_exception _dom_html_quote_element_create(struct dom_html_document *doc, - dom_string *namespace, dom_string *prefix, + dom_string *tag_name, dom_string *namespace, dom_string *prefix, struct dom_html_quote_element **ele); /* Initialise a dom_html_quote_element object */ dom_exception _dom_html_quote_element_initialise(struct dom_html_document *doc, - dom_string *namespace, dom_string *prefix, + dom_string *tag_name, dom_string *namespace, dom_string *prefix, struct dom_html_quote_element *ele); /* Finalise a dom_html_quote_element object */ -- cgit v1.2.1