[whatwg] Range.createContextualFragment in SVG contexts
cam at mcc.id.au
Sat Dec 28 02:29:49 PST 2013
Victor Costan wrote:
> I'm trying to re-implement Range.createContextualFragment in Blink
> following this whatwg spec:
> There are two issues I'd like to discuss, related to the use of
> createContextualFragment in SVG contexts.
> 1) If a Range's context is an<svg> element, I think the XML parsing
> algorithm should be selected, so the elements in the resulting
> DocumentFragment would get the SVG namespace. This way, inserting the
> fragment in an<svg> tree would have the intended effect.
> (the red circle should be completely covered by a black circle)
I think it would be unexpected that XML parsing is used here, when HTML
parsing was used to get the SVG fragment in the document in the first
place. Maybe the HTML fragment parsing algorithm should be changed to
push the <svg> element on to the stack of open elements so that the
parser will interpret the "<circle .../>" as foreign content?
More information about the whatwg