Fix printing regression from #3848.
Append entire DOM fragment at once.
Merge pull request #3976 from brendandahl/dom-frag

Append entire DOM fragment at once.
Merge pull request #3972 from brendandahl/print-reg

Fix printing regression from #3848.