<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Kaizou &#187; IE</title>
	<atom:link href="http://www.kaizou.org/tag/ie/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.kaizou.org</link>
	<description>This is Web 2.71828</description>
	<lastBuildDate>Sun, 16 May 2010 21:17:53 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Inline SVG Fallback</title>
		<link>http://www.kaizou.org/2009/03/inline-svg-fallback/</link>
		<comments>http://www.kaizou.org/2009/03/inline-svg-fallback/#comments</comments>
		<pubDate>Mon, 02 Mar 2009 13:07:15 +0000</pubDate>
		<dc:creator>David Corvoysier</dc:creator>
				<category><![CDATA[SVG]]></category>
		<category><![CDATA[XHTML]]></category>
		<category><![CDATA[IE]]></category>
		<category><![CDATA[inline]]></category>

		<guid isPermaLink="false">http://www.kaizou.org/?p=178</guid>
		<description><![CDATA[As you may already know, IE doesn&#8217;t support SVG unless you install a plugin like the ASV, that is unfortunately not supported anymore by Adobe. As a web developer willing to use inline SVG, your best bet is thus to provide fallback mechanisms to display IE visitors at least a degraded version of what you&#8217;re [...]]]></description>
			<content:encoded><![CDATA[<p>As you may already know, IE doesn&#8217;t support SVG unless you install a plugin like the ASV, that is unfortunately not supported anymore by Adobe.</p>
<p>As a web developer willing to use inline SVG, your best bet is thus to provide fallback mechanisms to display IE visitors at least a degraded version of what you&#8217;re trying to express/demonstrate, and teach them what they&#8217;re missing by sticking with evil IE.</p>
<p>Luckily, IE will simply ignore any markup it does&#8217;nt know, so you usually don&#8217;t need to bother masking or removing the SVG markup when serving pages to your IE visitors.</p>
<p>This is however not true if you insert plain text if your SVG &#8230; Let&#8217;s take an example.</p>
<p>When you insert the following SVG in your page:</p>
<pre>
<code>&lt;svg xmlns="http://www.w3.org/2000/svg"
       version="1.1" wiewBox="0 0 200 100"&gt;
   &lt;text x="0" y="0"
         font-family="Verdana"
	 font-size="55" fill="blue" &gt;
        Hello, out there
   &lt;/text&gt;
&lt;/svg&gt;</code>
</pre>
<p>IE will ignore all SVG markup and formatting, and actually display the plain text with the current style:</p>
<p>Hello, out there</p>
<p>Now, what happens when you insert HTML markup inside your SVG using the <code>foreignObject</code> tag ?</p>
<pre>
<code>&lt;svg xmlns="http://www.w3.org/2000/svg"
       version="1.1" wiewBox="0 0 200 100"&gt;
   &lt;foreignObject width="200" height="100"&gt;
      &lt;span style="color:blue;"&gt;
        Hello, out there
      &lt;/span&gt;
   &lt;/foreignObject&gt;
&lt;/svg&gt;</code>
</pre>
<p>Well, IE ignores all SVG and displays only the HTML markup embedded in the <code>foreignObject</code> tag:</p>
<p><span style="color:blue;">Hello, out there</span></p>
<p>Based on this behavior, the guys at <a href="http://shepherd-interactive.com/" alt="Sheperd interactive">Sheperd interactive</a> have imagined a very elegant <a href="http://shepherd-interactive.com/#about-us/blog/2008/12/inline-svg-fallback/" alt="inline SVG fallback">inline SVG fallback</a> mechanism that uses <a href="http://www.w3.org/TR/SVG/struct.html#ConditionalProcessing" alt="SVG conditional processing">SVG conditional processing</a>.</p>
<p>In a nutshell, the actual SVG and the IE fallback are embedded in an SVG <code>switch</code>:</p>
<ul>
<li>SVG aware browsers will recognize the conditional directive, and render the first alternative they understand (the actual SVG), ignoring the other (the IE fallback)</li>
<li>IE will silently ignore all SVG markup (including the conditional directive), and go straight to the fallback written in HTML.</li>
</ul>
<p>In the example, below, SVG-aware browsers will display a red circle, and IE a simple text.</p>
<pre>
<code>&lt;svg xmlns="http://www.w3.org/2000/svg"
        version="1.1" wiewBox="0 0 200 100"&gt;
  &lt;switch&gt;
     &lt;circle cx="150px" cy="100px" r="50px"
               fill="#ff0000" stroke="#000000"
               stroke-width="5px"/&gt;
     &lt;foreignObject width="200" height="100"&gt;
        &lt;span style="color:red;"&gt;
          This is not a red circle
        &lt;/span&gt;
     &lt;/foreignObject&gt;
   &lt;/switch&gt;
&lt;/svg&gt;</code>
</pre>
<p>See the actual rendering below:</p>
<p><svg xmlns="http://www.w3.org/2000/svg" version="1.1" width="300px" height="200px"><switch><circle cx="150px" cy="100px" r="50px" fill="#ff0000" stroke="#000000" stroke-width="5px"/><foreignObject width="200" height="100"><span style="color:red;">This is not a red circle</span></foreignObject></switch></svg></p>
]]></content:encoded>
			<wfw:commentRss>http://www.kaizou.org/2009/03/inline-svg-fallback/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
	</channel>
</rss>
