Re: [whatwg] Range.createContextualFragment in SVG contexts

Hi Victor,

Victor Costan wrote:
> I'm trying to re-implement Range.createContextualFragment in Blink
> following this whatwg spec:
> http://domparsing.spec.whatwg.org/#extensions-to-the-range-interface
>
> 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.
>
> Examples:
> https://bug711821.bugzilla.mozilla.org/attachment.cgi?id=582654
> (the red circle should be completely covered by a black circle)
>
> https://codereview.chromium.org/115693010/diff/70001/LayoutTests/fast/dom/Range/create-contextual-fragment-from-svg-element-range.html

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?

Received on Saturday, 28 December 2013 10:30:50 UTC