<?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; Browsers</title>
	<atom:link href="http://www.htmlfive.net/category/browsers/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>Implementation progress on the HTML5 &lt;ruby&gt; element</title>
		<link>http://www.htmlfive.net/implementation-progress-on-the-html5-ruby-element/</link>
		<comments>http://www.htmlfive.net/implementation-progress-on-the-html5-ruby-element/#comments</comments>
		<pubDate>Fri, 13 Nov 2009 02:51:00 +0000</pubDate>
		<dc:creator>MikeSmith</dc:creator>
				<category><![CDATA[Browsers]]></category>
		<category><![CDATA[Elements]]></category>

		<guid isPermaLink="false">http://blog.whatwg.org/?p=1119</guid>
		<description><![CDATA[If you don't know what the HTML5 ruby element is, you might want to take a minute to first read the section about the ruby element in the HTML5 specification and/or the Wikipedia article on ruby characters. To quote from the HTML5 description of the ruby element: The ruby element allows one or more spans [...]]]></description>
			<content:encoded><![CDATA[<p> If you don't know what the HTML5 <b>ruby</b> element is, you might want to take a minute to first read <a href="http://dev.w3.org/html5/spec/text-level-semantics.html#the-ruby-element">the section about the <b>ruby</b> element in the HTML5 specification</a> and/or the Wikipedia article on <a href="http://en.wikipedia.org/wiki/Ruby_character">ruby characters</a>. To quote from the HTML5 description of the <b>ruby</b> element:</p>

<blockquote cite="http://dev.w3.org/html5/spec/text-level-semantics.html#the-ruby-element">
<p>The <b>ruby</b> element allows one or more spans of phrasing content to be marked with ruby annotations. Ruby annotations are short runs of text presented alongside base text, primarily used in East Asian typography as a guide for pronunciation or to include other annotations. In Japanese, this form of typography is also known as <em>furigana</em>.</p>
</blockquote>

<p>I give a specific example further down, but for now I want to first say that the really great news about the <b>ruby</b> element is that last week, Google Chrome developer Roland Steiner <a href="http://trac.webkit.org/changeset/50495">checked in a change</a> (r50495, and see also related <a href="https://bugs.webkit.org/show_bug.cgi?id=28420">bug 28420</a>) that adds <b>ruby</b> support to the trunk of the WebKit source repository, thus making the ruby feature available in WebKit nightlies and Chrome dev-channel releases.</p>

<h3 id="example">A simple example</h3>
<p>The following is a simple example of what you can do with the <b>ruby</b> element; make sure to view it in a recent WebKit nightly or Chrome dev-channel release. Note that the text is an excerpt from the source of a ruby-annotated <a href="http://www.aozora.gr.jp/cards/000035/files/1567_14913.html">online copy of the short story <i>Run, Melos, Run</i></a> by the writer Osamu Dazai, which I came across by way of Piro's info page for his <a href="http://piro.sakura.ne.jp/xul/_rubysupport.html.en">XHTML Ruby add-on for Firefox</a> (and which I mention a bit more about further below).</p>

<pre>
きのうの豪雨で山の水源地は&lt;ruby>氾濫&lt;rp>（&lt;/rp>
&lt;rt><span style="background-color: yellow">はんらん</span>&lt;/rt>&lt;rp>）&lt;/rp>&lt;/ruby>し、濁流
&lt;ruby>滔々&lt;rp>（&lt;/rp>&lt;rt><span style="background-color: yellow">とうとう</span>&lt;/rt>&lt;rp>）&lt;/rp>
&lt;/ruby>と下流に 集り、猛勢一挙に橋を破壊し、どうどうと 
響きをあげる激流が、&lt;ruby>木葉微塵&lt;rp>（&lt;/rp>
&lt;rt><span style="background-color: yellow">こっぱみじん</span>&lt;/rt>&lt;rp>）&lt;/rp>&lt;/ruby>に&lt;ruby>橋桁
&lt;rp>（&lt;/rp>&lt;rt><span style="background-color: yellow">はしげた</span>&lt;/rt>&lt;rp>）&lt;/rp>&lt;/ruby>
を跳ね飛ばしていた。
</pre>

<p>If you don't happen to have Japanese fonts installed, here's a screenshot of the source for reference:</p>

<p><img id="ruby-markup" src="http://sideshowbarker.net/wp-content/uploads/2009/11/source.png" alt="ruby source markup" /></p>

<p>Notice that the actual annotative ruby text (which I've highlighted in yellow in the source just for the sake of emphasis) is marked up using the <b>rt</b> element as a child of the <b>ruby</b> element, and the text being annotated is the node that's a previous sibling to that <b>rt</b> content as a child of the <b>ruby</b> element. The final new element in the mix is the <b>rp</b> element, which is simply a way to mark up the annotative ruby text with parenthesis, for graceful fallback in browsers that don't support ruby.</p>

<p>So here's the rendered view of that same text:</p>

<blockquote cite="http://www.aozora.gr.jp/cards/000035/files/1567_14913.html">
<p>見よ、前方の川を。きのうの豪雨で山の水源地は<ruby>氾濫<rp>（</rp><rt>はんらん</rt><rp>）</rp></ruby>し、濁流<ruby>滔々<rp>（</rp><rt>とうとう</rt><rp>）</rp></ruby>と下流に集り、猛勢一挙に橋を破壊し、どうどうと響きをあげる激流が、<ruby>木葉微塵<rp>（</rp><rt>こっぱみじん</rt><rp>）</rp></ruby>に<ruby>橋桁<rp>（</rp><rt>はしげた</rt><rp>）</rp></ruby>を跳ね飛ばしていた。</p>
</blockquote>

<p>And here is a screenshot of how it should look in a recent WebKit nightly or Chrome dev-channel release:</p>

<p><img id="image60" src="http://sideshowbarker.net/wp-content/uploads/2009/11/rendered.png" alt="ruby rendered view" /></p>

<p>Notice that the annotative ruby text is displayed above the ruby base it annotates. If you instead view this page in a browser that doesn't support the ruby feature, you'll see that the ruby text is just shown inline, in parenthesis following the ruby base it annotates. So the feature falls back gracefully in older browsers.</p>

<h3 id="other-browsers">Support in other browsers</h3>
<p>Current versions of Microsoft Internet Explorer also have native support for ruby, and you can also get ruby support in Firefox by installing Piro's <a href="https://addons.mozilla.org/en-US/firefox/addon/1935">XHTML Ruby add-on</a> (and for more details, see his <a href="http://piro.sakura.ne.jp/xul/_rubysupport.html.en">XHTML ruby add-on info page</a>) — so we are well on the way to seeing the HTML5 ruby feature supported across a range of browsers. If you're not accustomed to reading printed books and magazines and such in Japanese, that might not sound like such a big deal. But for authors and developers and content providers in Japan who want to finally be able to use on the Web this very common feature of Japanese page layout from the print world, getting ruby support into another major browser engine is a huge win, and something to be very excited about.</p>]]></content:encoded>
			<wfw:commentRss>http://www.htmlfive.net/implementation-progress-on-the-html5-ruby-element/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Sniffing for RSS 1.0 feeds served as text/html</title>
		<link>http://www.htmlfive.net/sniffing-for-rss-1-0-feeds-served-as-texthtml/</link>
		<comments>http://www.htmlfive.net/sniffing-for-rss-1-0-feeds-served-as-texthtml/#comments</comments>
		<pubDate>Tue, 29 Sep 2009 22:42:37 +0000</pubDate>
		<dc:creator>Mark Pilgrim</dc:creator>
				<category><![CDATA[Browsers]]></category>

		<guid isPermaLink="false">http://blog.whatwg.org/?p=1023</guid>
		<description><![CDATA[It is unlikely that we will adopt IE's algorithm, since it seems unnecessarily pathological.]]></description>
			<content:encoded><![CDATA[<p>I recently found myself testing how browsers sniff for RSS 1.0 feeds that are served with an incorrect MIME type. (Yes, my life is full of delicious irony.) I thought I'd share my findings so far.</p>

<h3 id=firefox>Firefox</h3>

<p>Firefox's feed sniffing algorithm is located in <a href="http://mxr.mozilla.org/mozilla-central/source/browser/components/feeds/src/nsFeedSniffer.cpp"><code>nsFeedSniffer.cpp</code></a>. As you can see, <a href="http://mxr.mozilla.org/mozilla-central/source/browser/components/feeds/src/nsFeedSniffer.cpp#353">starting at line 353</a>, it takes the first 512 bytes of the page, looks for a root tag called <code>rss</code> (for RSS 2.0), <code>atom</code> (for Atom 0.3 and 1.0), or <code>rdf:RDF</code> (for RSS 1.0). The RSS 1.0 marker is really a generic RDF marker, so it then does some additional checks for the two required namespaces of an RSS 1.0 feed, <code>http://www.w3.org/1999/02/22-rdf-syntax-ns#</code> and <code>http://purl.org/rss/1.0/</code>. This check is quite simple; it literally just checks for the presence of both strings, not caring whether they are the value of an <code>xmlns</code> attribute (or indeed any attribute at all).</p>

<p>Firefox has an additional feature which tripped up my testing until I understood it. IE and Safari both have a mode where they essentially say "I detected this page as a feed and tried to parse it, but I failed, so now I'm giving up, and here's an error message describing why I gave up." Firefox does not have a mode like this. As far as I can tell, if it decides that a resource is a feed but then fails to parse the resource as a feed, it reparses the resource with feed handling disabled. So an non-well-formed feed served as <code>application/rss+xml</code> will actually trigger a "Do you want to download this file" dialog, because Firefox tried to parse it as a feed, failed, then reparsed it as some-random-media-type-that-I-don't-handle. A non-well-formed feed served as <code>text/html</code> will actually render as HTML, but only after Firefox silently tries (and fails) to parse it as a feed.</p>

<p>There's nothing wrong with this approach; in fact, it seems much more end-user-friendly than throwing up an incomprehensible error message. I just mention it because it tripped me up while testing.</p>

<h3 id=ie>Internet Explorer</h3>

<p>Internet Explorer's feed sniffing algorithm is <a href="http://blogs.msdn.com/rssteam/articles/PublishersGuide.aspx">documented by the Windows RSS team</a>. About RSS 1.0, it states:</p>

<blockquote cite="http://blogs.msdn.com/rssteam/articles/PublishersGuide.aspx">
<p>IE7 detects a RSS 1.0 feed using the content types <code>application/xml</code> or <code>text/xml</code>. ... The document is checked for the strings <code>&lt;rdf:RDF</code>, <code>http://www.w3.org/1999/02/22-rdf-syntax-ns#</code> and <code>http://purl.org/rss/1.0/</code>.  IE7 detects that it is a feed if all three strings are found within the first 512 bytes of the document. ... IE7 also supports other generic <code>Content-Type</code>s by checking the document for specific Atom and RSS strings.</p>
</blockquote>

<p>Now that I understand IE's algorithm, I have to concede that this documentation is 100% accurate. However, it doesn't tell the full story. Here's what actually happens. If the <code>Content-Type</code> is</p>

<ul>
<li><code>application/xml</code></li>
<li><code>text/xml</code></li>
<li><code>application/octet-stream</code></li>
<li><code>text/plain</code></li>
<li><code>text/html</code></li>
<li>the empty string, or</li>
<li>missing altogether</li>
</ul>

<p>...then IE will trigger its feed sniffing. Once IE triggers its feed sniffing, it will never change its mind (unlike Firefox). If feed parsing fails, IE will throw up an error message complaining of feed coding errors or an unsupported feed format. The presence or absence of a <code>charset</code> parameter in the <code>Content-Type</code> header made absolutely no difference in any of the cases I tested.</p>

<p>And how exactly does IE detect an RSS 1.0 feed, once it decides to sniff? The documentation on MSDN is literally true: "The document is checked for the strings <code>&lt;rdf:RDF</code>, <code>http://www.w3.org/1999/02/22-rdf-syntax-ns#</code> and <code>http://purl.org/rss/1.0/</code>.  IE7 detects that it is a feed if all three strings are found within the first 512 bytes of the document." Combined with our knowledge of which <code>Content-Type</code>s IE considers "generic," we can conclude that the following page, served as <code>text/html</code>, will be treated as a feed in IE:</p>

<blockquote>
<pre><code>&lt;!-- &lt;rdf:RDF -->
&lt;!-- http://www.w3.org/1999/02/22-rdf-syntax-ns# -->
&lt;!-- http://purl.org/rss/1.0/ -->
&lt;script>alert('Hi!');&lt;/script></code></pre>
</blockquote>

<p>[<a href="http://wearehugh.com/public/2009/09/feeds/comment/index.html">live demonstration</a>]</p>

<h3 id="why-bother">Why Bother?</h3>

<p>I am working with Adam Barth and Ian Hickson to update <a href="http://tools.ietf.org/html/draft-abarth-mime-sniff-01">draft-abarth-mime-sniff-01</a> (the content sniffing algorithm referenced by HTML5) to sniff RSS 1.0 feeds served as <code>text/html</code>. It is unlikely that we will adopt IE's algorithm, since it seems unnecessarily pathological. I am proposing the following change, which would bring the content sniffing specification in line with Firefox's sniffing algorithm:</p>

<blockquote>
<p>In the "Feed or HTML" section, insert the following steps between step 10 and step 11:</p>
<p>10a. Initialize /RDF flag/ to 0.</p>
<p>10b. Initialize /RSS flag/ to 0.</p>
<p>10c. If the bytes with positions pos to pos+23 in s are exactly equal to 0x68, 0x74, 0x74, 0x70, 0x3A, 0x2F, 0x2F, 0x70, 0x75, 0x72, 0x6C, 0x2E, 0x6F, 0x72, 0x67, 0x2F, 0x72, 0x73, 0x73, 0x2F, 0x31, 0x2E, 0x30, 0x2F respectively (ASCII for "http://purl.org/rss/1.0/"), then:</p>
<ol>
<li>Increase pos by 23.</li>
<li>Set /RSS flag/ to 1.</li>
</ol>
<p>10d. If the bytes with positions pos to pos+42 in s are exactly equal to 0x68, 0x74, 0x74, 0x70, 0x3A, 0x2F, 0x2F, 0x77, 0x77, 0x77, 0x2E, 0x77, 0x33, 0x2E, 0x6F, 0x72, 0x67, 0x2F, 0x31, 0x39, 0x39, 0x39, 0x2F, 0x30, 0x32, 0x2F, 0x32, 0x32, 0x2D, 0x72, 0x64, 0x66, 0x2D, 0x73, 0x79, 0x6E, 0x74, 0x61, 0x78, 0x2D, 0x6E, 0x73, 0x23 respectively (ASCII for "http://www.w3.org/1999/02/22-rdf-syntax-ns#"), then:</p>
<ol>
<li>Increase pos by 42.</li>
<li>Set /RDF flag/ to 1.</li>
</ol>
<p>10e. Increase pos by 1.</p>
<p>10f. If /RDF flag/ is 1, and /RSS flag/ is 1, then the /sniffed type/ of the resource is "application/rss+xml". Abort these steps.</p>
<p>10g. If pos points beyond the end of the byte stream s, then continue to step 11 of this algorithm.</p>
<p>10h. Jump back to step 10c of this algorithm.</p>
</blockquote>

<h3 id="further-reading">Further Reading</h3>

<p>You can <a href="http://wearehugh.com/public/2009/09/rss10-sniffing.txt">see the results of my research to date</a> and <a href="http://wearehugh.com/public/2009/09/feeds/">test the feeds for yourself</a>. Because my research results are plain text with embedded HTML tags, I have added 512 bytes of leading whitespace to the page to foil browsers' plain-text-or-HTML content sniffing. Mmmm -- delicious, delicious irony.</p>

<ins datetime="2010-08-31T10:54Z"><p>Update: <a href="http://pc.de/pages/content-sniffing-still-sucks-be">Belorussian translation</a> is available, provided by <a href="http://pc.de/">PC</a>.</p></ins>]]></content:encoded>
			<wfw:commentRss>http://www.htmlfive.net/sniffing-for-rss-1-0-feeds-served-as-texthtml/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Supporting New Elements in Firefox 2</title>
		<link>http://www.htmlfive.net/supporting-new-elements-in-firefox-2/</link>
		<comments>http://www.htmlfive.net/supporting-new-elements-in-firefox-2/#comments</comments>
		<pubDate>Wed, 18 Mar 2009 21:56:12 +0000</pubDate>
		<dc:creator>Simon Pieters</dc:creator>
				<category><![CDATA[Browsers]]></category>
		<category><![CDATA[DOM]]></category>
		<category><![CDATA[Elements]]></category>

		<guid isPermaLink="false">http://blog.whatwg.org/?p=587</guid>
		<description><![CDATA[<p>We have <a href="http://blog.whatwg.org/supporting-new-elements-in-ie">previously</a> <a href="http://blog.whatwg.org/styling-ie-noscript">talked</a> about how to get Internet Explorer to play ball when using the new HTML5 elements, but today I'm going to talk about Firefox 2.</p>
<p>Firefox 2 (or any other Gecko-based browser with a Gecko version pre 1.9b5) has a <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=311366">parsing bug</a> where it will close an unknown element when it sees the start tag of a "block" element like <code>p</code>, <code>h1</code>, <code>div</code>, and so forth. So if you have:</p>
<pre><code>&#60;body&#62;
 &#60;header&#62;
  &#60;h1&#62;Test&#60;/h1&#62;
 &#60;/header&#62;
 &#60;article&#62;
  &#60;p&#62;...&#60;/p&#62;
  ...
 &#60;/article&#62;
 &#60;nav&#62;
  &#60;ul&#62;...&#60;/ul&#62;
 &#60;/nav&#62;
 &#60;footer&#62;
  &#60;p&#62;...&#60;/p&#62;
 &#60;/footer&#62;
&#60;/body&#62;</code></pre>
<p>...then in Firefox 2 it will be parsed as if it were:</p>
<pre><code>&#60;body&#62;
 &#60;header&#62;
  &#60;/header&#62;&#60;h1&#62;Test&#60;/h1&#62;
 
 &#60;article&#62;
  &#60;/article&#62;&#60;p&#62;...&#60;/p&#62;
  ...
 
 &#60;nav&#62;
  &#60;/nav&#62;&#60;ul&#62;...&#60;/ul&#62;
 
 &#60;footer&#62;
  &#60;/footer&#62;&#60;p&#62;...&#60;/p&#62;
 
&#60;/body&#62;</code></pre>
<p>So if you style the new elements with CSS it will probably look completely broken in Firefox 2.</p>
<p>If you care about Firefox 2 then there are some ways to fix this:</p>
<ol>
 <li>Go back to using <code>div</code> elements
 </li><li>Use content type negotiation between <code>text/html</code> and <code>application/xhtml+xml</code>
 </li><li>Fix up the DOM with scripting
</li></ol>
<p>(1) is probably wise if your content structure changes between pages or over time. (2) also works but means that users will be exposed to the Yellow Screen of Death should a markup error slip through your system. Otherwise (3) can be worth to consider.</p>
<p>Fixing up Firefox 2's DOM is actually pretty simple if you have a consistent structure. Using the same markup as above it could look something like this:</p>
<pre><code>&#60;body&#62;
 &#60;header&#62;
  &#60;h1&#62;Test&#60;/h1&#62;
 &#60;/header&#62;
 &#60;article&#62;
  &#60;p&#62;...&#60;/p&#62;
  ...
 &#60;/article&#62;
 &#60;nav&#62;
  &#60;ul&#62;...&#60;/ul&#62;
 &#60;/nav&#62;
 &#60;footer&#62;
  &#60;p&#62;...&#60;/p&#62;
 &#60;/footer&#62;
 &#60;!--[if !IE]&#62;--&#62;&#60;script&#62;
  // dom fixup for gecko pre 1.9b5
  var n = document.getElementsByTagName('header')[0];
  if (n.childNodes.length &#60;= 1) { // the element was closed early
    var tags = ['ARTICLE', 'NAV', 'FOOTER', 'SCRIPT'];
    for (var i = 0; i &#60; tags.length; ++i) {
      while (n.nextSibling &#38;&#38; n.nextSibling.nodeName != tags[i]) {
        n.appendChild(n.nextSibling);
      }
      n = n.nextSibling;
    }
  }
 &#60;/script&#62;&#60;!--&#60;![endif]--&#62;
&#60;/body&#62;</code></pre>
<p>You might think that this script would work for IE, too, when not using the createElement hack, but apparently IE throws an exception when trying to append a child to an unknown element. So you still have to use the createElement hack for IE.</p>
<p>If you want to move the script to <code>head</code> and run it on load and you don't have anything after the footer then you would replace <code>'SCRIPT'</code> in the <code>tags</code> array with <code>undefined</code> to make it work.</p>
<p>(If you want to do content type negotiation and want to just serve XHTML to Gecko-based browsers with this bug then you should look for the substrings "Gecko/" and "rv:1.<var>x</var>" where <var>x</var> is less then 9, or "rv:1.9pre" or "rv:1.9a" or "rv:1.9b<var>x</var>" where <var>x</var> is less than 5.)</p>]]></description>
			<content:encoded><![CDATA[<p>We have <a href="http://blog.whatwg.org/supporting-new-elements-in-ie">previously</a> <a href="http://blog.whatwg.org/styling-ie-noscript">talked</a> about how to get Internet Explorer to play ball when using the new HTML5 elements, but today I'm going to talk about Firefox 2.</p>
<p>Firefox 2 (or any other Gecko-based browser with a Gecko version pre 1.9b5) has a <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=311366">parsing bug</a> where it will close an unknown element when it sees the start tag of a "block" element like <code>p</code>, <code>h1</code>, <code>div</code>, and so forth. So if you have:</p>
<pre><code>&lt;body&gt;
 &lt;header&gt;
  &lt;h1&gt;Test&lt;/h1&gt;
 &lt;/header&gt;
 &lt;article&gt;
  &lt;p&gt;...&lt;/p&gt;
  ...
 &lt;/article&gt;
 &lt;nav&gt;
  &lt;ul&gt;...&lt;/ul&gt;
 &lt;/nav&gt;
 &lt;footer&gt;
  &lt;p&gt;...&lt;/p&gt;
 &lt;/footer&gt;
&lt;/body&gt;</code></pre>
<p>...then in Firefox 2 it will be parsed as if it were:</p>
<pre><code>&lt;body&gt;
 &lt;header&gt;
  &lt;/header&gt;&lt;h1&gt;Test&lt;/h1&gt;
 
 &lt;article&gt;
  &lt;/article&gt;&lt;p&gt;...&lt;/p&gt;
  ...
 
 &lt;nav&gt;
  &lt;/nav&gt;&lt;ul&gt;...&lt;/ul&gt;
 
 &lt;footer&gt;
  &lt;/footer&gt;&lt;p&gt;...&lt;/p&gt;
 
&lt;/body&gt;</code></pre>
<p>So if you style the new elements with CSS it will probably look completely broken in Firefox 2.</p>
<p>If you care about Firefox 2 then there are some ways to fix this:</p>
<ol>
 <li>Go back to using <code>div</code> elements
 </li><li>Use content type negotiation between <code>text/html</code> and <code>application/xhtml+xml</code>
 </li><li>Fix up the DOM with scripting
</li></ol>
<p>(1) is probably wise if your content structure changes between pages or over time. (2) also works but means that users will be exposed to the Yellow Screen of Death should a markup error slip through your system. Otherwise (3) can be worth to consider.</p>
<p>Fixing up Firefox 2's DOM is actually pretty simple if you have a consistent structure. Using the same markup as above it could look something like this:</p>
<pre><code>&lt;body&gt;
 &lt;header&gt;
  &lt;h1&gt;Test&lt;/h1&gt;
 &lt;/header&gt;
 &lt;article&gt;
  &lt;p&gt;...&lt;/p&gt;
  ...
 &lt;/article&gt;
 &lt;nav&gt;
  &lt;ul&gt;...&lt;/ul&gt;
 &lt;/nav&gt;
 &lt;footer&gt;
  &lt;p&gt;...&lt;/p&gt;
 &lt;/footer&gt;
 &lt;!--[if !IE]&gt;--&gt;&lt;script&gt;
  // dom fixup for gecko pre 1.9b5
  var n = document.getElementsByTagName('header')[0];
  if (n.childNodes.length &lt;= 1) { // the element was closed early
    var tags = ['ARTICLE', 'NAV', 'FOOTER', 'SCRIPT'];
    for (var i = 0; i &lt; tags.length; ++i) {
      while (n.nextSibling &amp;&amp; n.nextSibling.nodeName != tags[i]) {
        n.appendChild(n.nextSibling);
      }
      n = n.nextSibling;
    }
  }
 &lt;/script&gt;&lt;!--&lt;![endif]--&gt;
&lt;/body&gt;</code></pre>
<p>You might think that this script would work for IE, too, when not using the createElement hack, but apparently IE throws an exception when trying to append a child to an unknown element. So you still have to use the createElement hack for IE.</p>
<p>If you want to move the script to <code>head</code> and run it on load and you don't have anything after the footer then you would replace <code>'SCRIPT'</code> in the <code>tags</code> array with <code>undefined</code> to make it work.</p>
<p>(If you want to do content type negotiation and want to just serve XHTML to Gecko-based browsers with this bug then you should look for the substrings "Gecko/" and "rv:1.<var>x</var>" where <var>x</var> is less then 9, or "rv:1.9pre" or "rv:1.9a" or "rv:1.9b<var>x</var>" where <var>x</var> is less than 5.)</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-firefox-2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Styling HTML5 markup in IE without script</title>
		<link>http://www.htmlfive.net/styling-html5-markup-in-ie-without-script/</link>
		<comments>http://www.htmlfive.net/styling-html5-markup-in-ie-without-script/#comments</comments>
		<pubDate>Sat, 17 Jan 2009 13:58:38 +0000</pubDate>
		<dc:creator>Simon Pieters</dc:creator>
				<category><![CDATA[Browsers]]></category>
		<category><![CDATA[DOM]]></category>
		<category><![CDATA[Elements]]></category>

		<guid isPermaLink="false">http://blog.whatwg.org/?p=498</guid>
		<description><![CDATA[<p>The previous post discussed how to <a href="http://blog.whatwg.org/supporting-new-elements-in-ie">enable styling of the new HTML5 elements in IE</a> by using a simple script. However, if the user has scripting disabled, the layout would probably fall apart badly.

</p><p>So that means if you care about IE users with scripting disabled, you can't use the new elements, right?

</p><p>Not necessarily.

</p><p>There are some tricks to work around the broken DOM and limited styling in IE:

<ol>
 <li>Know what the DOM looks like and target other elements than the new elements for styling.
 </li><li>Use the universal selector (<code>*</code>) to target the right element.
 </li><li>Use <code>noscript</code>.
</li></ol>

</p><p>What does this mean?

<h3>Target other elements for styling</h3>

</p><p>Consider you have the following markup:

<pre><code>&#60;body&#62;
 &#60;article&#62;
  ...
 &#60;/article&#62;
 &#60;nav&#62;
  &#60;ul&#62;
   ...
  &#60;/ul&#62;
 &#60;/nav&#62;
&#60;/body&#62;</code></pre>

</p><p>Instead of doing this:

<pre><code>* { margin:0; padding:0 }
body { background:silver }
article { border:solid; background:white; margin-left:10em }
nav { position:absolute; top:0; left:0; width:10em }</code></pre>

</p><p>...do this:

<pre><code>* { margin:0; padding:0 }
html { background:silver }
body { border:solid; background:white; margin-left:10em }
ul { position:absolute; top:0; left:0; width:10em }</code></pre>

</p><p>Now of course you're going to use other <code>ul</code> elements than the navigation, so how do we get more specific on which element to target? The obvious solution is to set a class or id on the <code>ul</code> element, but there's another solution which might be more convenient in some cases, which brings me to...

<h3>Using the universal selector</h3>

</p><p>Depending on the situation, and whether you care about IE6 or not, you can use the universal selector to target the element you want.

</p><p>Consider you have the following markup:

<pre><code>&#60;body&#62;
 &#60;article&#62;
  &#60;header&#62;
   &#60;h1&#62;...&#60;/h1&#62;
   &#60;p&#62;...&#60;/p&#62;
  &#60;/header&#62;
  ...</code></pre>

</p><p>...and you want to style the <code>p</code> that is in <code>header</code>, you would do this in the normal case:

<pre><code>article header p { font-weight:bold }</code></pre>

</p><p>But in IE, the <code>article</code>, <code>header</code>, <code>h1</code> and <code>p</code> elements are all siblings, so the selector wouldn't match.

</p><p>So then one would expect this to match, but it doesn't (IE doesn't allow selecting unknown elements using type selectors):

</p><pre><code>article + header + h1 + p { font-weight:bold }</code></pre>

<p>However, this matches:

<pre><code>body &#62; * + * + h1 + p { font-weight:bold }</code></pre>

<h3>Using <code>noscript</code></h3>

</p><p>The above techniques shouldn't mess up other browsers (or IE when scripting is enabled), however if you prefer (or if something would screw up) you can use a separate style sheet for IE when scripting is disabled by just using the following markup:

<pre><code>&#60;head&#62;
 &#60;!--[if IE]&#62;
  &#60;noscript&#62;&#60;link rel="stylesheet" href="ie-noscript.css"&#62;&#60;/noscript&#62;
 &#60;![endif]--&#62;
 ...</code></pre>

<h3>Conclusion</h3>

</p><p>The above techniques might not be very scalable or might well impact maintanence, but the point of this article is to show that it is <em>possible</em> to use the new elements while still supporting IE with scripting disabled.</p>]]></description>
			<content:encoded><![CDATA[<p>The previous post discussed how to <a href="http://blog.whatwg.org/supporting-new-elements-in-ie">enable styling of the new HTML5 elements in IE</a> by using a simple script. However, if the user has scripting disabled, the layout would probably fall apart badly.

</p><p>So that means if you care about IE users with scripting disabled, you can't use the new elements, right?

</p><p>Not necessarily.

</p><p>There are some tricks to work around the broken DOM and limited styling in IE:

<ol>
 <li>Know what the DOM looks like and target other elements than the new elements for styling.
 </li><li>Use the universal selector (<code>*</code>) to target the right element.
 </li><li>Use <code>noscript</code>.
</li></ol>

</p><p>What does this mean?

<h3>Target other elements for styling</h3>

</p><p>Consider you have the following markup:

<pre><code>&lt;body&gt;
 &lt;article&gt;
  ...
 &lt;/article&gt;
 &lt;nav&gt;
  &lt;ul&gt;
   ...
  &lt;/ul&gt;
 &lt;/nav&gt;
&lt;/body&gt;</code></pre>

</p><p>Instead of doing this:

<pre><code>* { margin:0; padding:0 }
body { background:silver }
article { border:solid; background:white; margin-left:10em }
nav { position:absolute; top:0; left:0; width:10em }</code></pre>

</p><p>...do this:

<pre><code>* { margin:0; padding:0 }
html { background:silver }
body { border:solid; background:white; margin-left:10em }
ul { position:absolute; top:0; left:0; width:10em }</code></pre>

</p><p>Now of course you're going to use other <code>ul</code> elements than the navigation, so how do we get more specific on which element to target? The obvious solution is to set a class or id on the <code>ul</code> element, but there's another solution which might be more convenient in some cases, which brings me to...

<h3>Using the universal selector</h3>

</p><p>Depending on the situation, and whether you care about IE6 or not, you can use the universal selector to target the element you want.

</p><p>Consider you have the following markup:

<pre><code>&lt;body&gt;
 &lt;article&gt;
  &lt;header&gt;
   &lt;h1&gt;...&lt;/h1&gt;
   &lt;p&gt;...&lt;/p&gt;
  &lt;/header&gt;
  ...</code></pre>

</p><p>...and you want to style the <code>p</code> that is in <code>header</code>, you would do this in the normal case:

<pre><code>article header p { font-weight:bold }</code></pre>

</p><p>But in IE, the <code>article</code>, <code>header</code>, <code>h1</code> and <code>p</code> elements are all siblings, so the selector wouldn't match.

</p><p>So then one would expect this to match, but it doesn't (IE doesn't allow selecting unknown elements using type selectors):

</p><pre><code>article + header + h1 + p { font-weight:bold }</code></pre>

<p>However, this matches:

<pre><code>body &gt; * + * + h1 + p { font-weight:bold }</code></pre>

<h3>Using <code>noscript</code></h3>

</p><p>The above techniques shouldn't mess up other browsers (or IE when scripting is enabled), however if you prefer (or if something would screw up) you can use a separate style sheet for IE when scripting is disabled by just using the following markup:

<pre><code>&lt;head&gt;
 &lt;!--[if IE]&gt;
  &lt;noscript&gt;&lt;link rel="stylesheet" href="ie-noscript.css"&gt;&lt;/noscript&gt;
 &lt;![endif]--&gt;
 ...</code></pre>

<h3>Conclusion</h3>

</p><p>The above techniques might not be very scalable or might well impact maintanence, but the point of this article is to show that it is <em>possible</em> to use the new elements while still supporting IE with scripting disabled.</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/styling-html5-markup-in-ie-without-script/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>Dlaczego atrybut alt można pominąć</title>
		<link>http://www.htmlfive.net/dlaczego-atrybut-alt-mozna-pominac/</link>
		<comments>http://www.htmlfive.net/dlaczego-atrybut-alt-mozna-pominac/#comments</comments>
		<pubDate>Sun, 13 Jan 2008 16:24:23 +0000</pubDate>
		<dc:creator>Sebastian Snopek</dc:creator>
				<category><![CDATA[Browsers]]></category>
		<category><![CDATA[Elements]]></category>
		<category><![CDATA[Processing Model]]></category>

		<guid isPermaLink="false">http://blog.whatwg.org/dlaczego-atrybut-alt-mozna-pominac-polish</guid>
		<description><![CDATA[<p>This is a Polish translation of this article: <a href="http://blog.whatwg.org/omit-alt">Why the Alt Attribute May Be Omitted</a>.</p>

<p>Prace prowadzone ostatnio nad<a href="http://www.whatwg.org/specs/web-apps/current-work/multipage/section-embedded.html#alt"> specyfikacją atrybutu<code> alt</code></a> mają na celu gruntowną poprawę jego definicji, m.in. dokładne wyjaśnienie sposobów tworzenia poprawnego tekstu zastępczego oraz jasne sprecyzowanie wymagań autorskie.</p>

<p>Wymagania te określają sytuacje, w których konieczne jest użycie tekstu zastępczego, zastosowanie pustego atrybutu  <code>alt</code> oraz, co najbardziej zaskakujące, kiedy atrybut  <code>alt</code><em> można</em> całkowicie pominąć. Jest to kwestia kontrowersyjna, ponieważ na pierwszy rzut oka wygląda to na próbę zachęcania do złego i sprzecznego z zasadami dostępności zwyczaju pomijania atrybutu <code>alt</code>, co wydaje się być kolejnym policzkiem dla dostępności w sieci. Jest to niewłaściwe rozumowanie, które należy przeanalizować ze szczególną uwagą tak, aby rozwiać wszelkie wątpliwości, jakie mogą powstać. Choć taka sytuacja wydawać się może uwstecznieniem jest to w rzeczywistości <em>bardzo pozytywny</em> zabieg.</p><p>

</p><p>W wielu sytuacjach tekst zastępczy jest po prostu niedostępny i nic nie można na to poradzić. Przykładowo, większość użytków serwisów wymiany zdjęć takich jak <a href="http://flickr.com/">Flickr</a> nie miałoby pojęcia jak, ani dlaczego, należy dołączyć tekst zastępczy, nawet gdyby Flickr dawał im taką możliwość. Chociaż wszyscy są zgodni co do tego, że wspaniale byłoby gdyby wszyscy użytkownicy stosowali tekst zastępczy (specyfikacja wyraźnie to zaleca), to większość z nich po prostu tego nie zrobi.</p>

<p>Należy zastanowić się nad problemem co zrobić w sytuacji kiedy tekst  <code>alt</code> jest niedostępny i nie ma tak naprawdę sposobu żeby go wstawić. Przy obecnych wymaganiach stosowania atrybutu  <code>alt</code> w HTML4 zaobserwować można próby spełnienia tego wymagania przez systemy, które podejmują próbę utworzenia tekstu zastępczego w oparciu o metadane obrazu.</p>

<p>Flickr na przykład powtarza tytuł obrazu;  <a href="http://photobucket.com/">Photobucket</a> najwyraźniej łączy ze sobą nazwę pliku, jego tytuł i nazwę autora; z kolei Wikpedia niepotrzebnie powtarza podpis pod obrazem. Problemem wynikającym z takiego podejścia jest to, że stosowanie takich wartości <em>nie dostarcza ani dodatkowych ani użytecznych informacji </em> dotyczących obrazu, co w niektórych przypadkach jest gorsze niż całkowity brak tekstu zastępczego.</p>

<p>Korzyścią płynącą z wymogu opuszczenia atrybutu  <code>alt</code> zamiast pozostawienia po prostu pustej wartości jest jasne rozróżnienie pomiędzy obrazem, który nie posiada tekstu zastępczego (jak np. reprezentacja otaczającego tekstu w postaci grafiki lub ikony) a obrazem będącym kluczowym elementem zawartości, dla którego tekst zastępczy nie jest dostępny. <a href="http://lists.whatwg.org/htdig.cgi/whatwg-whatwg.org/2007-April/010991.html">Podobno</a> Lynx i Opera stosują już takie rozróżnienie. Przy obrazach bez atrybutu <code>alt</code> Lynx wyświetla nazwę pliku a Opera pokazuje napis "Obraz", jednak żadne z nich nie wyświetla niczego przy obrazach z pustym atrybutem <code>alt</code>. Wciąż niewiadomo do końca czy takie rozróżnienie jest naprawdę użyteczne oraz czy przeglądarki mogą realistycznie je stosować. Kwestia ta jest otwarta do dyskusji jeżeli tylko ktoś dysponuje argumentami.</p>

<p>Sugeruje się też, że zrezygnowanie z bezwarunkowej konieczności stosowania atrybutu  <code>alt</code> wpłynie na zdolność walidatorów do powiadamiania autorów o błędach i odbierze nam narzędzie pomocne w promowaniu dostępności. Jednak wykorzystywanie komunikatów o błędach walidacji jako narzędzia oświatowego nie jest ani jedynym ani najlepszym rozwiązaniem problemu.</p>

<p>O ile autorzy lubią wiedzieć kiedy przypadkowo pominęli atrybut <code>alt, </code>to bezwarunkowe wymuszanie użycia tego atrybutu przy wykorzystaniu tak prymitywnego narzędzia jakim jest walidator daje dokładnie przeciwne wynik, ponieważ zachęca do korzystania z generowanych automatycznie tekstów kiepskiej jakości. Zresztą nic nie powstrzyma narzędzi autorskich i sprawdzających zgodność ze standardami przed powiadomieniem autorów jeśli będą sobie tego życzyć.</p>

<p>Przyznając, że nie da się zmusić każdego do stosowania tekstu zastępczego i czyniąc atrybut alt opcjonalnym w standardach dokumentu nie traci się żadnych praktycznych korzyści płynących z dostępności. Nikt nie twierdzi, że zgodność z HTML5 jest tym samym co zgodność ze wymogami dostępności. Wiele rzeczy uważa się za spełniające techniczne wymogi HTML, a jednak ich niewłaściwe stosowanie czyni je niedostępnymi. Uczynienie atrybutu alt opcjonalnym nie jest sprzeczne z wymogami dostępności ani nie ma wielkiego wpływu na ich propagowanie. Opisuję tu tylko rzeczywistość mając przy tym nadzieję na zmniejszenie powszechności automatycznie generowanego tekstu alt kiepskiej jakości.</p>]]></description>
			<content:encoded><![CDATA[<p>This is a Polish translation of this article: <a href="http://blog.whatwg.org/omit-alt">Why the Alt Attribute May Be Omitted</a>.</p>

<p>Prace prowadzone ostatnio nad<a href="http://www.whatwg.org/specs/web-apps/current-work/multipage/section-embedded.html#alt"> specyfikacją atrybutu<code> alt</code></a> mają na celu gruntowną poprawę jego definicji, m.in. dokładne wyjaśnienie sposobów tworzenia poprawnego tekstu zastępczego oraz jasne sprecyzowanie wymagań autorskie.</p>

<p>Wymagania te określają sytuacje, w których konieczne jest użycie tekstu zastępczego, zastosowanie pustego atrybutu  <code>alt</code> oraz, co najbardziej zaskakujące, kiedy atrybut  <code>alt</code><em> można</em> całkowicie pominąć. Jest to kwestia kontrowersyjna, ponieważ na pierwszy rzut oka wygląda to na próbę zachęcania do złego i sprzecznego z zasadami dostępności zwyczaju pomijania atrybutu <code>alt</code>, co wydaje się być kolejnym policzkiem dla dostępności w sieci. Jest to niewłaściwe rozumowanie, które należy przeanalizować ze szczególną uwagą tak, aby rozwiać wszelkie wątpliwości, jakie mogą powstać. Choć taka sytuacja wydawać się może uwstecznieniem jest to w rzeczywistości <em>bardzo pozytywny</em> zabieg.</p><p>

</p><p>W wielu sytuacjach tekst zastępczy jest po prostu niedostępny i nic nie można na to poradzić. Przykładowo, większość użytków serwisów wymiany zdjęć takich jak <a href="http://flickr.com/">Flickr</a> nie miałoby pojęcia jak, ani dlaczego, należy dołączyć tekst zastępczy, nawet gdyby Flickr dawał im taką możliwość. Chociaż wszyscy są zgodni co do tego, że wspaniale byłoby gdyby wszyscy użytkownicy stosowali tekst zastępczy (specyfikacja wyraźnie to zaleca), to większość z nich po prostu tego nie zrobi.</p>

<p>Należy zastanowić się nad problemem co zrobić w sytuacji kiedy tekst  <code>alt</code> jest niedostępny i nie ma tak naprawdę sposobu żeby go wstawić. Przy obecnych wymaganiach stosowania atrybutu  <code>alt</code> w HTML4 zaobserwować można próby spełnienia tego wymagania przez systemy, które podejmują próbę utworzenia tekstu zastępczego w oparciu o metadane obrazu.</p>

<p>Flickr na przykład powtarza tytuł obrazu;  <a href="http://photobucket.com/">Photobucket</a> najwyraźniej łączy ze sobą nazwę pliku, jego tytuł i nazwę autora; z kolei Wikpedia niepotrzebnie powtarza podpis pod obrazem. Problemem wynikającym z takiego podejścia jest to, że stosowanie takich wartości <em>nie dostarcza ani dodatkowych ani użytecznych informacji </em> dotyczących obrazu, co w niektórych przypadkach jest gorsze niż całkowity brak tekstu zastępczego.</p>

<p>Korzyścią płynącą z wymogu opuszczenia atrybutu  <code>alt</code> zamiast pozostawienia po prostu pustej wartości jest jasne rozróżnienie pomiędzy obrazem, który nie posiada tekstu zastępczego (jak np. reprezentacja otaczającego tekstu w postaci grafiki lub ikony) a obrazem będącym kluczowym elementem zawartości, dla którego tekst zastępczy nie jest dostępny. <a href="http://lists.whatwg.org/htdig.cgi/whatwg-whatwg.org/2007-April/010991.html">Podobno</a> Lynx i Opera stosują już takie rozróżnienie. Przy obrazach bez atrybutu <code>alt</code> Lynx wyświetla nazwę pliku a Opera pokazuje napis "Obraz", jednak żadne z nich nie wyświetla niczego przy obrazach z pustym atrybutem <code>alt</code>. Wciąż niewiadomo do końca czy takie rozróżnienie jest naprawdę użyteczne oraz czy przeglądarki mogą realistycznie je stosować. Kwestia ta jest otwarta do dyskusji jeżeli tylko ktoś dysponuje argumentami.</p>

<p>Sugeruje się też, że zrezygnowanie z bezwarunkowej konieczności stosowania atrybutu  <code>alt</code> wpłynie na zdolność walidatorów do powiadamiania autorów o błędach i odbierze nam narzędzie pomocne w promowaniu dostępności. Jednak wykorzystywanie komunikatów o błędach walidacji jako narzędzia oświatowego nie jest ani jedynym ani najlepszym rozwiązaniem problemu.</p>

<p>O ile autorzy lubią wiedzieć kiedy przypadkowo pominęli atrybut <code>alt, </code>to bezwarunkowe wymuszanie użycia tego atrybutu przy wykorzystaniu tak prymitywnego narzędzia jakim jest walidator daje dokładnie przeciwne wynik, ponieważ zachęca do korzystania z generowanych automatycznie tekstów kiepskiej jakości. Zresztą nic nie powstrzyma narzędzi autorskich i sprawdzających zgodność ze standardami przed powiadomieniem autorów jeśli będą sobie tego życzyć.</p>

<p>Przyznając, że nie da się zmusić każdego do stosowania tekstu zastępczego i czyniąc atrybut alt opcjonalnym w standardach dokumentu nie traci się żadnych praktycznych korzyści płynących z dostępności. Nikt nie twierdzi, że zgodność z HTML5 jest tym samym co zgodność ze wymogami dostępności. Wiele rzeczy uważa się za spełniające techniczne wymogi HTML, a jednak ich niewłaściwe stosowanie czyni je niedostępnymi. Uczynienie atrybutu alt opcjonalnym nie jest sprzeczne z wymogami dostępności ani nie ma wielkiego wpływu na ich propagowanie. Opisuję tu tylko rzeczywistość mając przy tym nadzieję na zmniejszenie powszechności automatycznie generowanego tekstu alt kiepskiej jakości.</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/dlaczego-atrybut-alt-mozna-pominac/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
