Handbook
Glossary
foster-node ( document node fallback -- )
Vocabulary
html5
Inputs
document
an
object
node
an
object
fallback
an
object
Outputs
None
Definition
USING:
accessors
combinators
kernel
math
sequences
;
IN:
html5
::
foster-node
( document node fallback -- )
document
open-elements>>
:>
stack stack
[
"table"
html-element-named?
]
find-last
drop
:>
table-index stack
[
"template"
html-element-named?
]
find-last
drop
:>
template-index
{
{
[
template-index
[
table-index
[
template-index table-index
>
]
[
t
]
if
]
[
f
]
if
]
[
node template-index stack
nth
attach-node
]
}
{
[
table-index
]
[
table-index stack
nth
:>
table table
parent>>
[
node table
insert-before-node
]
[
node stack
first
attach-node
]
if
]
}
[
node fallback
attach-node
]
}
cond
;