Re: SVG in text/html

Jeff Schiller:
> > 2) Does there need to be relevant text in the HTML5 spec that covers
> > what DOM interfaces foreign content nodes should or must have? I
> > believe at least one chair thinks it needs to be clarified [1]. I'm
> > assuming that cooperating browsers will extend the SVGElement (and
> > more specific) interfaces to all SVG-in-HTML elements.

Anne van Kesteren:
> "When the steps below require the UA to create an element for a token in 
> a particular namespace, the UA must create a node implementing the 
> interface appropriate for the element type corresponding to the tag name 
> of the token in the given namespace (as given in the specification that 
> defines that element, e.g. for an a  element in the HTML namespace, this  
> specification defines it to be the HTMLAnchorElement interface), with the 
> tag name being the name of that element, with the node being in the given 
> namespace, and with the attributes on the node being those given in the  
> given token." -- 8.2.5.1
>
> Although I think the next paragraph should be different:
>
> "The interface appropriate for an element in the HTML namespace that is  
> not defined in this specification is HTMLElement. The interface  
> appropriate for an element in another namespace that is not defined by  
> that namespace's specification is Element."
>
> I would like that to be the default interface if there is one for forward 
> compatibility. So e.g. <svg:x> would still implement SVGElement just like 
> <html:x> implements HTMLElement.

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

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?  If it’s easy enough for an implementor to determine from
the SVG spec what interface needs to be implemented, then it should be
just as easy to determine the canonical casing of the element/attribute
name.

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

Received on Tuesday, 31 March 2009 00:06:37 UTC