Handbook
Glossary
emit-doctype ( document -- )
Vocabulary
html5
Inputs
document
an
object
Outputs
None
Definition
USING:
accessors
combinators
combinators.short-circuit
io
kernel
prettyprint
strings
;
IN:
html5
:
emit-doctype
( document -- )
"emit-doctype: "
write
dup
doctype>>
.
{
[
doctype>>
[
>string
]
change-name
drop
]
[
dup
{
[
doctype>>
name>>
"html"
=
not
]
[
parser-cannot-change-mode-flag>>
not
]
}
1&&
[
t
>>quirks-mode?
]
[
dup
{
[
iframe-srcdoc?>>
not
]
[
parser-cannot-change-mode-flag>>
not
]
}
1&&
[
dup
doctype>>
limited-quirks-mode?
[
t
>>limited-quirks-mode?
]
when
]
when
]
if
drop
]
[
dup
doctype>>
tree-insert
drop
]
[
f
>>doctype
drop
]
}
cleave
;