<?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>HTML 5 &#187; Syntax</title>
	<atom:link href="http://www.htmlfive.net/category/syntax/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.htmlfive.net</link>
	<description>A central location for HTML5 news and updates</description>
	<lastBuildDate>Tue, 31 Aug 2010 10:55:33 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.6</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>XHTML5 in a nutshell</title>
		<link>http://www.htmlfive.net/xhtml5-in-a-nutshell/</link>
		<comments>http://www.htmlfive.net/xhtml5-in-a-nutshell/#comments</comments>
		<pubDate>Sun, 25 Jul 2010 05:51:58 +0000</pubDate>
		<dc:creator>Sergey Mavrody</dc:creator>
				<category><![CDATA[Syntax]]></category>
		<category><![CDATA[WHATWG]]></category>
		<category><![CDATA[What's Next]]></category>

		<guid isPermaLink="false">http://blog.whatwg.org/?p=2878</guid>
		<description><![CDATA[The WHATWG Wiki portal has a nice section describing HTML vs. XHTML differences, as well as specifics of a polyglot HTML document that also would be able to serve HTML5 document as valid XML document. I'd like to review what it takes to transform an HTML5 polyglot document into a valid XHTML5 document: it appears, [...]]]></description>
			<content:encoded><![CDATA[<p>The WHATWG Wiki portal has a nice section describing HTML vs. XHTML differences, as well as specifics of a polyglot HTML document that also would be able to serve HTML5 document as valid XML document. I'd like to review what it takes to transform an HTML5 polyglot document into a valid XHTML5 document: it appears, finally the 'XHTML5' has become an official name.</p>

<p>The W3C first public working draft of "Polyglot Markup" recommendation describes <em>polyglot </em>HTML document as a document that conforms to both the HTML and XHTML syntax by using a common subset of both the HTML and XHTML and in a nutshell the HTML5 polyglot document is:</p>
<ul>
	<li>HTML5 doctype/namespace</li>
	<li>XHTML well-formed syntax</li>
</ul>
Polyglot document could serve as either HTML or XHTML, depending on browser support and MIME type. A polyglot HTML5 code essentially becomes XHTML5 document if it is served with the XML MIME type <code>application/xhtml+xml</code> .

In a nutshell the XHTML5 document is:
<ul>
	<li>HTML doctype/namespace: The <code>&lt;!DOCTYPE html&gt;</code>
definition is optional, but it would be useful in a polyglot document by  preventing browser quirks mode.</li>
	<li>XHTML well-formed syntax</li>
	<li>XML MIME type: <code> application/xhtml+xml</code>.
This MIME declaration is not visible in the source code, but it would appear in the HTTP Content-Type header that could be configured on the server. Of course, the XML MIME type is not yet supported by the current version Internet Explorer though IE can render XHTML documents.</li>
	<li>Default XHTML namespace: <code>&lt;html xmlns="http://www.w3.org/1999/xhtml"&gt;</code></li>
	<li>Secondary namespace such as SVG, MathML, Xlink, etc. To me this is like a test, if you don’t have a need for these namespaces  in your document, then the use of XHTML is overkill in the first place.</li>
</ul>
Finally, the basic XHTML5 document would look like this:
<div style="margin-top: 15px;padding: 0 40px">
<blockquote><code> </code>
<div><span style="color: #888888">&lt;!DOCTYPE html&gt;</span></div>
<code> </code>
<div>&lt;html xmlns="http://www.w3.org/1999/xhtml"&gt;</div>
<code> </code>
<div style="padding-left: 15px">&lt;head&gt;</div>
<code> </code>
<div style="padding-left: 30px">&lt;title&gt;&lt;/title&gt;</div>
<div style="padding-left: 30px"><span style="color: #888888">&lt;meta charset="UTF-8" /&gt;</span></div>
<p style="padding-left: 15px">&lt;/head&gt;</p>
<code> </code>
<div style="padding-left: 15px">&lt;body&gt;</div>
<div>
<div>
<div style="padding-left: 30px"><span style="color: #888888">&lt;svg xmlns="http://www.w3.org/2000/svg"&gt;</span></div>
<div style="padding-left: 60px"><span style="color: #999999">&lt;rect stroke="black" fill="blue" x="45px" y="45px" width="200px" height="100px" stroke-width="2" /&gt;</span></div>
<div style="padding-left: 30px"><span style="color: #888888">&lt;/svg&gt;</span></div>
</div>
</div>
<div style="padding-left: 15px">&lt;/body&gt;</div>
<div>&lt;/html&gt;</div></blockquote>
</div>
<p>The XML declaration <code>&lt;?xml version=”1.0” encoding=”UTF-8”?&gt;</code> is not required if the default UTF-8 encoding is used: an XHTML5 validator would not mind if it is omitted. However it is strongly recommended to configure the encoding using server HTTP <code>Content-Type</code> header, otherwise this character encoding could be included in the document as part of a meta tag <code>&lt;meta charset="UTF-8" /&gt;</code>. This encoding declaration would be needed for a polyglot document so that it will be treated as UTF-8 if served as either HTML or XHTML.</p>

<p>The <em>Total Validator Tool</em> - Firefox plugin/desktop app has now the user-selectable option for XHTML5-specific  validation.</p>
<p style="margin-bottom: 40px">I would say that the main advantage of using XHTML5 would be the ability to extend HTML5 to XML-based technologies such as SVG and MathML. The disadvantage is the lack of Internet Explorer support, more verbose code, and error handling. Unless we need that extensibility, HTML5 is the way to go.</p>]]></content:encoded>
			<wfw:commentRss>http://www.htmlfive.net/xhtml5-in-a-nutshell/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>HTML5 Rationale document</title>
		<link>http://www.htmlfive.net/html5-rationale-document/</link>
		<comments>http://www.htmlfive.net/html5-rationale-document/#comments</comments>
		<pubDate>Mon, 10 May 2010 17:15:46 +0000</pubDate>
		<dc:creator>Eitan Adler</dc:creator>
				<category><![CDATA[Syntax]]></category>
		<category><![CDATA[WHATWG]]></category>

		<guid isPermaLink="false">http://blog.whatwg.org/?p=2443</guid>
		<description><![CDATA[I've started a page on the wiki to document the rationale for the decisions made about the HTML specification. There are two goals for this document: Explain why things are the way they are Explain the difference between multiple similar elements by providing example usages. One person can not possibly write the entire thing so [...]]]></description>
			<content:encoded><![CDATA[<p>I've started a page on the wiki to document the <a href="http://wiki.whatwg.org/wiki/index.php?title=Rationale">rationale</a> for the decisions made about the HTML specification. </p>

<p>There are two goals for this document:
<ol>
<li>Explain why things are the way they are</li>
<li>Explain the difference between multiple similar elements by providing example usages.</li>
</ol>
</p>

<p>One person can not possibly write the entire thing so I hope that this becomes a group process where anyone interested can contribute so go <a href="http://wiki.whatwg.org/index.php?title=Special:UserLogin&amp;type=signup">sign up</a>, <a href="http://wiki.whatwg.org/index.php?title=Special:UserLogin">log in,</a> and <a href="http://wiki.whatwg.org/index.php?title=Rationale&amp;action=edit">edit</a><!--???,PROFIT-->.</p>]]></content:encoded>
			<wfw:commentRss>http://www.htmlfive.net/html5-rationale-document/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Validator.nu HTML Parser 1.2.0</title>
		<link>http://www.htmlfive.net/validatornu-html-parser-120/</link>
		<comments>http://www.htmlfive.net/validatornu-html-parser-120/#comments</comments>
		<pubDate>Fri, 27 Mar 2009 15:40:13 +0000</pubDate>
		<dc:creator>Henri Sivonen</dc:creator>
				<category><![CDATA[Processing Model]]></category>
		<category><![CDATA[Syntax]]></category>

		<guid isPermaLink="false">http://blog.whatwg.org/?p=639</guid>
		<description><![CDATA[<p>I put together a new release of the <a href="http://about.validator.nu/htmlparser/">Validator.nu HTML Parser</a>. This is a highly recommended update for everyone who is using a previous version the parser in an application.</p>
<ul>

<li>Fixed an issue where under rare circumstances attribute values were leaking into element content.</li>

<li>Fixed a bug where <code>isindex</code> processing added attributes to all elements that were supposed to have no attributes.</li>

<li>Implemented spec changes. (Too numerous to enumerate, but, as a highlight, framesets parse much better now.)</li>

<li>Moved to WebKit-style foster parenting.</li>

<li>Changed the API for tree builder subclasses again due to new constraints. If you have previously written your own tree builder subclass, you need to change it.</li>

<li>Fixed the bundled XML serializer.</li>

<li>Made it possible to generate a C++ version that does not leak memory from the Java source.</li>

<li>Removed the C++ translator from the release. (Get it from SVN.)</li>

</ul>
]]></description>
			<content:encoded><![CDATA[<p>I put together a new release of the <a href="http://about.validator.nu/htmlparser/">Validator.nu HTML Parser</a>. This is a highly recommended update for everyone who is using a previous version the parser in an application.</p>
<ul>

<li>Fixed an issue where under rare circumstances attribute values were leaking into element content.</li>

<li>Fixed a bug where <code>isindex</code> processing added attributes to all elements that were supposed to have no attributes.</li>

<li>Implemented spec changes. (Too numerous to enumerate, but, as a highlight, framesets parse much better now.)</li>

<li>Moved to WebKit-style foster parenting.</li>

<li>Changed the API for tree builder subclasses again due to new constraints. If you have previously written your own tree builder subclass, you need to change it.</li>

<li>Fixed the bundled XML serializer.</li>

<li>Made it possible to generate a C++ version that does not leak memory from the Java source.</li>

<li>Removed the C++ translator from the release. (Get it from SVN.)</li>

</ul>
<p></p><p>This item was originally posted at: <a href='http://blog.whatwg.org'>http://blog.whatwg.org</a> and is licensed under the <a href='http://www.opensource.org/licenses/mit-license.php'>MIT license</a></p>]]></content:encoded>
			<wfw:commentRss>http://www.htmlfive.net/validatornu-html-parser-120/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Supporting New Elements in IE</title>
		<link>http://www.htmlfive.net/supporting-new-elements-in-ie/</link>
		<comments>http://www.htmlfive.net/supporting-new-elements-in-ie/#comments</comments>
		<pubDate>Wed, 07 Jan 2009 16:26:28 +0000</pubDate>
		<dc:creator>Lachlan Hunt</dc:creator>
				<category><![CDATA[Browsers]]></category>
		<category><![CDATA[DOM]]></category>
		<category><![CDATA[Elements]]></category>
		<category><![CDATA[Events]]></category>
		<category><![CDATA[Syntax]]></category>

		<guid isPermaLink="false">http://blog.whatwg.org/?p=484</guid>
		<description><![CDATA[<p>Internet Explorer poses a small challenge when it comes to making use of the new elements introduced in HTML5.  Among others, these include elements like <code>section</code>, <code>article</code>, <code>header</code> and <code>footer</code>. The problem is that due to the way parsing works in IE, these elements are not recognised properly and result in an anomalous DOM representation.</p>

<p>To illustrate, consider this simple document fragment:</p>

<pre>&#60;body&#62;
  &#60;section&#62;
    &#60;p&#62;This is an example&#60;/p&#62;
  &#60;/section&#62;
&#60;/body&#62;</pre>

<p>Strangely, IE 6, 7 and 8 all fail to parse the <code>section</code> element properly and the resulting DOM looks like this.</p>

<ul>
	<li><code>BODY</code>
		<ul>
			<li><code>SECTION</code></li>
			<li><code>P</code>
				<ul>
					<li><code>#text</code>: This is an example</li>
				</ul>
			</li>
			<li><code>/SECTION</code></li>
		</ul>
	</li>
</ul>

<p>Notice how IE actually creates 2 empty elements.  One named <code>SECTION</code> and the other named <code>/SECTION</code>. Yes, it really is parsing the end tag as a start tag for an unknown empty element.</p>

<p>There is a handy workaround available to address this problem, which was first revealed in <a href="http://intertwingly.net/blog/2008/01/22/Best-Standards-Support#c1201006277">a comment by Sjoerd Visscher</a>.

The basic concept is that by using <code>document.createElement(<var>tagName</var>)</code> to create each of the unknown elements, the parser in IE then recognises those elements and parses them in a more reasonable and useful way. e.g. By using the following script:</p>

<pre>document.createElement("section");</pre>

<p>The resulting DOM for the fragment given above looks like this:</p>

<ul>
	<li><code>BODY</code>
		<ul>
			<li><code>section</code>
				<ul>
					<li><code>P</code>
						<ul>
							<li><code>#text</code>: This is an example</li>
						</ul>
					</li>
				</ul>
			</li>
		</ul>
	</li>
</ul>

<p>This same technique works for all unknown elements in IE 6, 7 and 8.  Note that there is a known bug that prevented this from working in IE 8 beta 2, but this has since been resolved in the latest non-public technical preview.</p>

<p>For convenience, Remy Sharp has written and <a href="http://remysharp.com/2009/01/07/html5-enabling-script/">published a simple script</a> that provides this enhancement for all new elements in the current draft of HTML5, which you can download and use.</p>

<p>This script is not needed for other browsers. Opera 9, Firefox 3 and Safari 3 all parse unknown elements in a more reasonable way by default. Note, however, that Firefox 2 does suffer from some related problems, for which there is unfortunately no known solution; but it is hoped that given the faster upgrade cycle for users of Firefox, relatively speaking compared with IE, Firefox 2 won't pose too much of a problem in the future.</p>]]></description>
			<content:encoded><![CDATA[<p>Internet Explorer poses a small challenge when it comes to making use of the new elements introduced in HTML5.  Among others, these include elements like <code>section</code>, <code>article</code>, <code>header</code> and <code>footer</code>. The problem is that due to the way parsing works in IE, these elements are not recognised properly and result in an anomalous DOM representation.</p>

<p>To illustrate, consider this simple document fragment:</p>

<pre>&lt;body&gt;
  &lt;section&gt;
    &lt;p&gt;This is an example&lt;/p&gt;
  &lt;/section&gt;
&lt;/body&gt;</pre>

<p>Strangely, IE 6, 7 and 8 all fail to parse the <code>section</code> element properly and the resulting DOM looks like this.</p>

<ul>
	<li><code>BODY</code>
		<ul>
			<li><code>SECTION</code></li>
			<li><code>P</code>
				<ul>
					<li><code>#text</code>: This is an example</li>
				</ul>
			</li>
			<li><code>/SECTION</code></li>
		</ul>
	</li>
</ul>

<p>Notice how IE actually creates 2 empty elements.  One named <code>SECTION</code> and the other named <code>/SECTION</code>. Yes, it really is parsing the end tag as a start tag for an unknown empty element.</p>

<p>There is a handy workaround available to address this problem, which was first revealed in <a href="http://intertwingly.net/blog/2008/01/22/Best-Standards-Support#c1201006277">a comment by Sjoerd Visscher</a>.

The basic concept is that by using <code>document.createElement(<var>tagName</var>)</code> to create each of the unknown elements, the parser in IE then recognises those elements and parses them in a more reasonable and useful way. e.g. By using the following script:</p>

<pre>document.createElement("section");</pre>

<p>The resulting DOM for the fragment given above looks like this:</p>

<ul>
	<li><code>BODY</code>
		<ul>
			<li><code>section</code>
				<ul>
					<li><code>P</code>
						<ul>
							<li><code>#text</code>: This is an example</li>
						</ul>
					</li>
				</ul>
			</li>
		</ul>
	</li>
</ul>

<p>This same technique works for all unknown elements in IE 6, 7 and 8.  Note that there is a known bug that prevented this from working in IE 8 beta 2, but this has since been resolved in the latest non-public technical preview.</p>

<p>For convenience, Remy Sharp has written and <a href="http://remysharp.com/2009/01/07/html5-enabling-script/">published a simple script</a> that provides this enhancement for all new elements in the current draft of HTML5, which you can download and use.</p>

<p>This script is not needed for other browsers. Opera 9, Firefox 3 and Safari 3 all parse unknown elements in a more reasonable way by default. Note, however, that Firefox 2 does suffer from some related problems, for which there is unfortunately no known solution; but it is hoped that given the faster upgrade cycle for users of Firefox, relatively speaking compared with IE, Firefox 2 won't pose too much of a problem in the future.</p><p></p><p>This item was originally posted at: <a href='http://blog.whatwg.org'>http://blog.whatwg.org</a> and is licensed under the <a href='http://www.opensource.org/licenses/mit-license.php'>MIT license</a></p>]]></content:encoded>
			<wfw:commentRss>http://www.htmlfive.net/supporting-new-elements-in-ie/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Google Tech Talk: HTML5 demos</title>
		<link>http://www.htmlfive.net/google-tech-talk-html5-demos/</link>
		<comments>http://www.htmlfive.net/google-tech-talk-html5-demos/#comments</comments>
		<pubDate>Fri, 26 Sep 2008 23:49:13 +0000</pubDate>
		<dc:creator>Ian Hickson</dc:creator>
				<category><![CDATA[Browser API]]></category>
		<category><![CDATA[Browsers]]></category>
		<category><![CDATA[Conformance Checking]]></category>
		<category><![CDATA[DOM]]></category>
		<category><![CDATA[Elements]]></category>
		<category><![CDATA[Events]]></category>
		<category><![CDATA[Forms]]></category>
		<category><![CDATA[Multimedia]]></category>
		<category><![CDATA[Syntax]]></category>
		<category><![CDATA[WHATWG]]></category>

		<guid isPermaLink="false">http://blog.whatwg.org/?p=300</guid>
		<description><![CDATA[<p>I gave a talk at Google on Monday demonstrating the various features of HTML5 that are implemented in browsers today. The video is now on YouTube, so now you too can watch and laugh at my lame presentation skills!</p>
<p></p>
<p>The segments of this talk are as follows. Some of the demos are available online for you to play with and are linked to from the following list:</p>
<ol>
 <li> Introduction
 </li><li> <a href="http://whatwg.org/demos/2008-sept/video/video.html"><code>&#60;video&#62;</code></a> (00:35)
 </li><li> <a href="http://whatwg.org/demos/2008-sept/gadget-host/host.html"><code>postMessage()</code></a> (05:40)
 </li><li> <a href="http://whatwg.org/demos/2008-sept/editor/editor.html"><code>localStorage</code></a> (15:20)
 </li><li> <a href="http://whatwg.org/demos/2008-sept/wizard/step1.html"><code>sessionStorage</code></a> (21:00)
 </li><li> <a href="http://whatwg.org/demos/2008-sept/dnd/dnd.html">Drag and Drop API</a> (29:05)
 </li><li> <a href="http://whatwg.org/demos/2008-sept/hashchange/hashchange.html"><code>onhashchange</code></a> (37:30)
 </li><li> <a href="http://whatwg.org/demos/2008-sept/widgets/">Form Controls</a> (40:50)
 </li><li> <a href="http://whatwg.org/demos/2008-sept/color/color.html"><code>&#60;canvas&#62;</code></a> (56:55)
 </li><li> <a href="http://html5.validator.nu/">Validation</a> (1:07:20)
 </li><li> Questions and Answers (1:09:35)
</li></ol>
<p>If you're very interested in watching my typos, the high quality version of <a href="http://www.youtube.com/watch?v=xIxDJof7xxQ&#38;eurl=http://www.whatwg.org/demos/2008-sept/">the video on the YouTube site</a> is clear enough to see the text being typed. More details about the demos can be found on the corresponding <a href="http://whatwg.org/demos/2008-sept/">demo page</a>.</p>]]></description>
			<content:encoded><![CDATA[<p>I gave a talk at Google on Monday demonstrating the various features of HTML5 that are implemented in browsers today. The video is now on YouTube, so now you too can watch and laugh at my lame presentation skills!</p>
<p></p>
<p>The segments of this talk are as follows. Some of the demos are available online for you to play with and are linked to from the following list:</p>
<ol>
 <li> Introduction
 </li><li> <a href="http://whatwg.org/demos/2008-sept/video/video.html"><code>&lt;video&gt;</code></a> (00:35)
 </li><li> <a href="http://whatwg.org/demos/2008-sept/gadget-host/host.html"><code>postMessage()</code></a> (05:40)
 </li><li> <a href="http://whatwg.org/demos/2008-sept/editor/editor.html"><code>localStorage</code></a> (15:20)
 </li><li> <a href="http://whatwg.org/demos/2008-sept/wizard/step1.html"><code>sessionStorage</code></a> (21:00)
 </li><li> <a href="http://whatwg.org/demos/2008-sept/dnd/dnd.html">Drag and Drop API</a> (29:05)
 </li><li> <a href="http://whatwg.org/demos/2008-sept/hashchange/hashchange.html"><code>onhashchange</code></a> (37:30)
 </li><li> <a href="http://whatwg.org/demos/2008-sept/widgets/">Form Controls</a> (40:50)
 </li><li> <a href="http://whatwg.org/demos/2008-sept/color/color.html"><code>&lt;canvas&gt;</code></a> (56:55)
 </li><li> <a href="http://html5.validator.nu/">Validation</a> (1:07:20)
 </li><li> Questions and Answers (1:09:35)
</li></ol>
<p>If you're very interested in watching my typos, the high quality version of <a href="http://www.youtube.com/watch?v=xIxDJof7xxQ&#38;eurl=http://www.whatwg.org/demos/2008-sept/">the video on the YouTube site</a> is clear enough to see the text being typed. More details about the demos can be found on the corresponding <a href="http://whatwg.org/demos/2008-sept/">demo page</a>.</p><p></p><p>This item was originally posted at: <a href='http://blog.whatwg.org'>http://blog.whatwg.org</a> and is licensed under the <a href='http://www.opensource.org/licenses/mit-license.php'>MIT license</a></p>]]></content:encoded>
			<wfw:commentRss>http://www.htmlfive.net/google-tech-talk-html5-demos/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Validator.nu HTML Parser 1.1.0</title>
		<link>http://www.htmlfive.net/validatornu-html-parser-110/</link>
		<comments>http://www.htmlfive.net/validatornu-html-parser-110/#comments</comments>
		<pubDate>Mon, 25 Aug 2008 15:49:50 +0000</pubDate>
		<dc:creator>Henri Sivonen</dc:creator>
				<category><![CDATA[Syntax]]></category>

		<guid isPermaLink="false">http://blog.whatwg.org/?p=267</guid>
		<description><![CDATA[<p>I have released a new version of the <a href="http://about.validator.nu/htmlparser/">Validator.nu HTML Parser</a> (an implementation of the HTML5 parsing algorithm in Java). The new release supports SVG and MathML subtrees, is faster than the old version, fixes bugs, is more portable and supports applications that want to do <code>document.write()</code>.</p>

<p>The parser comes with a sample app that makes it possible to use XSLT programs written for XHTML5+SVG+MathML with <code>text/html</code>.</p>

<p><strong>Warning!</strong> The internal APIs have changed. Please refer to the Upgrade Guide below.</p>

<h3>Change Log</h3>

<ul>

<li>Made the SAX, DOM and XOM parser entry point constructors default to altering the infoset instead of throwing when the input needs coercing to be an XML 1.0 4th ed. plus Namespaces infoset.</li>

<li>Isolated Java IO dependent code from the parser core. The parser core now compiles on Google Web Toolkit.</li>

<li>Refactored the tokenizer to use a <code>switch</code> branch per state instead of method per state.</li>

<li>Made various performance tweaks to the tokenizer.</li>

<li>Implemented support for MathML and SVG foreign content. (Note that the SVG part is based on spec text that has been commented out from the spec at the request of the SVG WG.)</li>

<li>Made the parser suspendable after any input character.</li>

<li>Made it possible for custom <code>TreeBuilder</code> subclasses to request parser suspension. (Applications wishing to implement <code>document.write()</code> should provide their own <code>TreeBuilder</code> subclass and a <code>document.write()</code>-aware replacement of the <code>Driver</code> class. Look in the <code>gwt-src/</code> directory for sample code.)</li>

<li>Made changes to the parser core to make it more suitable for mechanical translation into other object-oriented programming languages that have C-like control structures but not necessarily a garbage collector (with focus on targeting C++). This work is not complete.</li>

<li>Made the HTML serializer do the right thing when input represents a conforming XHTML+SVG+MathML tree. (Results may be bad for non-conforming input trees.)</li>

<li>Developed sample programs for converting between HTML5 and XHTML5 when the input is known to be conforming.</li>

<li>Provided an XML serializer so that the sample code no longer depends on the Xalan serializer.</li>

<li>Improved API documentation.</li>

<li>Fixed bugs in the tokenizer, tree builder and the input stream character encoding decoder.</li>

<li>Made coercion to an XML infoset work according to the HTML5 spec.</li>

<li>Added ID uniqueness checking.</li>

<li>Various other fixes.</li>

</ul>

<h3>Upgrade Guide from 1.0.7 to 1.1.0</h3>

<p>In all cases, you need to check that your application does not break when it receives SVG or MathML subtrees.</p>

<dl>
<dt>If you use the parser through the SAX, DOM or XOM API and <em>do not</em> pass an explicit <code>XmlViolationPolicy</code> to the constructor of <code>HtmlParser</code>, <code>HtmlDocumentBuilder</code> or <code>HtmlBuilder</code>:</dt>
<dd><p>If you really wanted the old default behavior, you should now pass <code>XmlViolationPolicy.FATAL</code> to the constructor.</p>
<p>If you did not really want to have fatal errors by default, you do not need to do anything, since <code>ALTER_INFOSET</code> is now the default.</p>
</dd>

<dt>If you use the parser through the SAX, DOM or XOM API and <em>do</em> pass an explicit <code>XmlViolationPolicy</code> to the constructor of <code>HtmlParser</code>, <code>HtmlDocumentBuilder</code> or <code>HtmlBuilder</code>:</dt>
<dd><p>You do not need to change your code to upgrade.</p></dd>

<dt>If you have your own subclass of <code>TreeBuilder</code>:</dt>
<dd><p>The abstract methods on <code>TreeBuilder</code> now have additional arguments for passing the namespace URI. You should upgrade your subclass to deal with the namespace URIs. (The URI is always an interned string, so you can use <code>==</code> to compare.)</p>

<p>The entry point for passing in a SAX <code>InputSource</code> has moved from the <code>Tokenizer</code> class to the <code>Driver</code> class (in the <code>io</code> package), so you should change your references from <code>Tokenizer</code> to <code>Driver</code>.</p>
</dd>

<dt>If you have your own implementation of <code>TokenHandler</code>:</dt>
<dd><p>Please refer to the JavaDocs of <code>TokenHandler</code>. Also note the new separation of <code>Tokenizer</code> and <code>Driver</code> mentioned above.</p></dd>
</dl>


]]></description>
			<content:encoded><![CDATA[<p>I have released a new version of the <a href="http://about.validator.nu/htmlparser/">Validator.nu HTML Parser</a> (an implementation of the HTML5 parsing algorithm in Java). The new release supports SVG and MathML subtrees, is faster than the old version, fixes bugs, is more portable and supports applications that want to do <code>document.write()</code>.</p>

<p>The parser comes with a sample app that makes it possible to use XSLT programs written for XHTML5+SVG+MathML with <code>text/html</code>.</p>

<p><strong>Warning!</strong> The internal APIs have changed. Please refer to the Upgrade Guide below.</p>

<h3>Change Log</h3>

<ul>

<li>Made the SAX, DOM and XOM parser entry point constructors default to altering the infoset instead of throwing when the input needs coercing to be an XML 1.0 4th ed. plus Namespaces infoset.</li>

<li>Isolated Java IO dependent code from the parser core. The parser core now compiles on Google Web Toolkit.</li>

<li>Refactored the tokenizer to use a <code>switch</code> branch per state instead of method per state.</li>

<li>Made various performance tweaks to the tokenizer.</li>

<li>Implemented support for MathML and SVG foreign content. (Note that the SVG part is based on spec text that has been commented out from the spec at the request of the SVG WG.)</li>

<li>Made the parser suspendable after any input character.</li>

<li>Made it possible for custom <code>TreeBuilder</code> subclasses to request parser suspension. (Applications wishing to implement <code>document.write()</code> should provide their own <code>TreeBuilder</code> subclass and a <code>document.write()</code>-aware replacement of the <code>Driver</code> class. Look in the <code>gwt-src/</code> directory for sample code.)</li>

<li>Made changes to the parser core to make it more suitable for mechanical translation into other object-oriented programming languages that have C-like control structures but not necessarily a garbage collector (with focus on targeting C++). This work is not complete.</li>

<li>Made the HTML serializer do the right thing when input represents a conforming XHTML+SVG+MathML tree. (Results may be bad for non-conforming input trees.)</li>

<li>Developed sample programs for converting between HTML5 and XHTML5 when the input is known to be conforming.</li>

<li>Provided an XML serializer so that the sample code no longer depends on the Xalan serializer.</li>

<li>Improved API documentation.</li>

<li>Fixed bugs in the tokenizer, tree builder and the input stream character encoding decoder.</li>

<li>Made coercion to an XML infoset work according to the HTML5 spec.</li>

<li>Added ID uniqueness checking.</li>

<li>Various other fixes.</li>

</ul>

<h3>Upgrade Guide from 1.0.7 to 1.1.0</h3>

<p>In all cases, you need to check that your application does not break when it receives SVG or MathML subtrees.</p>

<dl>
<dt>If you use the parser through the SAX, DOM or XOM API and <em>do not</em> pass an explicit <code>XmlViolationPolicy</code> to the constructor of <code>HtmlParser</code>, <code>HtmlDocumentBuilder</code> or <code>HtmlBuilder</code>:</dt>
<dd><p>If you really wanted the old default behavior, you should now pass <code>XmlViolationPolicy.FATAL</code> to the constructor.</p>
<p>If you did not really want to have fatal errors by default, you do not need to do anything, since <code>ALTER_INFOSET</code> is now the default.</p>
</dd>

<dt>If you use the parser through the SAX, DOM or XOM API and <em>do</em> pass an explicit <code>XmlViolationPolicy</code> to the constructor of <code>HtmlParser</code>, <code>HtmlDocumentBuilder</code> or <code>HtmlBuilder</code>:</dt>
<dd><p>You do not need to change your code to upgrade.</p></dd>

<dt>If you have your own subclass of <code>TreeBuilder</code>:</dt>
<dd><p>The abstract methods on <code>TreeBuilder</code> now have additional arguments for passing the namespace URI. You should upgrade your subclass to deal with the namespace URIs. (The URI is always an interned string, so you can use <code>==</code> to compare.)</p>

<p>The entry point for passing in a SAX <code>InputSource</code> has moved from the <code>Tokenizer</code> class to the <code>Driver</code> class (in the <code>io</code> package), so you should change your references from <code>Tokenizer</code> to <code>Driver</code>.</p>
</dd>

<dt>If you have your own implementation of <code>TokenHandler</code>:</dt>
<dd><p>Please refer to the JavaDocs of <code>TokenHandler</code>. Also note the new separation of <code>Tokenizer</code> and <code>Driver</code> mentioned above.</p></dd>
</dl>


<p></p><p>This item was originally posted at: <a href='http://blog.whatwg.org'>http://blog.whatwg.org</a> and is licensed under the <a href='http://www.opensource.org/licenses/mit-license.php'>MIT license</a></p>]]></content:encoded>
			<wfw:commentRss>http://www.htmlfive.net/validatornu-html-parser-110/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>HTML5 Live DOM Viewer—Now in Your Browser</title>
		<link>http://www.htmlfive.net/html5-live-dom-viewer%e2%80%94now-in-your-browser/</link>
		<comments>http://www.htmlfive.net/html5-live-dom-viewer%e2%80%94now-in-your-browser/#comments</comments>
		<pubDate>Thu, 14 Aug 2008 12:27:30 +0000</pubDate>
		<dc:creator>Henri Sivonen</dc:creator>
				<category><![CDATA[DOM]]></category>
		<category><![CDATA[Syntax]]></category>

		<guid isPermaLink="false">http://blog.whatwg.org/?p=239</guid>
		<description><![CDATA[<p>Earlier, I <a href="http://blog.whatwg.org/html5-live-dom-viewer">blogged</a> about running the Validator.nu HTML Parser inside Hixie’s Live DOM Viewer using the magic of the hosted mode of the Google Web Toolkit. Back then, a compiler bug in GTW 1.5 RC1 prevented the parser from running as JavaScript in the Web mode. Google has now <a href="http://code.google.com/webtoolkit/releases/release-notes-1.5.1.html">released</a> GWT 1.5 RC2, which contains a fix for the bug.</p>

<p>So without further ado, here’s <a href="http://livedom.validator.nu/">Live DOM Viewer with an HTML5 parser running as JavaScript in your browser</a>.</p>

<p>Try pasting in the <a href="http://www.croczilla.com/svg/samples/lion/lion.svg">SVG lion</a> or some <a href="http://www.mozilla.org/projects/mathml/demo/basics.xhtml">MathML</a> in Firefox 3 and Opera 9.5.</p>

<p>Known problems:</p>

<ul>
<li>SVG <code>use</code> does not work in Firefox. <em>Update: Fixed in Minefield nightlies.</em></li>
<li>SVG does not render is Safari.</li>
<li>IE does not support <code>createElementNS</code> and, thus, does not work at all.</li>
</ul>

<p>A big thanks for the GWT team for making this work!</p>]]></description>
			<content:encoded><![CDATA[<p>Earlier, I <a href="http://blog.whatwg.org/html5-live-dom-viewer">blogged</a> about running the Validator.nu HTML Parser inside Hixie’s Live DOM Viewer using the magic of the hosted mode of the Google Web Toolkit. Back then, a compiler bug in GTW 1.5 RC1 prevented the parser from running as JavaScript in the Web mode. Google has now <a href="http://code.google.com/webtoolkit/releases/release-notes-1.5.1.html">released</a> GWT 1.5 RC2, which contains a fix for the bug.</p>

<p>So without further ado, here’s <a href="http://livedom.validator.nu/">Live DOM Viewer with an HTML5 parser running as JavaScript in your browser</a>.</p>

<p>Try pasting in the <a href="http://www.croczilla.com/svg/samples/lion/lion.svg">SVG lion</a> or some <a href="http://www.mozilla.org/projects/mathml/demo/basics.xhtml">MathML</a> in Firefox 3 and Opera 9.5.</p>

<p>Known problems:</p>

<ul>
<li>SVG <code>use</code> does not work in Firefox. <em>Update: Fixed in Minefield nightlies.</em></li>
<li>SVG does not render is Safari.</li>
<li>IE does not support <code>createElementNS</code> and, thus, does not work at all.</li>
</ul>

<p>A big thanks for the GWT team for making this work!</p><p></p><p>This item was originally posted at: <a href='http://blog.whatwg.org'>http://blog.whatwg.org</a> and is licensed under the <a href='http://www.opensource.org/licenses/mit-license.php'>MIT license</a></p>]]></content:encoded>
			<wfw:commentRss>http://www.htmlfive.net/html5-live-dom-viewer%e2%80%94now-in-your-browser/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Experience the HTML5 parsing algorithm in the Live DOM Viewer</title>
		<link>http://www.htmlfive.net/experience-the-html5-parsing-algorithm-in-the-live-dom-viewer/</link>
		<comments>http://www.htmlfive.net/experience-the-html5-parsing-algorithm-in-the-live-dom-viewer/#comments</comments>
		<pubDate>Mon, 30 Jun 2008 10:47:22 +0000</pubDate>
		<dc:creator>Henri Sivonen</dc:creator>
				<category><![CDATA[Syntax]]></category>

		<guid isPermaLink="false">http://blog.whatwg.org/?p=195</guid>
		<description><![CDATA[<p>If you’ve investigated how browsers parse HTML, you’ve probably used Hixie’s <a href="http://software.hixie.ch/utilities/js/live-dom-viewer/">Live DOM Viewer</a> to see what happens. Wouldn’t it be cool, though, if you could experiment with the HTML5 parsing algorithm in the same UI? Well, now you can.</p>
<p>I was looking for a way to experiment with <code>document.write()</code> in the code base of the Validator.nu HTML Parser and I was looking for a way to let people see the parse tree output of the HTML5 parsing algorithm more easily. Instead of writing a test harness fully in Java, I thought it would be better to use the Live DOM Viewer and a browser engine as the test harness. The good news is that Google Web Toolkit makes it possible to put these pieces together, and the trunk of the Validator.nu HTML parser now comes with a <code>document.write()</code>-aware tokenizer driver and a tree builder subclass for GWT.</p>
<p>The bad news is that the Java-to-JavaScript compiler of GWT has <a href="http://code.google.com/p/google-web-toolkit/issues/detail?id=2069">a bug</a> that blocks me from putting the result online as JavaScript. The Hosted Mode of GWT, works, though.</p>
<p>Here’s how you can run the Validator.nu HTML Parser in the Live DOM Viewer locally in the Hosted Mode of GWT (on Mac or Linux):</p>
<ol>
<li>Check out the source: <kbd>svn co http://svn.versiondude.net/whattf/htmlparser/trunk/ htmlparser</kbd></li>
<li>Download and untar <a href="http://code.google.com/webtoolkit/versions.html">GWT 1.5 RC1</a></li>
<li>On Linux, install libstdc++5 and a JDK (Ubuntu's OpenJDK-based package worked for me).</li>
<li>Edit the paths in <code>HtmlParser-shell</code> (Mac) or <code>HtmlParser-linux</code> (Linux) to point to the location of GWT.</li>
<li>Run <code>HtmlParser-shell</code> (Mac) or <code>HtmlParser-linux</code> (Linux)</li>
</ol>
<p>Known problems:</p>
<ul>
<li>The Linux version of GWT runs an outdated version of Gecko, and the rendered view doesn't work. The DOM view does.</li>
<li>The Mac version of GWT runs a Web Inspector-enabled version of WebKit, but SVG does not draw.</li>
<li><code>document.write()</code> semantics are right only for inline scripts.</li>
<li>Copying and pasting using keyboard shortcuts doesn’t work. (Use the context menu.)</li>
<li>On Linux, GTW prints a lot of harmless warnings about not finding annotations. (I don’t know why that happens. The annotations should be among translatables.)</li>
<li>Gecko (used by GTW on Linux) doesn't allow the creation of xmlns attributes in no namespace, so things stop working if you try to put an attribute called <code>xmlns</code> on HTML elements.</li>
<li>The DOM view on Linux doesn't report names with colons in them per the HTML5 spec.</li>
</ul>
<p>(Aside: This code could have applicability beyond testing the parser. If the compiler bug were fixed or worked around, a script could <code>document.write()</code> a <code>math</code> element and an <code>svg</code> element to sniff if they are parsed according to HTML5 and if they aren't, move aside load event handlers, <code>document.write()</code> <code>&#60;plaintext style='display:none'&#62;</code>, wait until <code>DOMContentLoaded</code>, load the the already created <code>html</code>, <code>head</code> and <code>body</code> elements onto the tree builder stack and head pointer of the HTML5 parser to and reparse the content of the plaintext element as HTML5 and call the load event handlers. See <a href="http://canvex.lazyilluminati.com/misc/sexp.html">Philip Taylor’s proof of concept with S-expressions</a>.)</p>]]></description>
			<content:encoded><![CDATA[<p>If you’ve investigated how browsers parse HTML, you’ve probably used Hixie’s <a href="http://software.hixie.ch/utilities/js/live-dom-viewer/">Live DOM Viewer</a> to see what happens. Wouldn’t it be cool, though, if you could experiment with the HTML5 parsing algorithm in the same UI? Well, now you can.</p>
<p>I was looking for a way to experiment with <code>document.write()</code> in the code base of the Validator.nu HTML Parser and I was looking for a way to let people see the parse tree output of the HTML5 parsing algorithm more easily. Instead of writing a test harness fully in Java, I thought it would be better to use the Live DOM Viewer and a browser engine as the test harness. The good news is that Google Web Toolkit makes it possible to put these pieces together, and the trunk of the Validator.nu HTML parser now comes with a <code>document.write()</code>-aware tokenizer driver and a tree builder subclass for GWT.</p>
<p>The bad news is that the Java-to-JavaScript compiler of GWT has <a href="http://code.google.com/p/google-web-toolkit/issues/detail?id=2069">a bug</a> that blocks me from putting the result online as JavaScript. The Hosted Mode of GWT, works, though.</p>
<p>Here’s how you can run the Validator.nu HTML Parser in the Live DOM Viewer locally in the Hosted Mode of GWT (on Mac or Linux):</p>
<ol>
<li>Check out the source: <kbd>svn co http://svn.versiondude.net/whattf/htmlparser/trunk/ htmlparser</kbd></li>
<li>Download and untar <a href="http://code.google.com/webtoolkit/versions.html">GWT 1.5 RC1</a></li>
<li>On Linux, install libstdc++5 and a JDK (Ubuntu's OpenJDK-based package worked for me).</li>
<li>Edit the paths in <code>HtmlParser-shell</code> (Mac) or <code>HtmlParser-linux</code> (Linux) to point to the location of GWT.</li>
<li>Run <code>HtmlParser-shell</code> (Mac) or <code>HtmlParser-linux</code> (Linux)</li>
</ol>
<p>Known problems:</p>
<ul>
<li>The Linux version of GWT runs an outdated version of Gecko, and the rendered view doesn't work. The DOM view does.</li>
<li>The Mac version of GWT runs a Web Inspector-enabled version of WebKit, but SVG does not draw.</li>
<li><code>document.write()</code> semantics are right only for inline scripts.</li>
<li>Copying and pasting using keyboard shortcuts doesn’t work. (Use the context menu.)</li>
<li>On Linux, GTW prints a lot of harmless warnings about not finding annotations. (I don’t know why that happens. The annotations should be among translatables.)</li>
<li>Gecko (used by GTW on Linux) doesn't allow the creation of xmlns attributes in no namespace, so things stop working if you try to put an attribute called <code>xmlns</code> on HTML elements.</li>
<li>The DOM view on Linux doesn't report names with colons in them per the HTML5 spec.</li>
</ul>
<p>(Aside: This code could have applicability beyond testing the parser. If the compiler bug were fixed or worked around, a script could <code>document.write()</code> a <code>math</code> element and an <code>svg</code> element to sniff if they are parsed according to HTML5 and if they aren't, move aside load event handlers, <code>document.write()</code> <code>&lt;plaintext style='display:none'&gt;</code>, wait until <code>DOMContentLoaded</code>, load the the already created <code>html</code>, <code>head</code> and <code>body</code> elements onto the tree builder stack and head pointer of the HTML5 parser to and reparse the content of the plaintext element as HTML5 and call the load event handlers. See <a href="http://canvex.lazyilluminati.com/misc/sexp.html">Philip Taylor’s proof of concept with S-expressions</a>.)</p><p></p><p>This item was originally posted at: <a href='http://blog.whatwg.org'>http://blog.whatwg.org</a> and is licensed under the <a href='http://www.opensource.org/licenses/mit-license.php'>MIT license</a></p>]]></content:encoded>
			<wfw:commentRss>http://www.htmlfive.net/experience-the-html5-parsing-algorithm-in-the-live-dom-viewer/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Reverse Ordered Lists</title>
		<link>http://www.htmlfive.net/reverse-ordered-lists/</link>
		<comments>http://www.htmlfive.net/reverse-ordered-lists/#comments</comments>
		<pubDate>Wed, 23 Apr 2008 15:51:13 +0000</pubDate>
		<dc:creator>Lachlan Hunt</dc:creator>
				<category><![CDATA[Elements]]></category>
		<category><![CDATA[Syntax]]></category>

		<guid isPermaLink="false">http://blog.whatwg.org/reverse-ordered-lists</guid>
		<description><![CDATA[<p>One of the newly introduced features in HTML 5 is <a href="http://www.whatwg.org/specs/web-apps/current-work/multipage/section-grouping.html#the-ol">the ability to mark up reverse ordered lists</a>.  These are the same as ordered lists, but instead of counting up from 1, they instead count down towards 1.  This can be used, for example, to count down the top 10 movies, music, or LOLCats, or anything else you want to present as a countdown list.</p>

<p>In previous versions of HTML, the only way to achieve this was to place a <code>value</code> attribute on each <code>li</code> element, with successively decreasing values.</p>

<pre><code>&#60;h3&#62;Top 5 TV Series&#60;/h3&#62;
&#60;ol&#62;
  &#60;li <strong>value=&#34;5&#34;</strong>&#62;Friends
  &#60;li value=&#34;4&#34;&#62;24
  &#60;li value=&#34;3&#34;&#62;The Simpsons
  &#60;li value=&#34;2&#34;&#62;Stargate Atlantis
  &#60;li value=&#34;1&#34;&#62;Stargate SG-1
&#60;/ol&#62;</code></pre>

<p>The problem with that approach is that manually specifying each value can be time consuming to write and maintain, and the <code>value</code> attribute was not allowed in the HTML 4.01 or XHTML 1.0 Strict DOCTYPEs (although HTML 5 fixes that problem and allows the <code>value</code> attribute)</p>

<p>The new markup is very simple: just add a <code>reversed</code> attribute to the <code>ol</code> element, and optionally provide a <code>start</code> value. If there’s no start value provided, the browser will count the number of list items, and count down from that number to 1.</p>

<pre><code>&#60;h3&#62;Greatest Movies Sagas of All Time&#60;/h3&#62;
&#60;ol <strong>reversed</strong>&#62;
  &#60;li&#62;Police Academy (Series)
  &#60;li&#62;Harry Potter (Series)
  &#60;li&#62;Back to the Future (Trilogy)
  &#60;li&#62;Star Wars (Saga)
  &#60;li&#62;The Lord of the Rings (Trilogy)
&#60;/ol&#62;</code></pre>

<p>Since there are 5 list items in that list, the list will count down from 5 to 1.</p>

<p>The <code>reversed</code> attribute is a boolean attribute.  In HTML, the value may be omitted, but in XHTML, it needs to be written as: <code>reversed=&#34;reversed&#34;</code>.</p>

<p>The <code>start</code> attribute can be used to specify the starting number for the countdown, or the <code>value</code> attribute can be used on an <code>li</code> element. Subsequent list items will, by default, be numbered with the value of 1 less than the previous item.</p>

<p>The following example starts counting down from 100, but omits a few items from the middle of the list and resumes from 3.</p>

<pre><code>&#60;h3&#62;Top 100 Logical Fallacies Used By Creationists&#60;/h3&#62;
&#60;ol <strong>reversed=&#34;reversed&#34; start=&#34;100&#34;</strong>&#62;
  &#60;li&#62;False Dichotomy&#60;/li&#62;
  &#60;li&#62;Appeal to Ridicule&#60;/li&#62;
  &#60;li&#62;Begging the Question (Circular Logic)&#60;/li&#62;
  &#60;!-- Items omitted here --&#62;
  &#60;li <strong>value=&#34;3&#34;</strong>&#62;Strawman&#60;/li&#62;
  &#60;li&#62;Bare Assertion Fallacy&#60;/li&#62;
  &#60;li&#62;Argumentum ad Ignorantiam&#60;/li&#62;
&#60;/ol&#62;</code></pre>
]]></description>
			<content:encoded><![CDATA[<p>One of the newly introduced features in HTML 5 is <a href="http://www.whatwg.org/specs/web-apps/current-work/multipage/section-grouping.html#the-ol">the ability to mark up reverse ordered lists</a>.  These are the same as ordered lists, but instead of counting up from 1, they instead count down towards 1.  This can be used, for example, to count down the top 10 movies, music, or LOLCats, or anything else you want to present as a countdown list.</p>

<p>In previous versions of HTML, the only way to achieve this was to place a <code>value</code> attribute on each <code>li</code> element, with successively decreasing values.</p>

<pre><code>&lt;h3&gt;Top 5 TV Series&lt;/h3&gt;
&lt;ol&gt;
  &lt;li <strong>value=&quot;5&quot;</strong>&gt;Friends
  &lt;li value=&quot;4&quot;&gt;24
  &lt;li value=&quot;3&quot;&gt;The Simpsons
  &lt;li value=&quot;2&quot;&gt;Stargate Atlantis
  &lt;li value=&quot;1&quot;&gt;Stargate SG-1
&lt;/ol&gt;</code></pre>

<p>The problem with that approach is that manually specifying each value can be time consuming to write and maintain, and the <code>value</code> attribute was not allowed in the HTML 4.01 or XHTML 1.0 Strict DOCTYPEs (although HTML 5 fixes that problem and allows the <code>value</code> attribute)</p>

<p>The new markup is very simple: just add a <code>reversed</code> attribute to the <code>ol</code> element, and optionally provide a <code>start</code> value. If there’s no start value provided, the browser will count the number of list items, and count down from that number to 1.</p>

<pre><code>&lt;h3&gt;Greatest Movies Sagas of All Time&lt;/h3&gt;
&lt;ol <strong>reversed</strong>&gt;
  &lt;li&gt;Police Academy (Series)
  &lt;li&gt;Harry Potter (Series)
  &lt;li&gt;Back to the Future (Trilogy)
  &lt;li&gt;Star Wars (Saga)
  &lt;li&gt;The Lord of the Rings (Trilogy)
&lt;/ol&gt;</code></pre>

<p>Since there are 5 list items in that list, the list will count down from 5 to 1.</p>

<p>The <code>reversed</code> attribute is a boolean attribute.  In HTML, the value may be omitted, but in XHTML, it needs to be written as: <code>reversed=&quot;reversed&quot;</code>.</p>

<p>The <code>start</code> attribute can be used to specify the starting number for the countdown, or the <code>value</code> attribute can be used on an <code>li</code> element. Subsequent list items will, by default, be numbered with the value of 1 less than the previous item.</p>

<p>The following example starts counting down from 100, but omits a few items from the middle of the list and resumes from 3.</p>

<pre><code>&lt;h3&gt;Top 100 Logical Fallacies Used By Creationists&lt;/h3&gt;
&lt;ol <strong>reversed=&quot;reversed&quot; start=&quot;100&quot;</strong>&gt;
  &lt;li&gt;False Dichotomy&lt;/li&gt;
  &lt;li&gt;Appeal to Ridicule&lt;/li&gt;
  &lt;li&gt;Begging the Question (Circular Logic)&lt;/li&gt;
  &lt;!-- Items omitted here --&gt;
  &lt;li <strong>value=&quot;3&quot;</strong>&gt;Strawman&lt;/li&gt;
  &lt;li&gt;Bare Assertion Fallacy&lt;/li&gt;
  &lt;li&gt;Argumentum ad Ignorantiam&lt;/li&gt;
&lt;/ol&gt;</code></pre>
<p></p><p>This item was originally posted at: <a href = 'http://blog.whatwg.org'>http://blog.whatwg.org</a> and is licensed under the <a href = 'http://www.opensource.org/licenses/mit-license.php'>MIT license</a></p>]]></content:encoded>
			<wfw:commentRss>http://www.htmlfive.net/reverse-ordered-lists/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>New Image Report Feature in Validator.nu</title>
		<link>http://www.htmlfive.net/new-image-report-feature-in-validatornu/</link>
		<comments>http://www.htmlfive.net/new-image-report-feature-in-validatornu/#comments</comments>
		<pubDate>Fri, 18 Apr 2008 13:53:32 +0000</pubDate>
		<dc:creator>Henri Sivonen</dc:creator>
				<category><![CDATA[Conformance Checking]]></category>
		<category><![CDATA[Syntax]]></category>

		<guid isPermaLink="false">http://blog.whatwg.org/image-report</guid>
		<description><![CDATA[<p>There have been <em>lots and lots</em> of e-mail on the <a href="http://lists.w3.org/Archives/Public/public-html/2008Apr/">public-html</a> mailing list about making the <code>alt</code> attribute syntactically required in HTML5. At the core of this debate is on one hand using HTML5 validators to send a strong message about accessibility and on the other hand of avoiding a situation where a simplified and idealistic strong message leads to behavior that is counterproductive considering the goal of making the Web accessible. As a policy debate, it is similar to abstinence-only sex education debates.</p>

<p>A validator is a computer program and cannot tell if a textual alternative is appropriate for a given image in a given context. That's why accessibility checking needs to be done by a person. A person may use a software tool to make the checking easier, but trusting on fully automated software to determine whether a page is accessible is misguided. </p>

<p>Given this basic problem, a policy that insists on the <code>alt</code> attribute always being present doesn’t necessarily lead to accessibility. In fact, considering that syntactic correctness and accessibility are different evaluation axes both in terms of computability and in terms of how HTML authors (other than accessibility advocates) tend to view things (judging from observations about the behavior of HTML authors who use validators), a policy that insists on the <code>alt</code> attribute being always present will likely cause people to put the attribute in there but with inappropriate content. In particular, putting an empty <code>alt</code> on images whose presence is important for understanding the context of other content is bad, because in that case the presence of those images is concealed from a non-graphical user. Also, a textual alternative that just says “image” is not an improvement over what, for example, Safari with VoiceOver says in the absence of <code>alt</code>, but would be worse than a smarter client-side heuristic.</p>

<p>Furthermore, there is a very real case where a textual alternative simply isn’t available to the HTML generator: a user uploads photos to a content management system and refuses to supply textual alternatives at the same moment. HTML 4 didn’t account for this case. In fact, requiring <code>alt</code> to under all circumstances assumes that markup is written by a person who knows what the images are at the time of writing markup. It doesn’t make sense to pretend that the case where the markup generator doesn’t have textual alternatives available doesn’t exist. The HTML 5 syntax needs to account for all use cases. </p>

<p>Expecting markup generators to knowingly emit markup that is not valid is not a winning proposition. Quoting me from 2006:</p>

<blockquote><p>Authoring tools are judged by taking a page authored using the
tool and running it through the W3C Validator or, presumably in the
future, through an HTML5 conformance checker. Authoring tool makers  
who
are capable of making their tool produce syntactically conforming
documents will want to do so and minimize the chance that the users of
their software tarnish the reputation of the tool in the eyes of  
people
who use an automated test as a litmus test of authoring tool bogosity.
(People who test tools that way will outnumber the people who make a
more profound analysis due to the "validate, validate, validate"
propaganda.)</p></blockquote>

<p>To summarize: As a matter of principle, subjective checking or checking that is not applicable for all pages <a href="http://www.w3.org/QA/2008/04/badges.html">does not belong in the validation function</a>. Practice is more important than principle, though. Baking the <code>alt</code> requirement into the validation function would be bad when the user of the validation function wants a clean report on syntax but isn’t as concerned with accessibility. It is bad for accessibility when authors put the simplest value that silences the validator into the attribute in order to make the validation report look clean, since doing so gives user agents like Safari with VoiceOver less information to work with. That's why I think the requirement to have an <code>alt</code> attribute present doesn’t belong in the validation function also as a practical matter.</p>

<p>It turns out, though, that some people think of validation as a first step toward accessibility, even though syntactic correctness and accessibility really are different evaluation axes. They expect a validator to help them flag images that are lacking a textual alternative. Moreover, the <code>alt</code> issue seems to be taken as the single most important web accessibility issue with the rest of issues somewhere in the long tail. When there is a demand for validators to flag images without <code>alt</code>, validators probably should meet the demand. </p>

<p>To this end, I have developed a new feature for <a href="http://html5.validator.nu/?showimagereport=yes&#38;showsource=yes">Validator.nu</a>: Image Report. This new feature is not part of the validation function. It also doesn’t do exactly want people are asking of the syntax definition in the long e-mail thread. (It is not a new idea for a validator user interface to offer tools that help a human perform an assessment about the page outside the validation function. For example, the W3C Validator has offered a “Show Document Outline” feature, which is also on file as a request for enhancement for Validator.nu.)</p>

<p>The new feature tries to address the issue of finding missing textual alternatives but it also seeks to address the issue of faulty textual alternatives. Furthermore, it seeks to address these in a way that doesn’t induce people to write bad textual alternatives in order to make the report look cleaner. </p>

<p>When you turn the feature on, it always lists all the images. There is no textual alternative you can fake to make the list look shorter. Instead, there are four categories and you can only change the category in which an image appears. </p>

<p>This has the benefit of removing the badge hunting problem: people trying to silence the validator without actually raising the quality of their page. However, it also has the benefit that the user can review the textual alternatives for appropriateness and the user can review that the right images have been marked as omitted from non-graphical presentation. Since this tool addresses more problems than simply making <code>alt</code> required on the syntax level, I believe this solution is much better than furiously staying entrenched in the status quo of HTML 4 validation, fearing so much a step backwards as to being too afraid to explore steps forward.</p>

<p>Finally, it should be noted that this feature is, by necessity, itself inaccessible to people who cannot view bitmap images. Yet, I think it is legitimate for this feature to be implemented with an HTML user interface. Also, this feature itself is a case where the generator of the user interface markup has no knowledge of the content of the images it is presenting to the user. Hence, it is itself an example of omitting the <code>alt</code> attribute. It would be truly ironic, if the syntax definition of HTML5 prevented Validator.nu from being self-validating.</p>]]></description>
			<content:encoded><![CDATA[<p>There have been <em>lots and lots</em> of e-mail on the <a href="http://lists.w3.org/Archives/Public/public-html/2008Apr/">public-html</a> mailing list about making the <code>alt</code> attribute syntactically required in HTML5. At the core of this debate is on one hand using HTML5 validators to send a strong message about accessibility and on the other hand of avoiding a situation where a simplified and idealistic strong message leads to behavior that is counterproductive considering the goal of making the Web accessible. As a policy debate, it is similar to abstinence-only sex education debates.</p>

<p>A validator is a computer program and cannot tell if a textual alternative is appropriate for a given image in a given context. That's why accessibility checking needs to be done by a person. A person may use a software tool to make the checking easier, but trusting on fully automated software to determine whether a page is accessible is misguided. </p>

<p>Given this basic problem, a policy that insists on the <code>alt</code> attribute always being present doesn’t necessarily lead to accessibility. In fact, considering that syntactic correctness and accessibility are different evaluation axes both in terms of computability and in terms of how HTML authors (other than accessibility advocates) tend to view things (judging from observations about the behavior of HTML authors who use validators), a policy that insists on the <code>alt</code> attribute being always present will likely cause people to put the attribute in there but with inappropriate content. In particular, putting an empty <code>alt</code> on images whose presence is important for understanding the context of other content is bad, because in that case the presence of those images is concealed from a non-graphical user. Also, a textual alternative that just says “image” is not an improvement over what, for example, Safari with VoiceOver says in the absence of <code>alt</code>, but would be worse than a smarter client-side heuristic.</p>

<p>Furthermore, there is a very real case where a textual alternative simply isn’t available to the HTML generator: a user uploads photos to a content management system and refuses to supply textual alternatives at the same moment. HTML 4 didn’t account for this case. In fact, requiring <code>alt</code> to under all circumstances assumes that markup is written by a person who knows what the images are at the time of writing markup. It doesn’t make sense to pretend that the case where the markup generator doesn’t have textual alternatives available doesn’t exist. The HTML 5 syntax needs to account for all use cases. </p>

<p>Expecting markup generators to knowingly emit markup that is not valid is not a winning proposition. Quoting me from 2006:</p>

<blockquote><p>Authoring tools are judged by taking a page authored using the
tool and running it through the W3C Validator or, presumably in the
future, through an HTML5 conformance checker. Authoring tool makers  
who
are capable of making their tool produce syntactically conforming
documents will want to do so and minimize the chance that the users of
their software tarnish the reputation of the tool in the eyes of  
people
who use an automated test as a litmus test of authoring tool bogosity.
(People who test tools that way will outnumber the people who make a
more profound analysis due to the "validate, validate, validate"
propaganda.)</p></blockquote>

<p>To summarize: As a matter of principle, subjective checking or checking that is not applicable for all pages <a href="http://www.w3.org/QA/2008/04/badges.html">does not belong in the validation function</a>. Practice is more important than principle, though. Baking the <code>alt</code> requirement into the validation function would be bad when the user of the validation function wants a clean report on syntax but isn’t as concerned with accessibility. It is bad for accessibility when authors put the simplest value that silences the validator into the attribute in order to make the validation report look clean, since doing so gives user agents like Safari with VoiceOver less information to work with. That's why I think the requirement to have an <code>alt</code> attribute present doesn’t belong in the validation function also as a practical matter.</p>

<p>It turns out, though, that some people think of validation as a first step toward accessibility, even though syntactic correctness and accessibility really are different evaluation axes. They expect a validator to help them flag images that are lacking a textual alternative. Moreover, the <code>alt</code> issue seems to be taken as the single most important web accessibility issue with the rest of issues somewhere in the long tail. When there is a demand for validators to flag images without <code>alt</code>, validators probably should meet the demand. </p>

<p>To this end, I have developed a new feature for <a href="http://html5.validator.nu/?showimagereport=yes&amp;showsource=yes">Validator.nu</a>: Image Report. This new feature is not part of the validation function. It also doesn’t do exactly want people are asking of the syntax definition in the long e-mail thread. (It is not a new idea for a validator user interface to offer tools that help a human perform an assessment about the page outside the validation function. For example, the W3C Validator has offered a “Show Document Outline” feature, which is also on file as a request for enhancement for Validator.nu.)</p>

<p>The new feature tries to address the issue of finding missing textual alternatives but it also seeks to address the issue of faulty textual alternatives. Furthermore, it seeks to address these in a way that doesn’t induce people to write bad textual alternatives in order to make the report look cleaner. </p>

<p>When you turn the feature on, it always lists all the images. There is no textual alternative you can fake to make the list look shorter. Instead, there are four categories and you can only change the category in which an image appears. </p>

<p>This has the benefit of removing the badge hunting problem: people trying to silence the validator without actually raising the quality of their page. However, it also has the benefit that the user can review the textual alternatives for appropriateness and the user can review that the right images have been marked as omitted from non-graphical presentation. Since this tool addresses more problems than simply making <code>alt</code> required on the syntax level, I believe this solution is much better than furiously staying entrenched in the status quo of HTML 4 validation, fearing so much a step backwards as to being too afraid to explore steps forward.</p>

<p>Finally, it should be noted that this feature is, by necessity, itself inaccessible to people who cannot view bitmap images. Yet, I think it is legitimate for this feature to be implemented with an HTML user interface. Also, this feature itself is a case where the generator of the user interface markup has no knowledge of the content of the images it is presenting to the user. Hence, it is itself an example of omitting the <code>alt</code> attribute. It would be truly ironic, if the syntax definition of HTML5 prevented Validator.nu from being self-validating.</p><p></p><p>This item was originally posted at: <a href = 'http://blog.whatwg.org'>http://blog.whatwg.org</a> and is licensed under the <a href = 'http://www.opensource.org/licenses/mit-license.php'>MIT license</a></p>]]></content:encoded>
			<wfw:commentRss>http://www.htmlfive.net/new-image-report-feature-in-validatornu/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
