[w3c/DOM-Parsing] Fragment serialization algorithm serializes node itself (#28)

If implemented as specified, the "fragment serialization algorithm" described in this specification, when given *node* in an XML document, simply returns "an XML serialization of *node* passing the flag *require well-formed*". This means that innerHTML would actually return the outerHTML of the element, and outerHTML would need to return the serialization of a fictional node, for which no further details are given.

It looks like, in order to match the intended behavior, the fragment serialization algorithm should return the concatenation of producing the XML serializations for each of *node*'s children, in tree order. This behavior matches the algorithm described in the HTML spec.

I'd love to send a PR, but there are some options regarding how much of the serialization algorithm's state to propagate between the children. In particular, the generated prefix index could either be propagated from serializing one child to the next, or reset to 1 for each child. Each serialization would be equally valid.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/w3c/DOM-Parsing/issues/28

Received on Wednesday, 28 June 2017 13:32:47 UTC