This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.
createContextualFragment() method (decentralized extension to DOM Range) allows the invocation of the fragment parsing algorithm with contexts that aren't possible with innerHTML. Please clarify (or explicitly delegate defaulting to other applicable specifications) cases where the context node is not an HTML, SVG or MathML element node. I suggest the following: 1) Let /node/ be the context node. 2) If /node/ is an HTML, SVG or MathML element, use /node/ as the actual context node and terminate these steps. 3) If /node/ is null or an element, behave as if the actual context node were a body element node in the http://www.w3.org/1999/xhtml namespace and terminate these steps. 4) Let /node/ be the parent of /node/. 5) Go to step 1.
(I believe the above is what I have implemented for Gecko when the HTML5 parser is enabled.)
I don't understand. The fragment parsing algorithm takes an Element as its context argument; how can it be called with anything else? That's like saying that it can be called with a number instead of a string as its input data, or that it can be called expecting it to return a bitmap instead of a list of nodes. What would the explicit delegating note be? "If other specifications use this algorithm, they have to do it in a way that is not blatantly incompatible with this one"? That seems... pointless.