reset-template-insertion-mode ( document -- )


Vocabulary
html5

Inputs
documentan object


Outputs
None

Definition


:: reset-template-insertion-mode ( document -- )
document open-elements>> [
{
[ html-element? ]
[
name>> {
"template"
"head"
"body"
"html"
"table"
"td"
"th"
"tr"
"tbody"
"thead"
"tfoot"
"colgroup"
"caption"
} member?
]
} 1&&
] find-last nip [ name>> ] [ "html" ] if* {
{
"template"
[ document template-insertion-modes>> last ]
}
{ "head" [ in-head-mode ] }
{ "html" [ after-head-mode ] }
[ drop in-body-mode ]
} case document swap >>insertion-mode drop ;