Re: More on SVG within HTML pages

On Sep 7, 2009, at 13:37, Ian Hickson wrote:

> On Mon, 7 Sep 2009, Henri Sivonen wrote:
>> On Sep 7, 2009, at 12:36, Ian Hickson wrote:
>>>> HTML5 defines how to parse text/html into a DOM. It also specifies
>>>> above-DOM conformance requirements for elements in the
>>>> http://www.w3.org/1999/xhtml namespace. It doesn't specify
>>>> conformance requirements for elements in the
>>>> http://www.w3.org/2000/svg or http://www.w3.org/1998/Math/MathML
>>>> namespaces, so those are non-conforming as far as HTML5 itself  
>>>> goes.
>>>
>>> That's not quite accurate. MathML's <math> and SVG's <svg> are  
>>> defined
>>> to fit into specific content models, and thus are allowed in a  
>>> number
>>> of places as children of HTML elements ("4.8.15 MathML" and "4.8.16
>>> SVG"). What goes on within the MathML and SVG namespaces is up to  
>>> the
>>> MathML and SVG specs, however, and HTML5 doesn't have anything to  
>>> say
>>> about that (other than as it affects elements in the HTML  
>>> namespace).
>>
>> I agree that those sections define where those elements fit when some
>> spec licenses those elements to exist at all. But where does HTML5
>> define those elements as existing on its own?
>
> I'm not sure what you mean by "existing".

I mean "allowed to be used at all" to use your wording from below.

>> Are you saying that even if one doesn't invoke any MathML or SVG  
>> spec as
>> other relevant specs, the {http://www.w3.org/1998/Math/MathML}math  
>> and
>> {http://www.w3.org/2000/svg}svg elements with no children and no
>> attributes are conforming where the sections you references allow  
>> them?
>
> I'm saying that "The svg element from the SVG namespace falls into the
> embedded content, phrasing content, and flow content categories for  
> the
> purposes of the content models in this specification", i.e. that  
> <div> can
> contain <svg>. Whether <svg> is allowed to have a parent node from the
> HTML namespace, or is allowed to be used at all, or has any required
> attributes, or whatever, is a matter for the SVG spec.

So is ...<div><svg></svg></div>... conforming in plain HTML5 (no SVG  
spec invoked as "relevant") as opposed to an HTML5+SVG x.y profile?

>> Or are you saying that some SVG spec and some MathML spec always  
>> have to
>> be invoked as relevant?
>
> The SVG and MathML specs don't (as far as I know) say anything that
> contradicts the HTML spec, they just pick up where HTML leaves off.
> Whenever you deal with something in the SVG namespace, the SVG spec is
> relevant.

If some SVG spec is always "relevant", I think this should be called  
out more clearly in HTML5. (Like it also makes "some version of XML"  
required for UAs that implement XHTML5.)

-- 
Henri Sivonen
hsivonen@iki.fi
http://hsivonen.iki.fi/

Received on Monday, 7 September 2009 10:49:55 UTC