Handbook
Glossary
html-tree-insert ( document obj -- document )
Vocabulary
html5
Inputs
document
an
object
obj
an
object
Outputs
document
an
object
Definition
USING:
accessors
combinators
kernel
sequences
;
IN:
html5
::
html-tree-insert
( document obj -- document )
{
{
[
document
insertion-mode>>
text-mode
=
]
[
document obj
text-token
]
}
{
[
obj
"html"
start-tag-named?
document
open-elements>>
empty?
not
and
]
[
document
template-insertion-modes>>
empty?
[
document
open-elements>>
first
obj
merge-element-attributes
]
when
document
]
}
{
[
document
insertion-mode>>
frameset-modes
member?
]
[
document obj
frameset-token
]
}
{
[
obj
"frameset"
start-tag-named?
document
insertion-mode>>
after-head-mode
=
and
]
[
document obj
insert-element
document
in-frameset-mode
>>insertion-mode
]
}
{
[
obj
f
=
document
template-insertion-modes>>
empty?
not
and
]
[
"eof-in-template"
report-parse-error
document
<end-tag>
"template"
>>name
end-template
drop
document obj
html-tree-insert
]
}
{
[
document
insertion-mode>>
{
initial-mode
before-html-mode
before-head-mode
}
member?
]
[
document obj
(html-tree-insert)
]
}
{
[
obj
"template"
start-tag-named?
]
[
document obj
start-template
]
}
{
[
obj
"template"
end-tag-named?
]
[
document obj
end-template
]
}
{
[
document
insertion-mode>>
in-template-mode
=
]
[
document obj
template-token
]
}
[
document obj
(html-tree-insert)
]
}
cond
;