[whatwg] Inline SVG

On 12/7/06, Alexey Feldgendler <alexey at feldgendler.ru> wrote:
> On Mon, 04 Dec 2006 13:55:32 +0600, Ian Hickson <ian at hixie.ch> wrote:
>
> >>   http://intertwingly.net/stories/2006/12/02/whatwg.logo
>
> > Currently, there wouldn't be one. We could extend HTML5 to have some sort
> > of way of doing this, in the future. (It isn't clear to me that we'd want
> > to allow inline SVG, though. It's an external embedded resource, not a
> > semantically-rich part of the document, IMHO.)
>
> People will do inline SVG anyway. If there won't be a straightforward way to do this, authors will use all kinds of dirty hacks, such as data: URIs and DOM manipulation.
>
> Personally, I don't think SVG content is inappropriate for HTML documents. It is no more presentational than the text itself: HTML doesn't try to structure natural language sentences by breaking them into grammar constructs, so an SVG image could be thought of as just an atomic "phrase" which only has defined semantics as whole.

How about this for HTML5:
<object type="image/svg+xml">
    <svg version="1.1" xmlns="http://www.w3.org/2000/svg">
        <circle cx="100" cy="50" r="40" stroke="black"
stroke-width="2" fill="red"/>
    </svg>
</object>

And this for XHTML5:
<object type="image/svg+xml">
<![CDATA[
    <svg version="1.1" xmlns="http://www.w3.org/2000/svg">
        <circle cx="100" cy="50" r="40" stroke="black"
stroke-width="2" fill="red"/>
    </svg>
]]>
</object>

If that's over-complicating the semantics of <object>, we could
introduce an inline <xml> tag that's similar to the inline <script>
and <style> tags. It would have a type="" attribute to specify the
mimetype, and its contents would be within a CDATA block in XHTML5.

Regards,
-- 
Leons Petrazickis
Database Technology Advocate, IBM

I work on the free DB2 Express-C database
http://www-306.ibm.com/software/data/db2/express/download.html

Received on Friday, 8 December 2006 07:29:52 UTC