W3C home > Mailing lists > Public > www-svg@w3.org > May 2011

Re: HTML5 how to indicate missing content: inline SVG & .svgz?

From: Dr. Olaf Hoffmann <Dr.O.Hoffmann@gmx.de>
Date: Tue, 24 May 2011 09:32:39 +0100
To: Tony Schreiner <tonyschr@microsoft.com>, www-svg@w3.org, j.chetwynd@btinternet.com
Message-Id: <201105241032.39769.Dr.O.Hoffmann@gmx.de>
Tony Schreiner: 
>
> For inline SVG in HTML5 the best solution is to use feature detection (e.g.
> http://blogs.msdn.com/b/ie/archive/2010/09/03/same-markup-using-canvas-audi
>o-and-video.aspx) rather than browser detection. This embedding type is
> relatively new, so only the latest versions of browsers include support.
>

Can you provide a precise URI/IRI/fragment identifier to the W3C-HTML5 draft
indicating a declarative method for something like a format detection or 
feature detection?
Something like this (in SVG) would be helpful (but not already perfectly 
usable for authors):
http://www.w3.org/TR/SVGMobile12/struct.html#RequiredFormatsAttribute
http://www.w3.org/TR/SVGMobile12/struct.html#RequiredExtensionsAttribute
http://www.w3.org/TR/SVGMobile12/struct.html#RequiredFeaturesAttribute

I think, scripted methods to detect something different than scripted issues 
are not very useful, because it does not really care about the relevant 
question. It simply tests mainly scripting capabilities and not only the 
feature in question ;o)

Some declarative (X)HTML+SVG pseudo code could look like this,
assuming a switch element in (X)HTML corresponding to that of SVG:


<!-- more (X)HTML content before conditional processing -->
<switch requiredFormats="image/svg+xml" 
requiredExtensions="http://www.w3.org/Graphics/SVG/feature/1.2/#PaintAttribute
http://www.w3.org/Graphics/SVG/feature/1.2/#OpacityAttribute
http://www.w3.org/Graphics/SVG/feature/1.2/#Shape
http://www.w3.org/Graphics/SVG/feature/1.2/#Structure">
<svg width="4cm" height="4cm" viewBox="-1 -1 2 2"
     xmlns="http://www.w3.org/2000/svg" 
     version="1.2" baseProfile="tiny"
     viewport-fill="white" viewport-fill-opacity="0.5">
     <title>Sample SVG With Circle</title>
     <circle r="1" />
</svg>
<div>Obviously no embedded SVG tiny 1.2 available, imagine a black circle with 
a radius of 2cm on a partly white opaque viewport as alternative.</div>
</switch>
<!-- more (X)HTML content after conditional processing -->


If the viewer cannot interprete SVG tiny 1.2 (relevant for the viewport-* 
properties here), the alternative content should be displayed. 

Even more important maybe to have this for MathML and other formats, that
may appear with an even lower probability to be interpreted.


Olaf
Received on Tuesday, 24 May 2011 08:33:13 GMT

This archive was generated by hypermail 2.3.1 : Friday, 8 March 2013 15:54:48 GMT