when will serializing a document throw?

If a document is passed to send(), the spec says "re-throw any exception" the serializing throws. There is a test that attempts to test this statement:

http://w3c-test.org/web-platform-tests/master/XMLHttpRequest/send-entity-body-document-bogus.htm

It passes a completely empty document without even a document element to send(). No implementation throws.

Is the incomplete spec attemt on http://domparsing.spec.whatwg.org/#concept-serialize-xml the best reference we have at the moment? Even the statement I found there about serializing comments that do not match the comment syntax seems not to match reality - Gecko serialized a document containing '<html><!-- invalid comment ---></html> just fine.

Does anyone have examples of documents that should and actually DO throw when serialized? Or should we just drop that test and leave that spec statement untested?
-Hallvord

Received on Friday, 20 September 2013 12:02:07 UTC