<?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>行動記録 &#187; html5</title>
	<atom:link href="http://iwaim.beering.be/blog/tag/html5/feed" rel="self" type="application/rss+xml" />
	<link>http://iwaim.beering.be/blog</link>
	<description>iwaimの行動記録など</description>
	<lastBuildDate>Sat, 16 Jan 2010 07:50:34 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9</generator>
	<language>ja</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>HTML5でのタグの省略は結構考えられている件</title>
		<link>http://iwaim.beering.be/blog/2010/01/16/35.html</link>
		<comments>http://iwaim.beering.be/blog/2010/01/16/35.html#comments</comments>
		<pubDate>Sat, 16 Jan 2010 07:50:34 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[ウェブ]]></category>
		<category><![CDATA[html5]]></category>

		<guid isPermaLink="false">http://iwaim.beering.be/blog/?p=35</guid>
		<description><![CDATA[HTML5は執筆時点でまだ勧告されていないので、まだまだ変わる可能性はあるんだけど書いておく。昨日(いつ)「ブログも更新しないし」とか言われたので。なお、本エントリで参照しているものはHTML5 A vocabulary [...]]]></description>
			<content:encoded><![CDATA[<p>HTML5は執筆時点でまだ勧告されていないので、まだまだ変わる可能性はあるんだけど書いておく。昨日(いつ)「ブログも更新しないし」とか言われたので。なお、本エントリで参照しているものは<a href="http://www.w3.org/TR/2009/WD-html5-20090825/">HTML5 A vocabulary and associated APIs for HTML and XHTML W3C Working Draft 25 August 2009</a>です。一応Editor&#8217;s Draft 13 January 2010がでてて、それも確認したけど、該当部分に大きな変更はなかったし。</p>
<p>で、本題。SGMLアプリケーションであるHTML4は、SGML宣言で「OMITTAG YES」とされていたことから、タグの省略が可能となっている。例えばhead要素の終了タグとbody要素の開始タグを省略した次のようなHTML文書は仕様に適合している。</p>
<pre class="brush: html; auto-links: false;">&lt;!DOCTYPE html PUBLIC &quot;-//W3C//DTD HTML 4.0//EN&quot;
        &quot;http://www.w3.org/TR/REC-html40/strict.dtd&quot;&gt;
&lt;html&gt;
&lt;head&gt;
&lt;title&gt;自明でないと省略できません&lt;/title&gt;

&lt;script type=&quot;text/javascript&quot;&gt;
&lt;!--謎のスクリプト--&gt;
&lt;/script&gt;

&lt;p&gt;本文なのですが。&lt;/p&gt;
&lt;/body&gt;
&lt;/html&gt;</pre>
<p>で、これがどのような理由で仕様に適合しているのかは結構ややこしい。理由はsatoshiiさんによる<a href="http://www.satoshii.org/markup/notes/2003/12#date12">Re: SGML の省略タグ機構</a>に詳しい。</p>
<p>ここでHTML5に話を移す。HTML5では、SGMLアプリケーションだったHTML4とは異なり、SGMLアプリケーション<em>ではない</em>という道を選んだ。このことにより、HTML5では仕様自体にタグの省略についての取り決めも盛り込むことになった。W3C Working Draft 25 August 2009では<a href="http://www.w3.org/TR/2009/WD-html5-20090825/syntax.html#optional-tags">9.1.2.4 Optional tags</a>の箇所である。</p>
<p>HTML5の仕様では、HTML4よりもタグの省略に関しては結構限定されてしまっているとも言えるが、省略可能な状況をすべて列挙しているため、とても解しやすくなっている。</p>
<p>最近、<a href="http://twitter.com/futomi/status/7741823546">一部で話題となっている</a>http://html5.us/のHTML文書は、執筆時点では次のようになっている。</p>
<pre class="brush: html; auto-links: false;">&lt;!DOCTYPE html&gt;
&lt;title&gt;html5.us&lt;/title&gt;
&lt;style&gt;pre{font-family:courier,monospace;font-size:48px;margin:5% auto;text-align:center;width:50%;}&lt;/style&gt;
&lt;pre&gt;&lt;code&gt;&amp;lt;!doctype html&amp;gt;&lt;/code&gt;&lt;/pre&gt;</pre>
<p>これは、先に例示したHTML4のコードと結構似ている構造だが、これが仕様に適合しているというのは、仕様を軽く読むだけで容易に理解可能となっている。</p>
<p>このような仕様になった議論は全然調べてないけど、列挙してしまうというのはかなり思い切った方針だと思うし、列挙しているそれぞれの条件についても読んでみると結構考えられているように思う。すごいなあ。</p>
]]></content:encoded>
			<wfw:commentRss>http://iwaim.beering.be/blog/2010/01/16/35.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>HTML5ではbody要素がセクションを作る</title>
		<link>http://iwaim.beering.be/blog/2009/12/05/6.html</link>
		<comments>http://iwaim.beering.be/blog/2009/12/05/6.html#comments</comments>
		<pubDate>Sat, 05 Dec 2009 05:53:34 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[ウェブ]]></category>
		<category><![CDATA[html5]]></category>

		<guid isPermaLink="false">http://iwaim.beering.be/blog/?p=6</guid>
		<description><![CDATA[HTML5ではbody要素もセクションを作ります。というのをうっかり忘れてて、次のように書いてしまってた。
これだと当然無名なセクションが作られてしまう。例えばHTML 5 Outlinerを使うと次のように表示される。 [...]]]></description>
			<content:encoded><![CDATA[<p>HTML5ではbody要素もセクションを作ります。というのをうっかり忘れてて、次のように書いてしまってた。</p>
<pre class="brush: html; auto-links: false;">&lt;body&gt;
&lt;article&gt;
&lt;header&gt;
&lt;hgroup&gt;
&lt;h1&gt;&lt;a href=&quot;http://iwaim.beering.be/blog/&quot;&gt;行動記録&lt;/a&gt;&lt;/h1&gt;
&lt;h2&gt;再開&lt;/h2&gt;
&lt;/hgroup&gt;</pre>
<p>これだと当然無名なセクションが作られてしまう。例えば<a href="http://gsnedders.html5.org/outliner/">HTML 5 Outliner</a>を使うと次のように表示される。</p>
<blockquote cite="http://gsnedders.html5.org/outliner/process.py?url=http://iwaim.beering.be/blog/2009/12/01/1.html">
<pre class="brush: html; auto-links: false;">&lt;ol&gt;&lt;li&gt;&lt;i&gt;Untitled Section&lt;/i&gt;&lt;ol&gt;&lt;li&gt;行動記録&lt;/li&gt;&lt;/ol&gt;&lt;/li&gt;&lt;/ol&gt; </pre>
</blockquote>
<p>無名セクションを作ってしまわないためには、このようにマークアップしないとまずい。</p>
<pre class="brush: html; auto-links: false;">&lt;body&gt;
&lt;header&gt;
&lt;h1&gt;&lt;a href=&quot;http://iwaim.beering.be/blog/&quot;&gt;行動記録&lt;/a&gt;&lt;/h1&gt;
&lt;/header&gt;
&lt;article&gt;
&lt;header&gt;
&lt;h2&gt;再開&lt;/h2&gt; </pre>
<p>慣れるまで忘れがちなので、戒めのために記録しておく。</p>
]]></content:encoded>
			<wfw:commentRss>http://iwaim.beering.be/blog/2009/12/05/6.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
