SIGN IN SIGN UP

[Float][Fizz][Legacy] hoisted elements no longer emit before `<html>` in legacy apis such as `renderToString()` (#27269)

renderToString is a legacy server API which used a trick to avoid having
the DOCTYPE included when rendering full documents by setting the root
formatcontext to HTML_MODE rather than ROOT_HTML_MODE. Previously this
was of little consequence but with Float the Root mode started to be
used for things like determining if we could flush hoistable elements
yet. In issue #27177 we see that hoisted elements can appear before the
<html> tag when using a legacy API `renderToString`.

This change exports a DOCTYPE from FizzConfigDOM and FizzConfigDOMLegacy
respectively, using an empty chunk in the legacy case. The only runtime
perf cost here is that for legacy APIs there is an extra empty chunk to
write when rendering a top level <html> tag which is trivial enough

Fixes #27177
J
Josh Story committed
86198b923199224b60533952b636348bb0484a6d
Parent: dd480ef
Committed by GitHub <noreply@github.com> on 8/22/2023, 5:54:33 PM