summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/html/html_document.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/html/html_document.c b/src/html/html_document.c
index d978327..5d06e80 100644
--- a/src/html/html_document.c
+++ b/src/html/html_document.c
@@ -536,6 +536,10 @@ _dom_html_document_create_element_internal(
dom_exception exc;
struct dom_html_element_create_params params;
+ /* If the input tag name is empty, this is an 'invalid character' error */
+ if (dom_string_length(in_tag_name) == 0)
+ return DOM_INVALID_CHARACTER_ERR;
+
exc = dom_string_toupper(in_tag_name, true, &params.name);
if (exc != DOM_NO_ERR)
return exc;