Re: SVG in text/html

Cameron McCormack:
> > I agree with you and Jeff that unknown elements placed in the SVG 
> > namespace should implement SVGElement.

Ian Hickson:
> Is this defined in SVG anywhere?

No.

> What interfaces is the node X expected to implement when a script runs
> this?:
> 
>   var X = document.createElementNS('http://www.w3.org/2000/svg', 'xXxXx');

My expectation is that it implements SVGElement.  I do not know if this
is what happens in practice.  It would be interesting if someone tested
that.  Maybe this could be an erratum for SVG 1.1?

> > One of the arguments given for having an explicit table of case mappings 
> > in the HTML spec was that implementors would rather have that 
> > information in a single place, instead of needing to hunt through the 
> > SVG spec for each element and attribute that is defined.  Wouldn’t a 
> > corollary of that be that the interfaces the DOM object must implement 
> > be listed too?
> 
> In practice no, because user agents use the same mechanism for creating 
> nodes in the parser as they do for creating nodes from scripts using the 
> document.createElementNS() API. (You'll notice there's no list for HTML 
> elements either.) Thus this ends up being done as part of implementing the 
> vocabulary itself, rather than as part of the syntax parsing.

That doesn’t say anything to the difficulty in searching for elements to
implement compared to the difficulty in searching for canonical cases to
use for elements/attributes during parsing, though.  I posit that these
difficulties are roughly the same.

-- 
Cameron McCormack ≝ http://mcc.id.au/

Received on Tuesday, 31 March 2009 00:33:23 UTC