Re: [whatwg] Fwd: Range.createContextualFragment in SVG contexts

2014-10-28 Thread Anne van Kesteren
On Tue, Oct 28, 2014 at 2:29 PM, Daniel Trebbien  wrote:
> The issue that I am referring to is the behavior of
> Range.createContextualFragment() when the context node is not an SVG 
> element, but some other SVG element such as an SVG  or  element.

If you change the range's start node to e.g. the  element,
you'll find Firefox reports two child nodes, just like Chrome.

I think given https://www.w3.org/Bugs/Public/show_bug.cgi?id=17924 and
https://html5.org/r/7768 we were probably reading the specification
wrong.


-- 
https://annevankesteren.nl/


Re: [whatwg] Fwd: Range.createContextualFragment in SVG contexts

2014-10-28 Thread Daniel Trebbien
On Tue, Oct 28, 2014 at 8:45 AM, Anne van Kesteren  wrote:

> On Tue, Oct 28, 2014 at 1:35 PM, Daniel Trebbien 
> wrote:
> > Issues related to Range.createContextualFragment() in SVG contexts are
> > starting to come up in bug reports:
> > - https://bugzilla.mozilla.org/show_bug.cgi?id=1087715
> > - https://code.google.com/p/chromium/issues/detail?id=426400
> >
> > Should Cameron's idea for changing the HTML fragment parsing algorithm be
> > implemented?
>
> Now Firefox' fragment parsing is fixed, it seems it behaves the same
> as Chrome. Not sure what's going on.
>


I linked to the Firefox bug report mainly for context.  Firefox' behavior
seems correct now, and I can confirm that the modified jsFiddle
 is working correctly in Firefox Nightly
36.0a1 (2014-10-28).

The issue that I am referring to is the behavior of
Range.createContextualFragment() when the context node is not an SVG 
element, but some other SVG element such as an SVG  or  element.


Re: [whatwg] Fwd: Range.createContextualFragment in SVG contexts

2014-10-28 Thread Anne van Kesteren
On Tue, Oct 28, 2014 at 1:35 PM, Daniel Trebbien  wrote:
> Issues related to Range.createContextualFragment() in SVG contexts are
> starting to come up in bug reports:
> - https://bugzilla.mozilla.org/show_bug.cgi?id=1087715
> - https://code.google.com/p/chromium/issues/detail?id=426400
>
> Should Cameron's idea for changing the HTML fragment parsing algorithm be
> implemented?

Now Firefox' fragment parsing is fixed, it seems it behaves the same
as Chrome. Not sure what's going on.


-- 
https://annevankesteren.nl/


[whatwg] Fwd: Range.createContextualFragment in SVG contexts

2014-10-28 Thread Daniel Trebbien
(My apologies if you get this twice.  I haven't seen my message on the public
archives , so I
suspect that it was dropped.)

On Sat, Dec 28, 2013 at 5:29 AM, Cameron McCormack  wrote:

> 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  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  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  element on to the stack of open elements so that the parser will
> interpret the "" as foreign content?
>


Issues related to Range.createContextualFragment() in SVG contexts are
starting to come up in bug reports:
- https://bugzilla.mozilla.org/show_bug.cgi?id=1087715
- https://code.google.com/p/chromium/issues/detail?id=426400

Should Cameron's idea for changing the HTML fragment parsing algorithm be
implemented?

One other idea is to change the "in body" insertion mode spec so that there
are 'A start tag whose tag name is one of: "defs", "g", "svg"' steps, but I
personally think that Cameron's idea is much better.

Daniel