<?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</title>
	<atom:link href="http://www.kaizou.org/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</generator>
		<item>
		<title>Generating custom javascript events</title>
		<link>http://www.kaizou.org/2010/03/generating-custom-javascript-events/</link>
		<comments>http://www.kaizou.org/2010/03/generating-custom-javascript-events/#comments</comments>
		<pubDate>Mon, 29 Mar 2010 18:03:18 +0000</pubDate>
		<dc:creator>David Corvoysier</dc:creator>
				<category><![CDATA[Javascript]]></category>

		<guid isPermaLink="false">http://www.kaizou.org/?p=421</guid>
		<description><![CDATA[HTML 5 introduces many new exciting features, and it is very tempting for the web developer to start buiding pages taking advantage of this new syntax as soon as an early implementation shows up. For those aiming at the masses, it may however be necessary to fill the HTML 5 implementation gaps of some browsers [...]]]></description>
			<content:encoded><![CDATA[<p>HTML 5 introduces many new exciting features, and it is very tempting for the web developer to start buiding pages taking advantage of this new syntax as soon as an early implementation shows up.<br />
For those aiming at the masses, it may however be necessary to fill the HTML 5 implementation gaps of some browsers with custom javascript implementations.<br />
Fair enough, says the web developer: thanks to Javascript extensibility mechanisms, it is easy to add new properties and methods to existing objects and even to create new javascript objects, but what about all these new javascript events ?<br />
Well my friends, since DOM level 2 specification it is possible to <a href="http://www.w3.org/TR/DOM-Level-2-Events/events.html#Events-document">create</a>, <a href="http://www.w3.org/TR/DOM-Level-2-Events/events.html#Events-interface">initialize</a> and <a href="http://www.w3.org/TR/DOM-Level-2-Events/events.html#Events-Registration-interfaces">dispatch</a> custom javascript events.<br />
Basically you can create a javascript event by calling the DOM document <code>createEvent</code> method:</p>
<pre><code>var evt = document.createEvent("Event");
...
var mevt = document.createEvent("MouseEvent");</code></pre>
<p>The <code>createEvent</code> argument defines the <a href="1.6.1. User Interface event types">Event interface</a>:</p>
<ul>
<li><code>UIEvent</code> : for DOMFocusIn, DOMFocusOut &#038; DOMActivate events</li>
<li><code>MouseEvent</code>: for click, mousedown/up/over/move/out</li>
<li><code>MutationEvent</code>: for all DOMXX modification events</li>
<li><code>HTMLEvent</code>: for load, unload, abort, error, select, change, submit, reset, focus, blur, resize, scroll events</li>
<li><code>Event</code>: Any other event</li>
</ul>
<p>Note: You cannot generate a key event<br />
Once you&#8217;ve instantiated an event of a specific type, you can specify its attributes using the corresponding <code>initEvent</code> method:</p>
<pre><code>var evt = document.createEvent("Event");
evt.initEvent("myEvent",true,true);
...
var mevt = document.createEvent("MouseEvent");
mevt.initMouseEvent("click",true,true,...); </code></pre>
<p>The first three parameters are common to all initEvents functions: the first argument specifies the event type, the second indicates if the event can bubble and the third if its default action can be prevented.<br />
Once the event has been created and initialized, it can be dispatched to the document or to a specific node:</p>
<pre><code>var evt = document.createEvent("Event");
evt.initEvent("myEvent",true,true);
document.dispatchEvent(evt);
...
or
...
var target = document.getElementById("myTarget");
target.dispatchEvent(evt);</code></pre>
<p>Of course, you also need to specify an event handler if you actually want to catch this new event:</p>
<pre><code>document.addEventListener("myEvent",myEventHandler,false);
...
or
...
var target = document.getElementById("myTarget");
target.addEventListener("myEvent",myEventHandler,false);</code></pre>
<p><object type="text/html" data="/code/jsevent/index.html"></object></p>
]]></content:encoded>
			<wfw:commentRss>http://www.kaizou.org/2010/03/generating-custom-javascript-events/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>CSS 3 Web Fonts</title>
		<link>http://www.kaizou.org/2009/06/css-3-web-fonts/</link>
		<comments>http://www.kaizou.org/2009/06/css-3-web-fonts/#comments</comments>
		<pubDate>Sun, 21 Jun 2009 15:23:14 +0000</pubDate>
		<dc:creator>David Corvoysier</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[css 3]]></category>

		<guid isPermaLink="false">http://www.kaizou.org/?p=412</guid>
		<description><![CDATA[Among other cool things, CSS 3.0 finally introduces an old feature that had only been implemented so far using proprietary extensions, and therefore did not receive the attention it deserved: Web Fonts ! As specified in the CSS Fonts Module Level 3 specifications, web developers can insert @font-face CSS rules into their stylesheets to specify [...]]]></description>
			<content:encoded><![CDATA[<p>Among other cool things, CSS 3.0 finally introduces an old feature that had only been implemented so far using proprietary extensions, and therefore did not receive the attention it deserved: Web Fonts !
</p>
<p>
As specified in the <a href="http://www.w3.org/TR/css3-webfonts/">CSS Fonts Module Level 3 specifications</a>, web developers can insert @font-face CSS rules into their stylesheets to specify explicitly the location of the font resource corresponding to a font face specified in that stylesheet, thus allowing a consistent rendering of their site.
</p>
<p>
For instance, I use the &#8220;Soviet&#8221; font family for the title of this blog, but this font is not so common, so I inserted the following code in the site main stylesheet:
</p>
<pre>
<code>@font-face {
  font-family: "Soviet";
  src: url("./fonts/Soviet2.ttf") format("truetype");
}</code>
</pre>
<p>
And in the CSS rule corresponding to the site title:
</p>
<pre>
<code>#header h1#logo-text a {
	position: absolute;
	margin: 0; padding: 0;
	font: 56px <span style="font-weight:bold">'Soviet'</span>, 'Trebuchet MS', Sans-serif;
	letter-spacing: -3px;
	text-decoration: none;
	color: #000;
	top: 58px; left: 300px;
}</code>
</pre>
<p>
This causes compatible web browsers to download the Soviet Font from my site and correctly display the site title.
</p>
<p>
Of course, not many web browsers today support Web Fonts (according to my tests, only <a href="http://nightly.webkit.org/">WebKit nightlies</a> have the correct display), but things will change shortly, as Firefox 3.5 should support them.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.kaizou.org/2009/06/css-3-web-fonts/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>HTML 5 offline web applications</title>
		<link>http://www.kaizou.org/2009/04/html-5-offline-web-applications/</link>
		<comments>http://www.kaizou.org/2009/04/html-5-offline-web-applications/#comments</comments>
		<pubDate>Sat, 04 Apr 2009 17:21:21 +0000</pubDate>
		<dc:creator>David Corvoysier</dc:creator>
				<category><![CDATA[HTML]]></category>
		<category><![CDATA[cache]]></category>
		<category><![CDATA[cache-manifest]]></category>
		<category><![CDATA[HTML 5]]></category>
		<category><![CDATA[offline]]></category>
		<category><![CDATA[XHTML]]></category>

		<guid isPermaLink="false">http://www.kaizou.org/?p=355</guid>
		<description><![CDATA[HTML 5 provides a new caching feature to support offline web applications. Basically, you can specify in a specific file called the &#8220;cache manifest&#8221; the caching policy to apply to a particular web page. To activate the HTML 5 caching feature for a specific document, you only need to specify the URI of the cache [...]]]></description>
			<content:encoded><![CDATA[<p>HTML 5 provides a new caching feature to support <a href="http://www.w3.org/TR/offline-webapps/" alt="HTML 5 offline web applications">offline web applications</a>.</p>
<p>Basically, you can specify in a specific file called the &#8220;cache manifest&#8221; the caching policy to apply to a particular web page.</p>
<p>To activate the HTML 5 caching feature for a specific document, you only need to specify the URI of the cache manifest file in the <code>manifest</code> attribute of the <code>&lt;html&gt;</code> element.</p>
<pre>
<code>&lt;!DOCTYPE HTML&gt;
&lt;html manifest="myapp.cache"&gt;
...</code>
</pre>
<p>The file that references the cache manifest file is called the <a href="http://www.whatwg.org/specs/web-apps/current-work/#concept-appcache-master" alt="HTML 5 cache master entry">master entry</a>.</p>
<p>Please note that to be properly parsed by the browser, the manifest file must have a <code>text/cache-manifest</code> MIME type (which means that you will need either to add a custom file type extension binding to your web server or to specify manually the mime-type, for instance using PHP <code>header</code> directive).</p>
<p>A cache manifest file typically looks like this:</p>
<pre>
<code>CACHE MANIFEST
index.html
style.css
images/logo.png

NETWORK:
search.php</code>
</pre>
<p>This file specifies several files to cache (the cache <a href="http://www.whatwg.org/specs/web-apps/current-work/#concept-appcache-explicit" alt="HTML 5 cache explicit entries">explicit entries</a>), and then specifies that search.php should never be cached (it is said to belong to the <a href="http://www.whatwg.org/specs/web-apps/current-work/#concept-appcache-onlinewhitelist" alt="HTML 5 cache online white-list">online white list</a>), so that any attempt to access that file will bypass the cache.</p>
<p>Whenever the user browses to the page corresponding to a document to which a cache manifest is associated, the browser must check on the server if the latter has been modified:</p>
<ul>
<li>If it hasn&#8217;t, then the cached content is used,</li>
<li>If a new version of the cache manifest exists, then the cached content is considered as staled and reloaded from the server.</li>
</ul>
<p>The cache manifest for a document may also contain <a href="http://www.whatwg.org/specs/web-apps/current-work/#concept-appcache-fallback" alt="HTML 5 cache fallback entries">fallback entries</a> that can be used if the browser can&#8217;t retrieve the original content. Below is an example where a static image is used when the retrieval of a dynamically generated image fails:</p>
<pre>
<code>CACHE MANIFEST
FALLBACK:
images/mirror-effect.php server-busy.jpg</code>
</pre>
<p>HTML 5 also defines an <a href="http://www.whatwg.org/specs/web-apps/current-work/#application-cache-api" alt="HTML 5 application cache API">application cache API</a> to manually trigger cache updates:</p>
<ul>
<li><a href="http://www.whatwg.org/specs/web-apps/current-work/#dom-appcache-update" alt="HTML 5 cache update method"><code>update()</code></a>: updates the cache for the current document in the background,</li>
<li><a href="http://www.whatwg.org/specs/web-apps/current-work/#dom-appcache-swapcache" alt="HTML 5 swap cache method"><code>swapCache()</code></a>: reflow the HTML document using updated cached content,</li>
<li><a href="http://www.whatwg.org/specs/web-apps/current-work/#handler-appcache-onupdateready" alt="HTML 5 cache updateready event"><code>onupdateready()</code></a>: event triggered when the cache content has been updated,</li>
<li><a href="http://www.whatwg.org/specs/web-apps/current-work/#handler-appcache-onobsolete" alt="HTML 5 cache obsolete event"><code>onobsolete()</code></a>: event triggered when the cache content has been marked as obsolete,</li>
<li>&#8230;</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.kaizou.org/2009/04/html-5-offline-web-applications/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>HTML 5 &lt;audio&gt; &amp; &lt;video&gt; elements</title>
		<link>http://www.kaizou.org/2009/04/html-5-audio-video-elements/</link>
		<comments>http://www.kaizou.org/2009/04/html-5-audio-video-elements/#comments</comments>
		<pubDate>Fri, 03 Apr 2009 17:08:37 +0000</pubDate>
		<dc:creator>David Corvoysier</dc:creator>
				<category><![CDATA[HTML]]></category>
		<category><![CDATA[XHTML]]></category>
		<category><![CDATA[HTML 5]]></category>

		<guid isPermaLink="false">http://www.kaizou.org/?p=333</guid>
		<description><![CDATA[One of the most revolutionary concept introduced by HTML 5 is the native support of audio and video playback in web pages. Two new HTML elements have been defined for that purpose: &#60;audio&#62; and &#60;video&#62;, based on the generic media element type. Media elements use a common set of attributes: src: defines the source of [...]]]></description>
			<content:encoded><![CDATA[<p>One of the most revolutionary concept introduced by <a href="http://www.w3.org/TR/html5/" alt="HTML W3C specification">HTML 5</a> is the native support of audio and video playback in web pages.</p>
<p>Two new HTML elements have been defined for that purpose: <a href="http://www.w3.org/TR/html5/video.html#audio" alt="HTML 5 audio element"><code>&lt;audio&gt;</code></a> and <a href="http://www.w3.org/TR/html5/video.html#video" alt="HTML 5 video element"><code>&lt;video&gt;</code></a>, based on the generic <a href="http://www.w3.org/TR/html5/video.html#media-element" alt="HTML 5 media elements">media element type</a>.</p>
<p><a href="http://www.w3.org/TR/html5/video.html#media-element" alt="HTML 5 media elements">Media elements</a> use a common set of attributes:</p>
<ul>
<li><a href="http://www.w3.org/TR/html5/video.html#attr-media-src" alt="HTML 5 media element src attribute"><code>src</code></a>: defines the source of the media to render,</li>
<li><a href="http://www.w3.org/TR/html5/video.html#attr-media-autoplay" alt="HTML 5 media element autoplay attribute"><code>autoplay</code></a>: boolean to activate|prevent immediate playback,</li>
<li><a href="http://www.w3.org/TR/html5/video.html#attr-media-loop" alt="HTML 5 media element loop attribute"><code>loop</code></a>: boolean to activate|prevent automatic looping on content,</li>
<li><a href="http://www.w3.org/TR/html5/video.html#attr-media-controls" alt="HTML 5 media element controls attribute"><code>controls</code></a>: boolean to display|hide browser playback user interface.</li>
</ul>
<p><a href="http://www.w3.org/TR/html5/video.html#video" alt="HTML 5 video element"><code>&lt;video&gt;</code></a> and <a href="http://www.w3.org/TR/html5/video.html#audio" alt="HTML 5 audio element"><code>&lt;audio&gt;</code></a> elements can contain elements to be displayed to the user in older browsers that do not support these new elements.</p>
<p>Below is an example of how to use the <a href="http://www.w3.org/TR/html5/video.html#audio" alt="HTML 5 audio element"><code>&lt;audio&gt;</code></a> element:</p>
<pre>
<code>&lt;audio src="audio.ogv" controls width="100" height="50"&gt;
    &lt;a href="audio.ogv"&gt;Listen&lt;/a&gt;
&lt;/audio&gt;</code>
</pre>
<p>Alternatively to the <a href="http://www.w3.org/TR/html5/video.html#attr-media-src" alt="HTML 5 media element src attribute"><code>src</code></a> attribute, the content to be rendered can be specified using one or more <a href="http://www.w3.org/TR/html5/video.html#the-source-element" alt="HTML 5 source element"><code>&lt;source&gt;</code></a> elements, each of them describing a specific <a href="http://www.w3.org/TR/html5/video.html#media-resource" alt="HTML 5 media resource">media resource</a>.</p>
<p>Each <a href="http://www.w3.org/TR/html5/video.html#the-source-element" alt="HTML 5 source element"><code>&lt;source&gt;</code></a> can be identified by its <a href="http://www.w3.org/TR/html5/video.html#attr-media-src" alt="HTML 5 media element src attribute"><code>src</code></a> and <a href="http://www.w3.org/TR/html5/video.html#attr-source-type" alt="HTML 5 source type attribute"><code>type</code></a> attributes, optionally complemented by a <a href="http://www.w3.org/TR/html5/video.html#attr-source-codecs" alt="HTML 5 media element codecs attribute"><code>codecs</code></a> attribute:</p>
<pre>
<code>&lt;audio controls width="100" height="50"&gt;
     &lt;source src="audio.ogg" type="audio/ogg; codecs=vorbis"&gt;
    &lt;source src="audio.spx" type="audio/ogg; codecs=speex"&gt;
    &lt;source src="audio.oga" type="audio/ogg; codecs=flac"&gt;
&lt;/audio&gt;</code>
</pre>
<p>The  <a href="http://www.w3.org/TR/html5/video.html#video" alt="HTML 5 video element"><code>&lt;video&gt;</code></a> element has an optional <a href="http://www.w3.org/TR/html5/video.html#attr-video-poster" alt="HTML 5 video element poster attribute"><code>poster</code></a> attribute that can be used to define an image to be displayed before the video is played:</p>
<pre>
<code>&lt;video src="oggy.ogv" poster="oggy.jpg" /&gt;</code>
</pre>
<p>These new <a href="http://www.w3.org/TR/html5/video.html#media-element" alt="HTML 5 media elements">media elements</a> also support a set of handy javascript method, properties and events, to allow the fine-grained control of the rendered UI.</p>
<ul>
<li><a href="http://www.w3.org/TR/html5/video.html#dom-media-play" title="HTML 5 media play method">play()</a></li>
<li><a href="http://www.w3.org/TR/html5/video.html#dom-media-pause" title="HTML 5 media pause method">pause()</a></li>
<li><a href="http://www.w3.org/TR/html5/video.html#dom-media-currenttime" title="HTML 5 media playback time attribute">currentTime</a>: current playback time,</li>
<li><a href="http://www.w3.org/TR/html5/video.html#dom-media-duration" title="HTML 5 media duration attribute">duration</a>: overall duration of the media,</li>
<li><a href="http://www.w3.org/TR/html5/video.html#dom-media-playbackrate" title="HTML 5 media playback rate attribute">playbackRate</a>: playback speed (can be negative !),</li>
<li><a href="http://www.w3.org/TR/html5/video.html#event-play" title="HTML 5 media play event">onplay()</a>: content has just start playing,</li>
<li><a href="http://www.w3.org/TR/html5/video.html#event-pause" title="HTML 5 media pause event">onpause()</a>: content playback has just been paused,</li>
<li><a href="http://www.w3.org/TR/html5/video.html#event-error" title="HTML 5 media error event">onerror()</a>: an error occurred,</li>
<li>&#8230;</li>
</ul>
<pre>
<code>&lt;script&gt;
function playVideo(url){
     var video = document.getElementById("video");
     video.setAttribute("src",url);
}
&lt;/script&gt;
&lt;video id="videoPlayer" controls=false/&gt;
&lt;p&gt;
     &lt;button type="button"
             onclick="video.playbackRate = -2;"&gt;
         Rew
     &lt;/button&gt;
     &lt;button type="button"
             onclick="video.play();"&gt;
         Play
     &lt;/button&gt;
     &lt;button type="button"
             onclick="video.pause();"&gt;
         Pause
     &lt;/button&gt;
     &lt;button type="button"
                 onclick="video.playbackRate = 2;"&gt;
         FF
     &lt;/button&gt;
&lt;/p&gt;</code>
</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.kaizou.org/2009/04/html-5-audio-video-elements/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Browser HTTP 1.1 caching compliancy test</title>
		<link>http://www.kaizou.org/2009/03/browser-http-11-caching-compliancy-test/</link>
		<comments>http://www.kaizou.org/2009/03/browser-http-11-caching-compliancy-test/#comments</comments>
		<pubDate>Sun, 22 Mar 2009 15:20:21 +0000</pubDate>
		<dc:creator>David Corvoysier</dc:creator>
				<category><![CDATA[HTTP]]></category>
		<category><![CDATA[cache]]></category>
		<category><![CDATA[test]]></category>

		<guid isPermaLink="false">http://www.kaizou.org/?p=310</guid>
		<description><![CDATA[Following a previous post about HTTP 1.1 caching mechanisms, I have been asked whether common browsers were actually compliant or not, so I wrote a little test to verify if at least basic features were supported. The results for your browser will appear in the frame below. Update: This is a new version with cache [...]]]></description>
			<content:encoded><![CDATA[<p>Following a previous post about <a href="/2009/02/http-caching-explained/">HTTP 1.1 caching mechanisms</a>, I have been asked whether common browsers were actually compliant or not, so I wrote a little test to verify if at least basic features were supported.</p>
<p>The results for your browser will appear in the frame below.</p>
<p><object type="text/html" data="/code/cache/index.html"></object></p>
<p>Update: This is a new version with cache headers completely handled by PHP instead of using apache mod_expires. I had to do this because I could&#8217;nt deactivate chunk transfer encoding of pages generated by php on my host, and this prevents HTTP 1.1 caching headers to be inserted by apache &#8230; the test seems to work now, but it is still in beta</p>
]]></content:encoded>
			<wfw:commentRss>http://www.kaizou.org/2009/03/browser-http-11-caching-compliancy-test/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>New HTML 5 block-level elements</title>
		<link>http://www.kaizou.org/2009/03/new-html-5-block-level-elements/</link>
		<comments>http://www.kaizou.org/2009/03/new-html-5-block-level-elements/#comments</comments>
		<pubDate>Mon, 09 Mar 2009 11:59:51 +0000</pubDate>
		<dc:creator>David Corvoysier</dc:creator>
				<category><![CDATA[HTML]]></category>
		<category><![CDATA[XHTML]]></category>
		<category><![CDATA[HTML 5]]></category>

		<guid isPermaLink="false">http://www.kaizou.org/?p=299</guid>
		<description><![CDATA[The HTML 5 specification introduces new block elements that can be used to structure documents: &#60;section&#62;: represents a document or application section (a content column for instance), &#60;article&#62;: represents an independent piece of content inside a document/section (a blog entry for instance), &#60;aside&#62;: represents a piece of content not directly related to the displayed content [...]]]></description>
			<content:encoded><![CDATA[<p>The <a href="http://www.w3.org/TR/html5/" alt="W3C HTML 5 Draft">HTML 5 specification</a> introduces new block elements that can be used to structure documents:</p>
<ul>
<li><a href="http://www.w3.org/TR/html5/semantics.html#the-section-element" alt="HTML 5 section element"><code>&lt;section&gt;</code></a>: represents a document or application section (a content column for instance),</li>
<li><a href="http://www.w3.org/TR/html5/semantics.html#the-article-element" alt="HTML 5 article element"><code>&lt;article&gt;</code></a>: represents an independent piece of content inside a document/section (a blog entry for instance),</li>
<li><a href="http://www.w3.org/TR/html5/semantics.html#the-aside-element" alt="HTML 5 aside element"><code>&lt;aside&gt;</code></a>: represents a piece of content not directly related to the displayed content (typically a sidebar),</li>
<li><a href="http://www.w3.org/TR/html5/semantics.html#the-header-element" alt="HTML 5 header element"><code>&lt;header&gt;</code></a>: represents a document header,</li>
<li><a href="http://www.w3.org/TR/html5/semantics.html#the-footer-element" alt="HTML 5 footer element"><code>&lt;footer&gt;</code></a>: represents a document footer,</li>
<li><a href="http://www.w3.org/TR/html5/semantics.html#the-nav-element" alt="HTML 5 nav element"><code>&lt;nav&gt;</code></a>: represents a block of navigation links (typically a blog navigation bar),</li>
<li><a href="http://www.w3.org/TR/html5/semantics.html#the-dialog-element" alt="HTML 5 dialog element"><code>&lt;dialog&gt;</code></a>: can be used to render a chat session, using complementary <a href="http://www.w3.org/TR/html5/semantics.html#the-dt-element" alt="HTML 5 dt element"><code>&lt;dt&gt;</code></a> (talker) and <a href="http://www.w3.org/TR/html5/semantics.html#the-dt-element" alt="HTML 5 dd element"><code>&lt;dd&gt;</code></a> (quote) tags,</li>
<li><a href="http://www.w3.org/TR/html5/embedded-content-0.html#the-figure-element" alt="HTML 5 figure element"><code>&lt;figure&gt;</code></a>: can be used to provide textual information about an embedded content,</li>
<li><a href="http://www.w3.org/TR/html5/semantics.html#the-address-element" alt="HTML 5 address element"><code>&lt;address&gt;</code></a>: represents a document/section contact block,</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.kaizou.org/2009/03/new-html-5-block-level-elements/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Introducing: HTML 5</title>
		<link>http://www.kaizou.org/2009/03/introducing-html-5/</link>
		<comments>http://www.kaizou.org/2009/03/introducing-html-5/#comments</comments>
		<pubDate>Fri, 06 Mar 2009 15:05:32 +0000</pubDate>
		<dc:creator>David Corvoysier</dc:creator>
				<category><![CDATA[HTML]]></category>
		<category><![CDATA[XHTML]]></category>
		<category><![CDATA[whatwg]]></category>

		<guid isPermaLink="false">http://www.kaizou.org/?p=281</guid>
		<description><![CDATA[The HTML version you are using everyday is HTML 4.0.1, defined back in 1999 by the W3C. Its XML counterpart is XHTML 1.1, successor of XHTML 1.0 defined in 2000 and revised in 2002 by the W3C. The newest XHTML 2.0 was at first meant to replace both, but the fact that it was not [...]]]></description>
			<content:encoded><![CDATA[<p>The HTML version you are using everyday is <a href="http://www.w3.org/TR/html401/" alt="W3C HTML 4.0.1 specification">HTML 4.0.1</a>, defined back in 1999 by the W3C.</p>
<p>Its XML counterpart is <a href="http://www.w3.org/TR/xhtml11/" alt="W3C XHTML 1.1 specification">XHTML 1.1</a>, successor of <a href="http://www.w3.org/TR/xhtml1/" alt="W3C XHTML 1.0 specification">XHTML 1.0</a> defined in 2000 and revised in 2002 by the W3C.</p>
<p>The newest XHTML 2.0 was at first meant to replace both, but the fact that it was not compatible with XHTML 1.1 raised quite a controversy.</p>
<p>This, added to the fact that some major internet companies and non-profit organizations wanted to expand the typical browser experience to include other internet usages like messaging and media playback led to the creation of the <a href="http://www.whatwg.org/" title="Web Hypertext Application Technology Working Group">Web Hypertext Application Technology Working Group</a> (WHATWG), that released in 2005 the first version of the <a href="http://www.whatwg.org/specs/web-apps/current-work/" alt="WHATWG HTML 5 specification">HTML 5 specification</a>.</p>
<p>The W3C started in 2007 a new HTML working group that took the WHATWG HTML 5 specification as a basis, leading to the publication of the first <a href="http://www.w3.org/TR/html5/" alt="HTML 5 W3C working draft">HTML 5 draft</a> in 2008.</p>
<p>The W3C HTML 5 working group is led by <a href="http://ln.hixie.ch/" alt="Hixie">Ian Hickson</a> from Google, Inc (WHATWG HTML 5 specification editor, CSS 2.1 co-editor, <a href="http://acid2.acidtests.org/#top" alt="Acid 2 CSS test">Acid2</a> and <a href="http://acid3.acidtests.org/#top" alt="Acid 3 CSS test">Acid3</a> developer) and <a href="http://webkit.org/blog/" alt="Surfin' Safari">David Hyatt</a> from Apple, Inc (Safari/Webkit project leader, Firefox co-founder).</p>
<p>The HTML 5 specification defines both HTML and XHTML document types.</p>
<p>The W3C maintains a list of <a href="http://dev.w3.org/html5/html4-differences/" alt="HTML 5 differences from HTML 4">differences between HTML 5 and HTML 4</a>.</p>
<p>I will try to explain these differences in separate posts:</p>
<ul>
<li><a href="/2009/03/new-html-5-block-level-elements/" alt="New HTML 5 block elements"><code>&lt;section&gt;</code> and associated new block-level elements</a>,</li>
<li><a href="/2009/04/html-5-audio-video-elements/" alt="HTML 5 audio and video elements"><code>&lt;audio&gt;</code> &#038; <code>&lt;video&gt;</code> elements</a>,</li>
<li><a href="/2009/04/html-5-offline-web-applications/" alt="HTML 5 offline web applications">offline web applications</a>,</li>
<li> &#8230; TBC &#8230;</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.kaizou.org/2009/03/introducing-html-5/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Differences between strict &amp; transitional (X)HTML</title>
		<link>http://www.kaizou.org/2009/03/differences-between-strict-transitional-xhtml/</link>
		<comments>http://www.kaizou.org/2009/03/differences-between-strict-transitional-xhtml/#comments</comments>
		<pubDate>Fri, 06 Mar 2009 14:03:16 +0000</pubDate>
		<dc:creator>David Corvoysier</dc:creator>
				<category><![CDATA[HTML]]></category>
		<category><![CDATA[XHTML]]></category>
		<category><![CDATA[strict]]></category>
		<category><![CDATA[transitional]]></category>

		<guid isPermaLink="false">http://www.kaizou.org/?p=253</guid>
		<description><![CDATA[HTML and XHTML exist today in two flavors: strict and transitional. By default, a lot of editing tools or CMS use the transitional model. This is a shame because it may lead people to use a deprecated HTML syntax for presenting content instead of using CSS. This will lead to future incompatibilities and extensive use [...]]]></description>
			<content:encoded><![CDATA[<p>HTML and XHTML exist today in two flavors: strict and transitional. By default, a lot of editing tools or CMS use the transitional model.</p>
<p>This is a shame because it may lead people to use a deprecated HTML syntax for presenting content instead of using CSS. This will lead to future incompatibilities and extensive use of the <a href="http://en.wikipedia.org/wiki/Quirks_mode" alt="Quirks mode">&#8220;Quirks mode&#8221;</a>. </p>
<p>I will summarize below the main differences between the strict and transitional models. Then, the reader may be able to figure out whether he can safely switch to (X)HTML strict or not.</p>
<h3>Elements only allowed in transitional (X)HTML</h3>
<p>The list below has been compiled using this full <a href="http://www.blackwidows.co.uk/resources/tutorials/xhtml/element-comparison.php" alt="XHTML 1.0 Element Comparison by DTD">XHTML doctypes element comparison</a></p>
<ul>
<li><code>applet</code>,</li>
<li><code>basefont</code>,</li>
<li><code>center</code>,</li>
<li><code>dir</code>,</li>
<li><code>font</code>,</li>
<li><code>frame</code>,</li>
<li><code>frameset</code>,</li>
<li><code>iframe</code>,</li>
<li><code>isindex</code>,</li>
<li><code>menu</code>,</li>
<li><code>noframes</code>,</li>
<li><code>s</code>,</li>
<li><code>strike</code>,</li>
<li><code>u</code>,</li>
</ul>
<p>Today, only the iframe element is still used widespread, despite the fact that it can be replaced by <code>object</code>.</p>
<h3>Attributes only allowed in transitional (X)HTML</h3>
<p>The list below has been compiled using this full <a href="http://www.blackwidows.co.uk/resources/tutorials/xhtml/attributes-comparison.php" alt="XHTML1.0 Element Attributes by DTD">XHTML doctypes element attributes comparison</a></p>
<ul>
<li><code>align</code> in anything but tables-related elements,</li>
<li><code>alink</code>,</li>
<li><code>background</code>,</li>
<li><code>bgcolor</code>,</li>
<li><code>border</code>,</li>
<li><code>color</code>,</li>
<li><code>compact</code>,</li>
<li><code>dir</code>,</li>
<li><code>face</code>,</li>
<li><code>frameborder</code>,</li>
<li><code>height</code>,</li>
<li><code>hspace</code>,</li>
<li><code>ismap</code>,</li>
<li><code>height</code>,</li>
<li><code>lang</code>,</li>
<li><code>link</code>,</li>
<li><code>noshade</code>,</li>
<li><code>nowrap</code>,</li>
<li><code>object</code>,</li>
<li><code>size</code>,</li>
<li><code>start</code>,</li>
<li><code>target</code> on anchors <code>a</code>,</li>
<li><code>text</code>,</li>
<li><code>type</code>,</li>
<li><code>version</code>,</li>
<li><code>vlink</code>,</li>
<li><code>vspace</code>,</li>
<li><code>width</code>.</li>
</ul>
<p>As you can see, most of these attributes can easily be replaced by CSS rules. The only one that is still used widespread is <code>a.target</code>. In my humble opinion, this is not a problem, because you should not decide to open a link in a new window on behalf of the user. Anyway, if you really want to do that, you can still use javascript.</p>
<h3>Document structure constraints in strict (X)HTML</h3>
<p>The <code>body</code>, <code>blockquote</code> and <code>form</code> must only contain block-lebel elements like <code>div</code> or <code>span</code>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.kaizou.org/2009/03/differences-between-strict-transitional-xhtml/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Choosing the proper DOCTYPE</title>
		<link>http://www.kaizou.org/2009/03/choosing-the-proper-doctype/</link>
		<comments>http://www.kaizou.org/2009/03/choosing-the-proper-doctype/#comments</comments>
		<pubDate>Fri, 06 Mar 2009 12:47:37 +0000</pubDate>
		<dc:creator>David Corvoysier</dc:creator>
				<category><![CDATA[HTML]]></category>
		<category><![CDATA[XHTML]]></category>
		<category><![CDATA[doctype]]></category>
		<category><![CDATA[strict]]></category>
		<category><![CDATA[transitional]]></category>

		<guid isPermaLink="false">http://www.kaizou.org/?p=234</guid>
		<description><![CDATA[I have been recently asked to tell the differences between HTML 4.0, XHTML 1.0 and HTML 5.0, and I had to dig in the specifications to provide an answer. Doing this, I realized that I did not really pay attention to the DOCTYPE declarations in my web pages so far, possibly leading to unexpected behaviours [...]]]></description>
			<content:encoded><![CDATA[<p>I have been recently asked to tell the differences between HTML 4.0, XHTML 1.0 and HTML 5.0, and I had to dig in the specifications to provide an answer. Doing this, I realized that I did not really pay attention to the DOCTYPE declarations in my web pages so far, possibly leading to unexpected behaviours in some browsers (see the very detailed article on Wikipedia about <a href="http://en.wikipedia.org/wiki/Quirks_mode" alt="Quirks mode">Quirks mode</a>.</p>
<p>To be short, HTML documents must start with a DOCTYPE declaration that is used by the browser to choose the appropriate rendering. It allows in particular to distinguish between real HTML documents and XHTML documents served as <code>text/html</code> to non-XHTML browsers (though required by the XHTML specification, the DOCTYPE declaration is actually redundant with the namepace declaration if the document is served as <code>application/xhtml+xml</code>).</p>
<p>The current HTML specification is <a href="http://www.w3.org/TR/html401/" alt="W3C HTML 4.01 specification">HTML 4.01</a> (1999). It defines three document types:</p>
<ul>
<li>HTML 4.01 strict, that relies entirely on CSS for presentation</li>
<li>HTML 4.01 transitional, that still allows <a href="/2009/03/differences-between-strict-transitional-xhtml/" alt="Differences between strict &#038; transitional (X)HTML">deprecated presentational markup</a></li>
<li>HTML 4.01 frameset, that must only be used to declare framesets</li>
</ul>
<p>In a first attempt to replace HTML 4.01, the W3C has defined <a href="http://www.w3.org/TR/xhtml1/" alt="W3C XHTML 1.0 specification">XHTML 1.0</a> (2000-2002), that redefines HTML 4.01 using a strict XML syntax. Unsurprisingly, XHTML 1.0 also defines three document types:</p>
<ul>
<li>XHTML 1.0 strict, that is exactly HTML 4.01 strict with closing tags,</li>
<li>XHTML 1.0 transitional, that is exactly HTML 4.01 transitional with closing tags,</li>
<li>XHTML 1.0 frameset, that must only be used to declare framesets.</li>
</ul>
<p>In a later standardization effort, the W3C produced <a href="http://www.w3.org/TR/xhtml11/" alt="W3C XHTML 1.1 Working Draft">XHTML 1.1</a> (WIP), that doesn&#8217;t add much, but defines only a strict DOCTYPE.</p>
<p>To summarize, when developing a new page, the first thing you need to decide is if you go for HTML or XHTML. My recommendation is to always choose HTML unless you really need XHTML (for instance because you want to add <a href="/2009/02/svg-inline-in-xhtml/" alt="SVG inline in XHTML">inline SVG</a>).</p>
<p>Then, in both cases, unless you really need to use the <a href="http://www.kaizou.org/2009/03/differences-between-strict-transitional-xhtml/" alt="Differences between strict &#038; transitional (X)HTML">deprecated HTML syntax</a>, then use the strict DOCTYPE.</p>
<h3>HTML</h3>
<p><code>&lt;!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"&gt;</code></p>
<h3>XHTML</h3>
<p><code>&lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"&gt;</code></p>
<p>Please note that according to the W3C XHTML guidelines, the XML declaration (<code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;</code>) should be omitted, as it triggers quirks mode in older versions of Internet Explorer. This is only a problem if you need to specify a different character encoding than UTF-8 (the default).</p>
]]></content:encoded>
			<wfw:commentRss>http://www.kaizou.org/2009/03/choosing-the-proper-doctype/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<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>
