This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 7855 - Define fragment parsing when the context is not an HTML, SVG or MathML node
Summary: Define fragment parsing when the context is not an HTML, SVG or MathML node
Alias: None
Product: HTML WG
Classification: Unclassified
Component: pre-LC1 HTML5 spec (editor: Ian Hickson) (show other bugs)
Version: unspecified
Hardware: PC All
: P2 normal
Target Milestone: ---
Assignee: Ian 'Hixie' Hickson
QA Contact: HTML WG Bugzilla archive list
Keywords: NE
Depends on:
Reported: 2009-10-09 10:39 UTC by Henri Sivonen
Modified: 2010-10-04 14:31 UTC (History)
4 users (show)

See Also:


Description Henri Sivonen 2009-10-09 10:39:51 UTC
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 namespace and terminate these steps.
 4) Let /node/ be the parent of /node/.
 5) Go to step 1.
Comment 1 Henri Sivonen 2009-10-09 10:41:45 UTC
(I believe the above is what I have implemented for Gecko when the HTML5 parser is enabled.)
Comment 2 Ian 'Hixie' Hickson 2009-10-20 11:17:49 UTC
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.