Fragment serialization algorithm serializes node itself
Nobody has claimed this yet.
- Dominant language
- HTML
- Stars
- 28
- Forks
- 14
- Avg merge
- 3h 10m
- Merged PRs (30d)
- 1
Description
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.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the fragment serialization algorithm in the specification and compare it with the algorithm described in the HTML spec. Resolve whether child serializations share the generated prefix index, then update the specification so fragment serialization returns the children in tree order and the innerHTML and outerHTML behavior is consistent.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- html
- Domain
- documentation
- Issue type
- Bug
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100