         unknown-named-entity
     ] if ;
 
-: push-tag-name ( ch document -- ) tag>> name>> push ;
+! XXX: remove the tag>> name>> push part
+: push-tag-name ( ch document -- )
+    [ tag>> name>> push ]
+    [
+        2drop ! tag-name>> push
+    ] 2bi ;
 : push-attribute-name ( ch document -- ) attribute-name>> push ;
 : push-attribute-value ( ch document -- ) attribute-value>> push ;
 : push-comment-token ( ch document -- ) comment-token>> push ;

doctype
tag
end-tag
tag-name
end-tag-name
attribute-name

: ?1sbuf ( ch -- sbuf ) [ SBUF" " clone ] dip [ over push ] when* ; inline

! https://html.spec.whatwg.org/multipage/parsing.html#tokenization

! https://infra.spec.whatwg.org/#namespaces
CONSTANT: html-namespace "http://www.w3.org/1999/xhtml"
CONSTANT: mathml-namespace "http://www.w3.org/1998/Math/MathML"
CONSTANT: svg-namespace "http://www.w3.org/2000/svg"
CONSTANT: xlink-namespace "http://www.w3.org/1999/xlink"
CONSTANT: xml-namespace "http://www.w3.org/XML/1998/namespace"
CONSTANT: xmlns-namespace "http://www.w3.org/2000/xmlns/"

DEFER: data-state
DEFER: (data-state)
