adoption-agency ( document token -- )


Vocabulary
html5

Inputs
documentan object
tokenan object


Outputs
None

Definition


:: adoption-agency ( document token -- )
document open-elements>> :> stack document
active-formatting-elements>> :> entries stack ?last [
{
[ html-element? ]
[ name>> token name>> = ]
[ entries node-member? not ]
} 1&&
] [ f ] if*
[ stack pop drop ] [
0 :> count! t :> continue?!
[ count 8 < continue? and ] [
count 1 + count! document token adoption-pass
continue?!
] while
] if ;