A user account is required in order to edit this wiki, but we've had to disable public user registrations due to spam.

To request an account, ask an autoconfirmed user on IRC (such as one of these permanent autoconfirmed members) or send an e-mail to admin@wiki.whatwg.org with your desired username and an explanation of the first edit you'd like to make. (Do not use this e-mail address for any other inquiries, as they will be ignored or politely declined.)

Note: This wiki is used to supplement, not replace, specification discussions. If you would like to request changes to existing specifications, please use IRC or a mailing list first.

Diagrams in HTML

From WHATWG Wiki
Jump to: navigation, search

This document is obsolete.

For the current specification, see: HTML Standard: SVG


Please put ideas for what it should look like here.

Each example should have a green circle, with an embedded HTML table, and should say how to handle tokeniser errors and tree construction errors.

Hardcoded element names

 <p>
   Hello world.
   <svg viewbox="0 0 10 10">
     <circle x=5 y=5 r=5 stroke=green>
     <foreignObject> <table><tr><td>1<td>2<tr><td>3<td>4</table> </foreignObject>
   </svg>
 </p>

Tokeniser recovers from errors by ignoring them and moving on.

Tree construction recovers from errors by closing the <svg> element.

Extensibility Element (<ext>)

Moved to Extensions, since this is a potentially generic mechanism.

Make sure to test your proposals... :-)

<svg> as document element

This is not a syntax proposal but I'd like to able to have SVG graphics in text/html without the need to wrap it inside HTML and without having implied <html>, <body>, etc. (I being Anne.)

Rationale:

  • It's often easier to generate text/html documents than other types of documents (Live DOM Viewer, PHP)
  • It allows you to use text/html-style syntax for SVG graphics which makes authoring easy.
  • It makes creating graphics that use features from HTML and MathML easier.
<svg viewbox="0 0 10 10">
  <circle x=5 y=5 r=5 fill=lime>
  <foreignObject> <table><tr><td>1<td>2<tr><td>3<td>4</table> </foreignOBJECT>
</svG>

It's not clear that authoring would be easier with looser error handling, and introduces the incompatibilities mentioned above. A safer approach would be to first introduce the more conservative syntax, then observe how it is used and specify from real-world use cases incrementally. It's also not clear how this is to be distinguished from SVG content with embedded HTML (MIME Type?). -Shepazu